Created
August 11, 2019 14:30
-
-
Save gvgvgvijayan/869b6055dd57be5cd8c20c958903ca33 to your computer and use it in GitHub Desktop.
This gist show how we can detect the dead code in our codebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('vendor/autoload.php'); | |
use Helper\TombstoneHelper\TombstoneHelper; | |
class DeadCode { | |
private $tombstoneHelper; | |
public function __construct() { | |
$this->tombstoneHelper = new TombstoneHelper; | |
} | |
public function called() { | |
$this->tombstoneHelper->tombstone('11-Aug-19', 'Vijayan'); | |
} | |
public function notCalled() { | |
$this->tombstoneHelper->tombstone('10-Aug-19', 'Vijayan'); | |
} | |
} | |
function deadCodeTrigger() { | |
$deadCodeInstance = new DeadCode(); | |
$deadCodeInstance->called(); | |
} | |
deadCodeTrigger(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment