Code Duplication    Length = 20-20 lines in 2 locations

src/dispatcher/Dispatcher.class.php 2 locations

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