From 8dfebbffbae7d7e2fb24b3533291559301ce9d8c Mon Sep 17 00:00:00 2001 From: overtrue Date: Wed, 17 Aug 2016 20:19:09 +0800 Subject: [PATCH] Fix bug #13. --- src/Console/Application.php | 2 +- src/Linter.php | 1 + src/Process/Lint.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Console/Application.php b/src/Console/Application.php index 456dfb5f..a4a56601 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -17,7 +17,7 @@ class Application extends BaseApplication { const NAME = 'phplint'; - const VERSION = '0.0.3'; + const VERSION = '0.0.4'; /** * Constructor. diff --git a/src/Linter.php b/src/Linter.php index 449d3508..9c3eeb94 100644 --- a/src/Linter.php +++ b/src/Linter.php @@ -60,6 +60,7 @@ class Linter */ public function __construct($path, array $excludes = [], array $extensions = ['php']) { + ini_set('error_reporting', E_ALL); $this->path = $path; $this->excludes = $excludes; $this->extensions = $extensions; diff --git a/src/Process/Lint.php b/src/Process/Lint.php index 9438be2f..cf64869a 100644 --- a/src/Process/Lint.php +++ b/src/Process/Lint.php @@ -46,7 +46,7 @@ public function getSyntaxError() */ public function parseError($message) { - $pattern = '/^Parse error:\s*(?:\w+ error,\s*)?(?.+?)\s+in\s+.+?\s*line\s+(?\d+)/'; + $pattern = '/^(PHP\s+)?Parse error:\s*(?:\w+ error,\s*)?(?.+?)\s+in\s+.+?\s*line\s+(?\d+)/'; preg_match($pattern, $message, $match);