@@ -41,13 +41,13 @@ |
||
41 | 41 | { |
42 | 42 | return (1 < count($this->path)) |
43 | 43 | ? Stuff::arrayToPath(array_slice($this->path, 0, -1)) |
44 | - : '' ; |
|
44 | + : ''; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getFileName(): string |
48 | 48 | { |
49 | 49 | return (0 < count($this->path)) |
50 | 50 | ? end($this->path) |
51 | - : '' ; |
|
51 | + : ''; |
|
52 | 52 | } |
53 | 53 | } |
@@ -77,9 +77,9 @@ |
||
77 | 77 | { |
78 | 78 | try { |
79 | 79 | $target = empty($path) ? '' : Stuff::removeEndingSlash($path) . DIRECTORY_SEPARATOR; |
80 | - $targetPath = $target . $name ; |
|
80 | + $targetPath = $target . $name; |
|
81 | 81 | return mkdir($this->webRootDir . $targetPath) |
82 | - && ( $makeExtra ? $this->makeExtended($targetPath) : true ); |
|
82 | + && ($makeExtra ? $this->makeExtended($targetPath) : true); |
|
83 | 83 | // @codeCoverageIgnoreStart |
84 | 84 | } catch (Error $ex) { |
85 | 85 | throw new PathsException($ex->getMessage(), $ex->getCode(), $ex); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | const DIR_NO_SUB = '.'; # current dir |
23 | 23 | const FILE_INDEX = 'index.htm'; # basic file |
24 | 24 | const FILE_FAIL = 'index.htm'; # file to show on fail |
25 | - const EXT = '.php'; # file extension |
|
25 | + const EXT = '.php'; # file extension |
|
26 | 26 | |
27 | 27 | const SPLITTER_SLASH = '/'; # split path by slash |
28 | 28 | const SPLITTER_QUOTE = '?'; # split path by quote sign |
@@ -47,11 +47,11 @@ |
||
47 | 47 | { |
48 | 48 | list($path, $params) = $this->explodeInput($this->requestUri); |
49 | 49 | list($staticalPath, $virtualPrefix, $virtualParamPath) = $this->pathToSegments(urldecode($path), $this->virtualDir); |
50 | - $this->preset( array_merge( |
|
50 | + $this->preset(array_merge( |
|
51 | 51 | compact('staticalPath', 'virtualPrefix'), |
52 | 52 | $this->updateVirtualKeys($this->parseVirtualPath($virtualParamPath)), |
53 | 53 | $this->parseParamsToArray($params) |
54 | - ) ); |
|
54 | + )); |
|
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 |
@@ -50,13 +50,13 @@ |
||
50 | 50 | */ |
51 | 51 | public function setData(array $params): self |
52 | 52 | { |
53 | - $this->user = strval($params['user'] ?? $this->user ); |
|
54 | - $this->lang = strval($params['lang'] ?? $this->lang ); |
|
55 | - $this->path = Stuff::arrayToPath(Stuff::linkToArray(strval($params['path'] ?? $this->path ))); |
|
56 | - $this->module = strval($params['module'] ?? $this->module ); |
|
53 | + $this->user = strval($params['user'] ?? $this->user); |
|
54 | + $this->lang = strval($params['lang'] ?? $this->lang); |
|
55 | + $this->path = Stuff::arrayToPath(Stuff::linkToArray(strval($params['path'] ?? $this->path))); |
|
56 | + $this->module = strval($params['module'] ?? $this->module); |
|
57 | 57 | $this->isSingle = isset($params['single']); |
58 | - $this->staticalPath = strval($params['staticalPath'] ?? $this->staticalPath ); |
|
59 | - $this->virtualPrefix = strval($params['virtualPrefix'] ?? $this->virtualPrefix ); |
|
58 | + $this->staticalPath = strval($params['staticalPath'] ?? $this->staticalPath); |
|
59 | + $this->virtualPrefix = strval($params['virtualPrefix'] ?? $this->virtualPrefix); |
|
60 | 60 | return $this; |
61 | 61 | } |
62 | 62 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | |
62 | 62 | protected function getTargetDir(): string |
63 | 63 | { |
64 | - return realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data', 'tree' ])) . DIRECTORY_SEPARATOR; |
|
64 | + return realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data', 'tree'])) . DIRECTORY_SEPARATOR; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | protected function targetExists(string $path): bool |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function testBasics(): void |
39 | 39 | { |
40 | 40 | $lib = $this->getExtend(); |
41 | - $this->assertEquals(realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data' ])) . DIRECTORY_SEPARATOR, $lib->getWebRootDir()); |
|
41 | + $this->assertEquals(realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data'])) . DIRECTORY_SEPARATOR, $lib->getWebRootDir()); |
|
42 | 42 | $this->assertEquals('desc', $lib->getDescDir()); |
43 | 43 | $this->assertEquals('descr', $lib->getDescFile()); |
44 | 44 | $this->assertEquals('.txt', $lib->getDescExt()); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | protected function getExtend(): ExtendDir |
141 | 141 | { |
142 | 142 | return new ExtendDir( |
143 | - realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data' ])) . DIRECTORY_SEPARATOR, |
|
143 | + realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data'])) . DIRECTORY_SEPARATOR, |
|
144 | 144 | 'desc', |
145 | 145 | 'descr', |
146 | 146 | '.txt', |
@@ -40,7 +40,7 @@ |
||
40 | 40 | public function testBasics(): void |
41 | 41 | { |
42 | 42 | $lib = $this->getUserDir(); |
43 | - $this->assertEquals(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data' ]) . DIRECTORY_SEPARATOR, $lib->getWebRootDir()); |
|
43 | + $this->assertEquals(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data']) . DIRECTORY_SEPARATOR, $lib->getWebRootDir()); |
|
44 | 44 | $this->assertEmpty($lib->getHomeDir()); |
45 | 45 | $this->assertEmpty($lib->getWorkDir()); |
46 | 46 | $this->assertEmpty($lib->getRealDir()); |
@@ -12,8 +12,8 @@ |
||
12 | 12 | public function testBasic(): void |
13 | 13 | { |
14 | 14 | $params = new Params\Arrays(); |
15 | - $params->setData(['abc'=>'def','ghi'=>'jkl','mno'=>'pqr',]); |
|
16 | - $this->assertEquals(['abc'=>'def','ghi'=>'jkl','mno'=>'pqr',], $params->process()->getParams()); |
|
15 | + $params->setData(['abc'=>'def', 'ghi'=>'jkl', 'mno'=>'pqr', ]); |
|
16 | + $this->assertEquals(['abc'=>'def', 'ghi'=>'jkl', 'mno'=>'pqr', ], $params->process()->getParams()); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function testArrayAccess(): void |