Code Duplication    Length = 20-20 lines in 2 locations

src/dispatcher/Dispatcher.class.php 2 locations

@@ 331-350 (lines=20) @@
328
     * @author     Felix Gilcher <[email protected]>
329
     * @since      1.0.0
330
     */
331
    public function checkControllerFile($moduleName, $controllerName)
332
    {
333
        $this->initializeModule($moduleName);
334
335
336
        $controllerName = Toolkit::canonicalName(Toolkit::stripNamespace($controllerName));
337
        $file = Toolkit::evaluateModuleDirective(
338
            $moduleName,
339
            'agavi.controller.path',
340
            array(
341
                'moduleName' => $moduleName,
342
                'controllerName' => $controllerName,
343
            )
344
        );
345
        
346
        if (is_readable($file) && substr($controllerName, 0, 1) !== '/') {
347
            return $file;
348
        }
349
        return false;
350
    }
351
    
352
    /**
353
     * Retrieve an Controller implementation instance.
@@ 424-443 (lines=20) @@
421
     * @author     Felix Gilcher <[email protected]>
422
     * @since      1.0.0
423
     */
424
    public function checkViewFile($moduleName, $viewName)
425
    {
426
        $this->initializeModule($moduleName);
427
        
428
        $viewName = Toolkit::canonicalName(Toolkit::stripNamespace($viewName));
429
        $file = Toolkit::evaluateModuleDirective(
430
            $moduleName,
431
            'agavi.view.path',
432
            array(
433
                'moduleName' => $moduleName,
434
                'viewName' => $viewName,
435
            )
436
        );
437
        
438
        if (is_readable($file) && substr($viewName, 0, 1) !== '/') {
439
            return $file;
440
        }
441
        
442
        return false;
443
    }
444
    
445
    /**
446
     * Retrieve a View implementation instance.