diff --git a/Tool/Phplint.php b/Tool/Phplint.php new file mode 100644 index 0000000..916c8eb --- /dev/null +++ b/Tool/Phplint.php @@ -0,0 +1,42 @@ + 'src', + 'command' => "find", + 'threshold' => 0, + 'timeout' => 1200 + ]; + + public function composeCommand() + { + return "{$this->composeReportCommand()} | grep -v 'No syntax error' | wc -l"; + } + + public function composeReportCommand() + { + return "{$this->configuration['command']} {$this->configuration['directory']} -name '*.php' -exec php -l {} \\;"; + } + + public function getThreshold() + { + return isset($this->configuration['threshold']) ? $this->configuration['threshold'] : 0; + } + + public function getErrorMessage() + { + return 'The PHP Lint threshold is exceeded'; + } + + public function getSuccessMessage() + { + return 'The PHP Lint threshold passed'; + } +}