@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | if (version_compare(PHP_VERSION, '5.4.0', '<')) { |
| 9 | - throw new Exception('The TopMcApi requires PHP version 5.4 or higher.'); |
|
| 9 | + throw new Exception('The TopMcApi requires PHP version 5.4 or higher.'); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -18,29 +18,29 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | spl_autoload_register(function ($class) |
| 20 | 20 | { |
| 21 | - // project-specific namespace prefix |
|
| 22 | - $prefix = 'TopMcFrance\\\Api\\'; |
|
| 21 | + // project-specific namespace prefix |
|
| 22 | + $prefix = 'TopMcFrance\\\Api\\'; |
|
| 23 | 23 | |
| 24 | - // base directory for the namespace prefix |
|
| 25 | - $base_dir = __DIR__ . '/src/'; |
|
| 24 | + // base directory for the namespace prefix |
|
| 25 | + $base_dir = __DIR__ . '/src/'; |
|
| 26 | 26 | |
| 27 | - // does the class use the namespace prefix? |
|
| 28 | - $len = strlen($prefix); |
|
| 29 | - if (strncmp($prefix, $class, $len) !== 0) { |
|
| 27 | + // does the class use the namespace prefix? |
|
| 28 | + $len = strlen($prefix); |
|
| 29 | + if (strncmp($prefix, $class, $len) !== 0) { |
|
| 30 | 30 | // no, move to the next registered autoloader |
| 31 | 31 | return; |
| 32 | - } |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - // get the relative class name |
|
| 35 | - $relative_class = substr($class, $len); |
|
| 34 | + // get the relative class name |
|
| 35 | + $relative_class = substr($class, $len); |
|
| 36 | 36 | |
| 37 | - // replace the namespace prefix with the base directory, replace namespace |
|
| 38 | - // separators with directory separators in the relative class name, append |
|
| 39 | - // with .php |
|
| 40 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 37 | + // replace the namespace prefix with the base directory, replace namespace |
|
| 38 | + // separators with directory separators in the relative class name, append |
|
| 39 | + // with .php |
|
| 40 | + $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 41 | 41 | |
| 42 | - // if the file exists, require it |
|
| 43 | - if (file_exists($file)) { |
|
| 42 | + // if the file exists, require it |
|
| 43 | + if (file_exists($file)) { |
|
| 44 | 44 | require $file; |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | }); |
| 47 | 47 | \ No newline at end of file |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $vote->checkCode('alreadyused'); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function testCheckCodeInvalidUsedThrowException() |
|
| 30 | + public function testCheckCodeInvalidUsedThrowException() |
|
| 31 | 31 | { |
| 32 | 32 | $this->expectException(ApiException::class); |
| 33 | 33 | $this->expectExceptionMessage('Code invalidcode isn\'t valid.'); |