File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,10 @@ private function enforceOptions() {
225
225
* @return mixed
226
226
*/
227
227
public function getOption ($ option ) {
228
+ if (!array_key_exists ($ option , $ this ->options )){
229
+ return false ;
230
+ }
228
231
return $ this ->options [$ option ];
229
232
}
230
233
}
231
- ?>
234
+ ?>
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class main {
55
55
public function __construct () {
56
56
define ('PHP7MAR_DIR ' , __DIR__ );
57
57
define ('PHP7MAR_VERSION ' , '0.0.1 ' );
58
- spl_autoload_register ([self , 'autoloader ' ], true , false );
58
+ spl_autoload_register ([$ this , 'autoloader ' ], true , false );
59
59
60
60
//Setup command line options/switches.
61
61
$ this ->options = new options ();
@@ -97,8 +97,10 @@ public function __construct() {
97
97
*/
98
98
private function run () {
99
99
$ issues = [];
100
+ $ totalFiles = 0 ;
101
+ $ totalLines = 0 ;
100
102
$ filePath = $ this ->scanner ->getCurrentFilePath ();
101
- if (!$ this ->options ->getOption ('t ' ) || in_array ('syntax ' , $ this ->options ->getOption ('t ' ))) {
103
+ if (!$ this ->options ->getOption ('t ' ) || in_array ('syntax ' , $ this ->options ->getOption ('t ' ), true )) {
102
104
$ checkSyntax = true ;
103
105
} else {
104
106
$ checkSyntax = false ;
@@ -155,7 +157,7 @@ static public function autoloader($className) {
155
157
if (is_file ($ file )) {
156
158
require_once ($ file );
157
159
} else {
158
- throw new \Exception (__CLASS__ .": Class file for {$ classname } not found at {$ file }. " );
160
+ throw new \Exception (__CLASS__ .": Class file for {$ className } not found at {$ file }. " );
159
161
}
160
162
}
161
163
@@ -179,4 +181,4 @@ static public function getRealPath($path) {
179
181
}
180
182
}
181
183
$ mar = new \mar \main ();
182
- ?>
184
+ ?>
You can’t perform that action at this time.
0 commit comments