Skip to content

Instantly share code, notes, and snippets.

@gvgvgvijayan
Created August 11, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvgvgvijayan/869b6055dd57be5cd8c20c958903ca33 to your computer and use it in GitHub Desktop.
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
<?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