1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Sync;
4:
5: use Salient\Contract\Core\Comparable;
6: use Salient\Contract\Core\Immutable;
7: use Salient\Contract\Core\MessageLevel as Level;
8:
9: interface SyncErrorInterface extends Comparable, Immutable
10: {
11: /**
12: * Get the error's type
13: *
14: * @return SyncErrorType::*
15: */
16: public function getType(): int;
17:
18: /**
19: * Get the error's severity/message level
20: *
21: * @return Level::*
22: */
23: public function getLevel(): int;
24:
25: /**
26: * Get a code unique to the error's type and severity/message level
27: */
28: public function getCode(): string;
29:
30: /**
31: * Get an explanation of the error
32: */
33: public function getMessage(): string;
34:
35: /**
36: * Get an sprintf() format string that explains the error
37: */
38: public function getFormat(): string;
39:
40: /**
41: * Get values applied to the message format string
42: *
43: * @return list<mixed[]|object|int|float|string|bool|null>
44: */
45: public function getValues(): array;
46:
47: /**
48: * Get the sync provider associated with the error
49: */
50: public function getProvider(): ?SyncProviderInterface;
51:
52: /**
53: * Get the entity associated with the error
54: */
55: public function getEntity(): ?SyncEntityInterface;
56:
57: /**
58: * Get the display name of the entity associated with the error
59: */
60: public function getEntityName(): ?string;
61:
62: /**
63: * Get the number of times the error has been reported
64: */
65: public function getCount(): int;
66:
67: /**
68: * Get an instance where the number of times the error has been reported is
69: * incremented
70: *
71: * @return static
72: */
73: public function count();
74: }
75: