Code Duplication    Length = 2-2 lines in 5 locations

src/Module.php 5 locations

@@ 498-499 (lines=2) @@
495
        }
496
497
        if (function_exists($this->id)) $this->controllers[self::CTR_BASE] = $this->id;
498
        if (method_exists($this, self::CTR_BASE)) $this->controllers[self::CTR_BASE] = array($this, self::CTR_BASE);
499
        else if (method_exists($this, self::CTR_CACHE_BASE)) $this->controllers[self::CTR_BASE] = array($this, self::CTR_CACHE_BASE);
500
501
        if (function_exists($this->id . self::CTR_POST)) $this->controllers[self::CTR_POST] = $this->id . self::CTR_POST;
502
        if (method_exists($this, self::CTR_POST)) $this->controllers[self::CTR_POST] = array($this, self::CTR_POST);
@@ 502-503 (lines=2) @@
499
        else if (method_exists($this, self::CTR_CACHE_BASE)) $this->controllers[self::CTR_BASE] = array($this, self::CTR_CACHE_BASE);
500
501
        if (function_exists($this->id . self::CTR_POST)) $this->controllers[self::CTR_POST] = $this->id . self::CTR_POST;
502
        if (method_exists($this, self::CTR_POST)) $this->controllers[self::CTR_POST] = array($this, self::CTR_POST);
503
        else if (method_exists($this, self::CTR_CACHE_POST)) $this->controllers[self::CTR_POST] = array($this, self::CTR_CACHE_POST);
504
505
        if (function_exists($this->id . self::CTR_PUT)) $this->controllers[self::CTR_PUT] = $this->id . self::CTR_PUT;
506
        if (method_exists($this, self::CTR_PUT)) $this->controllers[self::CTR_PUT] = array($this, self::CTR_PUT);
@@ 506-507 (lines=2) @@
503
        else if (method_exists($this, self::CTR_CACHE_POST)) $this->controllers[self::CTR_POST] = array($this, self::CTR_CACHE_POST);
504
505
        if (function_exists($this->id . self::CTR_PUT)) $this->controllers[self::CTR_PUT] = $this->id . self::CTR_PUT;
506
        if (method_exists($this, self::CTR_PUT)) $this->controllers[self::CTR_PUT] = array($this, self::CTR_PUT);
507
        else if (method_exists($this, self::CTR_CACHE_PUT)) $this->controllers[self::CTR_PUT] = array($this, self::CTR_CACHE_PUT);
508
509
        if (function_exists($this->id . self::CTR_DELETE)) $this->controllers[self::CTR_DELETE] = $this->id . self::CTR_DELETE;
510
        if (method_exists($this, self::CTR_DELETE)) $this->controllers[self::CTR_DELETE] = array($this, self::CTR_DELETE);
@@ 510-511 (lines=2) @@
507
        else if (method_exists($this, self::CTR_CACHE_PUT)) $this->controllers[self::CTR_PUT] = array($this, self::CTR_CACHE_PUT);
508
509
        if (function_exists($this->id . self::CTR_DELETE)) $this->controllers[self::CTR_DELETE] = $this->id . self::CTR_DELETE;
510
        if (method_exists($this, self::CTR_DELETE)) $this->controllers[self::CTR_DELETE] = array($this, self::CTR_DELETE);
511
        else if (method_exists($this, self::CTR_CACHE_DELETE)) $this->controllers[self::CTR_DELETE] = array($this, self::CTR_CACHE_DELETE);
512
513
        if (function_exists($this->id . self::CTR_UNI)) $this->controllers[self::CTR_UNI] = $this->id . self::CTR_UNI;
514
        if (method_exists($this, self::CTR_UNI)) $this->controllers[self::CTR_UNI] = array($this, self::CTR_UNI);
@@ 514-515 (lines=2) @@
511
        else if (method_exists($this, self::CTR_CACHE_DELETE)) $this->controllers[self::CTR_DELETE] = array($this, self::CTR_CACHE_DELETE);
512
513
        if (function_exists($this->id . self::CTR_UNI)) $this->controllers[self::CTR_UNI] = $this->id . self::CTR_UNI;
514
        if (method_exists($this, self::CTR_UNI)) $this->controllers[self::CTR_UNI] = array($this, self::CTR_UNI);
515
        else if (method_exists($this, self::CTR_CACHE_UNI)) $this->controllers[self::CTR_UNI] = array($this, self::CTR_CACHE_UNI);
516
517
        // Make view path relative to module - remove module path from view path
518
        $this->views = str_replace($this->path, '', $this->views);