Code Duplication    Length = 16-16 lines in 2 locations

src/Module/ModuleManagerImpl.php 1 location

@@ 301-316 (lines=16) @@
298
    /**
299
     * {@inheritdoc}
300
     */
301
    public function hasModules(Expression $expr = null)
302
    {
303
        $this->assertModulesLoaded();
304
305
        if (!$expr) {
306
            return !$this->modules->isEmpty();
307
        }
308
309
        foreach ($this->modules as $module) {
310
            if ($expr->evaluate($module)) {
311
                return true;
312
            }
313
        }
314
315
        return false;
316
    }
317
318
    /**
319
     * {@inheritdoc}

src/Server/ModuleFileServerManager.php 1 location

@@ 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
    {