@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function testBasic(): void |
| 14 | 14 | { |
| 15 | 15 | $path = new Path(); |
| 16 | - $path->setData(['user'=>'def','module'=>'jkl','mno'=>'pqr',]); |
|
| 16 | + $path->setData(['user'=>'def', 'module'=>'jkl', 'mno'=>'pqr', ]); |
|
| 17 | 17 | $path->setDocumentRoot('/abc/def/ghi/jkl'); |
| 18 | 18 | $path->setPathToSystemRoot('../mno/pqr'); |
| 19 | 19 | $this->assertEquals(implode(DIRECTORY_SEPARATOR, ['', 'abc', 'def', 'ghi', 'jkl']), $path->getDocumentRoot()); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->assertEquals(implode(DIRECTORY_SEPARATOR, ['abc', 'def.ghi', 'jkl']), $path->getDirectory()); |
| 37 | 37 | $this->assertEquals(['abc', 'def.ghi', 'jkl', 'mno.pqr'], $path->getArray()); |
| 38 | 38 | |
| 39 | - $path->setPath(implode(DIRECTORY_SEPARATOR, ['', '.', '..', '.', ''])); // NOPE! |
|
| 39 | + $path->setPath(implode(DIRECTORY_SEPARATOR, ['', '.', '..', '.', ''])); // NOPE! |
|
| 40 | 40 | $this->assertEquals('', (string) $path); |
| 41 | 41 | $this->assertEquals('', $path->getFileName()); |
| 42 | 42 | $this->assertEquals('', $path->getDirectory()); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public static function directory(string $path, string $delimiter = DIRECTORY_SEPARATOR): string |
| 82 | 82 | { |
| 83 | 83 | $pos = mb_strrpos($path, $delimiter); |
| 84 | - return (false !== $pos) ? mb_substr($path, 0, $pos + 1) : '' ; |
|
| 84 | + return (false !== $pos) ? mb_substr($path, 0, $pos + 1) : ''; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | public static function filename(string $path, string $delimiter = DIRECTORY_SEPARATOR): string |
| 95 | 95 | { |
| 96 | 96 | $pos = mb_strrpos($path, $delimiter); |
| 97 | - return (false !== $pos) ? mb_substr($path, $pos + 1) : $path ; |
|
| 97 | + return (false !== $pos) ? mb_substr($path, $pos + 1) : $path; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | public static function fileBase(string $path, string $delimiter = IPaths::SPLITTER_DOT): string |
| 107 | 107 | { |
| 108 | 108 | $pos = mb_strrpos($path, $delimiter); |
| 109 | - return (false !== $pos) && (0 < $pos) ? mb_substr($path, 0, $pos) : $path ; |
|
| 109 | + return (false !== $pos) && (0 < $pos) ? mb_substr($path, 0, $pos) : $path; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public static function fileExt(string $path, string $delimiter = IPaths::SPLITTER_DOT): string |
| 119 | 119 | { |
| 120 | 120 | $pos = mb_strrpos($path, $delimiter); |
| 121 | - return ((false !== $pos) && (0 < $pos)) ? mb_substr($path, $pos + 1) : '' ; |
|
| 121 | + return ((false !== $pos) && (0 < $pos)) ? mb_substr($path, $pos + 1) : ''; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public static function removeEndingSlash(string $path, string $delimiter = DIRECTORY_SEPARATOR): string |
| 131 | 131 | { |
| 132 | - return ($delimiter == mb_substr($path, -1, 1)) ? mb_substr($path, 0, -1) : $path ; |
|
| 132 | + return ($delimiter == mb_substr($path, -1, 1)) ? mb_substr($path, 0, -1) : $path; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -149,6 +149,6 @@ discard block |
||
| 149 | 149 | $base = static::fileBase($fName); |
| 150 | 150 | $extLen = strlen($ext); |
| 151 | 151 | $cut = substr($base, 0, ($maxLen - $extLen)); |
| 152 | - return ($extLen) ? $cut . $delimiter . $ext : $cut ; |
|
| 152 | + return ($extLen) ? $cut . $delimiter . $ext : $cut; |
|
| 153 | 153 | } |
| 154 | 154 | } |