1 | <?php |
||
12 | class PurchaseRequest extends AuthorizeRequest |
||
13 | { |
||
14 | /** |
||
15 | * Get phone. |
||
16 | * |
||
17 | 18 | * @return string |
|
18 | */ |
||
19 | 18 | public function getPhone() |
|
23 | |||
24 | /** |
||
25 | * Set phone. |
||
26 | * |
||
27 | * @param string $value |
||
28 | * |
||
29 | 4 | * @return static|AbstractRequest |
|
30 | */ |
||
31 | 4 | public function setPhone($value) |
|
35 | |||
36 | /** |
||
37 | * Get custom field 2. |
||
38 | * |
||
39 | 10 | * @return string |
|
40 | */ |
||
41 | 10 | public function getCf2() |
|
45 | |||
46 | /** |
||
47 | * Set custom field 2. |
||
48 | * |
||
49 | * @param string $value |
||
50 | * |
||
51 | 4 | * @return static|AbstractRequest |
|
52 | */ |
||
53 | 4 | public function setCf2($value) |
|
57 | |||
58 | /** |
||
59 | * Get custom field 3. |
||
60 | * |
||
61 | 10 | * @return string |
|
62 | */ |
||
63 | 10 | public function getCf3() |
|
67 | |||
68 | /** |
||
69 | * Set custom field 3. |
||
70 | * |
||
71 | * @param string $value |
||
72 | * |
||
73 | 4 | * @return static|AbstractRequest |
|
74 | */ |
||
75 | 4 | public function setCf3($value) |
|
79 | |||
80 | /** |
||
81 | * Get callback URL. |
||
82 | * |
||
83 | 10 | * @return string |
|
84 | */ |
||
85 | 10 | public function getCallbackUrl() |
|
89 | |||
90 | /** |
||
91 | * Set callback URL. |
||
92 | * |
||
93 | * @param string $value |
||
94 | * |
||
95 | 4 | * @return static|AbstractRequest |
|
96 | */ |
||
97 | 4 | public function setCallbackUrl($value) |
|
101 | |||
102 | /** |
||
103 | * Get apple reference. |
||
104 | * |
||
105 | * @return string |
||
106 | 10 | */ |
|
107 | public function getAppleReference() |
||
111 | 2 | ||
112 | 2 | /** |
|
113 | 2 | * Set apple reference. |
|
114 | 2 | * |
|
115 | * @param string $value |
||
116 | 2 | * @return static|AbstractRequest |
|
117 | */ |
||
118 | public function setAppleReference($value) |
||
122 | 2 | ||
123 | 2 | /** |
|
124 | 2 | * Get the raw data array for this message. The format of this varies from gateway to |
|
125 | 2 | * gateway, but will usually be either an associative array, or a SimpleXMLElement. |
|
126 | 2 | * |
|
127 | 2 | * @return array |
|
128 | 2 | */ |
|
129 | 2 | public function getData() |
|
205 | |||
206 | /** |
||
207 | * Get a request token. |
||
208 | * |
||
209 | * @return string |
||
210 | */ |
||
211 | public function getRequestToken() |
||
215 | } |
||
216 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: