@@ 301-316 (lines=16) @@ | ||
298 | /** |
|
299 | * {@inheritdoc} |
|
300 | */ |
|
301 | public function hasPackages(Expression $expr = null) |
|
302 | { |
|
303 | $this->assertPackagesLoaded(); |
|
304 | ||
305 | if (!$expr) { |
|
306 | return !$this->packages->isEmpty(); |
|
307 | } |
|
308 | ||
309 | foreach ($this->packages as $package) { |
|
310 | if ($expr->evaluate($package)) { |
|
311 | return true; |
|
312 | } |
|
313 | } |
|
314 | ||
315 | return false; |
|
316 | } |
|
317 | ||
318 | /** |
|
319 | * {@inheritdoc} |
@@ 194-209 (lines=16) @@ | ||
191 | /** |
|
192 | * {@inheritdoc} |
|
193 | */ |
|
194 | public function hasServers(Expression $expr = null) |
|
195 | { |
|
196 | $this->assertServersLoaded(); |
|
197 | ||
198 | if (!$expr) { |
|
199 | return !$this->servers->isEmpty(); |
|
200 | } |
|
201 | ||
202 | foreach ($this->servers as $server) { |
|
203 | if ($expr->evaluate($server)) { |
|
204 | return true; |
|
205 | } |
|
206 | } |
|
207 | ||
208 | return false; |
|
209 | } |
|
210 | ||
211 | private function assertServersLoaded() |
|
212 | { |