PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
← All changes | src/Framework/FieldsAPI/Exceptions/NameCollisionException.php +50 -1 2.30.04.16.9 View file →
@@ -2,16 +2,65 @@
2 2
3 3 namespace Give\Framework\FieldsAPI\Exceptions;
4 4
5 5 use Give\Framework\Exceptions\Primitives\Exception;
6 +use Give\Framework\FieldsAPI\Contracts\Node;
6 7
7 8 /**
9 + * @since 2.32.0 add existing and incoming nodes to exception
8 10 * @since 2.10.2
9 11 */
10 12 class NameCollisionException extends Exception
11 13 {
12 - public function __construct($name, $code = 0, Exception $previous = null)
14 + /**
15 + * @var string
16 + */
17 + protected $nodeNameCollision;
18 + /**
19 + * @var Node
20 + */
21 + protected $existingNode;
22 + /**
23 + * @var Node
24 + */
25 + protected $incomingNode;
26 +
27 + public function __construct(
28 + string $name,
29 + Node $existingNode,
30 + Node $incomingNode,
31 + int $code = 0,
32 + Exception $previous = null
33 + )
13 34 {
35 + $this->nodeNameCollision = $name;
36 + $this->existingNode = $existingNode;
37 + $this->incomingNode = $incomingNode;
38 +
14 39 $message = "Node name collision for $name";
15 40 parent::__construct($message, $code, $previous);
41 + }
42 +
43 + /**
44 + * @since 2.32.0
45 + */
46 + public function getNodeNameCollision(): string
47 + {
48 + return $this->nodeNameCollision;
49 + }
50 +
51 + /**
52 + * @since 2.32.0
53 + */
54 + public function getIncomingNode(): Node
55 + {
56 + return $this->incomingNode;
57 + }
58 +
59 + /**
60 + * @since 2.32.0
61 + */
62 + public function getExistingNode(): Node
63 + {
64 + return $this->existingNode;
16 65 }
17 66 }