1 | <?php |
||
33 | class DeploymentService |
||
34 | { |
||
35 | /** |
||
36 | * Eloquent model representing the allocation to use. |
||
37 | * |
||
38 | * @var \Pterodactyl\Models\Allocation |
||
39 | */ |
||
40 | protected $allocation; |
||
41 | |||
42 | /** |
||
43 | * Amount of disk to be used by the server. |
||
44 | * |
||
45 | * @var int |
||
46 | */ |
||
47 | protected $disk; |
||
48 | |||
49 | /** |
||
50 | * Amount of memory to be used by the sever. |
||
51 | * |
||
52 | * @var int |
||
53 | */ |
||
54 | protected $memory; |
||
55 | |||
56 | /** |
||
57 | * Eloquent model representing the location to use. |
||
58 | * |
||
59 | * @var \Pterodactyl\Models\Location |
||
60 | */ |
||
61 | protected $location; |
||
62 | |||
63 | /** |
||
64 | * Eloquent model representing the node to use. |
||
65 | * |
||
66 | * @var \Pterodactyl\Models\Node |
||
67 | */ |
||
68 | protected $node; |
||
69 | |||
70 | /** |
||
71 | * Set the location to use when auto-deploying. |
||
72 | * |
||
73 | * @param int|\Pterodactyl\Models\Location $location |
||
74 | * @return void |
||
75 | */ |
||
76 | public function setLocation($location) |
||
89 | |||
90 | /** |
||
91 | * Set the node to use when auto-deploying. |
||
92 | * |
||
93 | * @param int|\Pterodactyl\Models\Node $node |
||
94 | * @return void |
||
95 | */ |
||
96 | public function setNode($node) |
||
107 | |||
108 | /** |
||
109 | * Set the amount of disk space to be used by the new server. |
||
110 | * |
||
111 | * @param int $disk |
||
112 | * @return void |
||
113 | */ |
||
114 | public function setDisk(int $disk) |
||
120 | |||
121 | /** |
||
122 | * Set the amount of memory to be used by the new server. |
||
123 | * |
||
124 | * @param int $memory |
||
125 | * @return void |
||
126 | */ |
||
127 | public function setMemory(int $memory) |
||
133 | |||
134 | /** |
||
135 | * Return a random location model. |
||
136 | * |
||
137 | * @param array $exclude |
||
138 | * @return void; |
||
139 | */ |
||
140 | protected function findLocation(array $exclude = []) |
||
154 | |||
155 | /** |
||
156 | * Return a model instance of a random node. |
||
157 | * |
||
158 | * @return void; |
||
159 | */ |
||
160 | protected function findNode(array $exclude = []) |
||
177 | |||
178 | /** |
||
179 | * Checks that a node's allocation limits will not be passed |
||
180 | * with the assigned limits. |
||
181 | * |
||
182 | * @return bool |
||
183 | */ |
||
184 | protected function checkNodeUsage() |
||
210 | |||
211 | /** |
||
212 | * Return the assigned node for this auto-deployment. |
||
213 | * |
||
214 | * @return \Pterodactyl\Models\Node |
||
215 | */ |
||
216 | public function node() { |
||
219 | |||
220 | /** |
||
221 | * Return the assigned location for this auto-deployment. |
||
222 | * |
||
223 | * @return \Pterodactyl\Models\Location |
||
224 | */ |
||
225 | public function location() { |
||
228 | |||
229 | /** |
||
230 | * Return the assigned location for this auto-deployment. |
||
231 | * |
||
232 | * @return \Pterodactyl\Models\Allocation |
||
233 | */ |
||
234 | public function allocation() { |
||
237 | |||
238 | /** |
||
239 | * Select and return the node to be used by the auto-deployment system. |
||
240 | * |
||
241 | * @return void |
||
242 | */ |
||
243 | public function select() { |
||
254 | } |
||
255 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: