PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 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 All 257 releases
give / src / Framework / FieldsAPI / Exceptions / NameCollisionException.php

NameCollisionException.php in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at src/Framework/FieldsAPI/Exceptions/NameCollisionException.php

70 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Framework\FieldsAPI\Exceptions;
4
5 use Give\Framework\Exceptions\Primitives\Exception;
6 use Give\Framework\FieldsAPI\Contracts\Node;
7
8 /**
9 * @since 2.32.0 add existing and incoming nodes to exception
10 * @since 2.10.2
11 */
12 class NameCollisionException extends Exception
13 {
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 /**
28 * @since 4.17.0 Declare the nullable parameter explicitly.
29 */
30 public function __construct(
31 string $name,
32 Node $existingNode,
33 Node $incomingNode,
34 int $code = 0,
35 ?Exception $previous = null
36 )
37 {
38 $this->nodeNameCollision = $name;
39 $this->existingNode = $existingNode;
40 $this->incomingNode = $incomingNode;
41
42 $message = "Node name collision for $name";
43 parent::__construct($message, $code, $previous);
44 }
45
46 /**
47 * @since 2.32.0
48 */
49 public function getNodeNameCollision(): string
50 {
51 return $this->nodeNameCollision;
52 }
53
54 /**
55 * @since 2.32.0
56 */
57 public function getIncomingNode(): Node
58 {
59 return $this->incomingNode;
60 }
61
62 /**
63 * @since 2.32.0
64 */
65 public function getExistingNode(): Node
66 {
67 return $this->existingNode;
68 }
69 }
70