@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $parts = explode('#', $input); |
| 43 | 43 | array_walk( |
| 44 | 44 | $parts, |
| 45 | - function (&$value) { |
|
| 45 | + function(&$value) { |
|
| 46 | 46 | $value = ucfirst(strtolower($value)); |
| 47 | 47 | } |
| 48 | 48 | ); |
@@ -13,10 +13,10 @@ |
||
| 13 | 13 | |
| 14 | 14 | namespace WebHemi\Data\Storage\User; |
| 15 | 15 | |
| 16 | -use WebHemi\DateTime; |
|
| 17 | 16 | use WebHemi\Data\EntityInterface; |
| 18 | 17 | use WebHemi\Data\Entity\User\UserMetaEntity; |
| 19 | 18 | use WebHemi\Data\Storage\AbstractStorage; |
| 19 | +use WebHemi\DateTime; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Class UserMetaStorage. |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | foreach ($this->configuration->getData('themes') as $themeName => $themeData) { |
| 70 | 70 | $themeStaticPath = '/resources/'. |
| 71 | - ($themeName == 'default' ? 'default_theme' : 'vendor_themes/' . $themeName) |
|
| 71 | + ($themeName == 'default' ? 'default_theme' : 'vendor_themes/'.$themeName) |
|
| 72 | 72 | . '/static/'; |
| 73 | 73 | |
| 74 | 74 | |
@@ -82,19 +82,19 @@ discard block |
||
| 82 | 82 | 'license' => $themeData['legal']['license'] ?? '', |
| 83 | 83 | 'read_only' => isset($usedThemes[$themeName]), |
| 84 | 84 | 'feature_website' => isset($themeData['features']['website_support']) |
| 85 | - ? (bool)$themeData['features']['website_support'] |
|
| 85 | + ? (bool) $themeData['features']['website_support'] |
|
| 86 | 86 | : false, |
| 87 | 87 | 'feature_login' => isset($themeData['features']['admin_login_support']) |
| 88 | - ? (bool)$themeData['features']['admin_login_support'] |
|
| 88 | + ? (bool) $themeData['features']['admin_login_support'] |
|
| 89 | 89 | : false, |
| 90 | 90 | 'feature_admin' => isset($themeData['features']['admin_support']) |
| 91 | - ? (bool)$themeData['features']['admin_support'] |
|
| 91 | + ? (bool) $themeData['features']['admin_support'] |
|
| 92 | 92 | : false, |
| 93 | 93 | 'logo' => isset($themeData['legal']['logo']) |
| 94 | - ? $themeStaticPath . $themeData['legal']['logo'] |
|
| 94 | + ? $themeStaticPath.$themeData['legal']['logo'] |
|
| 95 | 95 | : '', |
| 96 | 96 | 'preview' => isset($themeData['legal']['preview']) |
| 97 | - ? $themeStaticPath . $themeData['legal']['preview'] |
|
| 97 | + ? $themeStaticPath.$themeData['legal']['preview'] |
|
| 98 | 98 | : '', |
| 99 | 99 | ]; |
| 100 | 100 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * @param string $text |
| 109 | 109 | * @return TagParserFilter |
| 110 | 110 | */ |
| 111 | - private function getCurrentUri(string &$text) : TagParserFilter |
|
| 111 | + private function getCurrentUri(string&$text) : TagParserFilter |
|
| 112 | 112 | { |
| 113 | 113 | $uri = rtrim($this->environmentManager->getRequestUri(), '/'); |
| 114 | 114 | $text = str_replace('[URL]', $uri, $text); |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | |
| 14 | 14 | namespace WebHemi\Data\Storage\Filesystem; |
| 15 | 15 | |
| 16 | -use WebHemi\DateTime; |
|
| 17 | 16 | use WebHemi\Data\ConnectorInterface; |
| 18 | 17 | use WebHemi\Data\EntityInterface; |
| 19 | -use WebHemi\Data\Storage\AbstractStorage; |
|
| 20 | 18 | use WebHemi\Data\Entity\Filesystem\FilesystemEntity; |
| 19 | +use WebHemi\Data\Storage\AbstractStorage; |
|
| 20 | +use WebHemi\DateTime; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Class FilesystemStorage. |
@@ -80,12 +80,12 @@ |
||
| 80 | 80 | /* @var FilesystemEntity $dataEntity */ |
| 81 | 81 | $dataEntity->setFilesystemId((int) $data[$this->idKey]) |
| 82 | 82 | ->setApplicationId((int) $data[$this->idApplication]) |
| 83 | - ->setCategoryId(isset($data[$this->idCategory]) ? (int)$data[$this->idCategory] : null) |
|
| 84 | - ->setParentId(isset($data[$this->idParent]) ? (int)$data[$this->idParent] : null) |
|
| 85 | - ->setDocumentId(isset($data[$this->idDocument]) ? (int)$data[$this->idDocument] : null) |
|
| 86 | - ->setFileId(isset($data[$this->idFile]) ? (int)$data[$this->idFile] : null) |
|
| 87 | - ->setDirectoryId(isset($data[$this->idDirectory]) ? (int)$data[$this->idDirectory] : null) |
|
| 88 | - ->setLinkId(isset($data[$this->idLink]) ? (int)$data[$this->idLink] : null) |
|
| 83 | + ->setCategoryId(isset($data[$this->idCategory]) ? (int) $data[$this->idCategory] : null) |
|
| 84 | + ->setParentId(isset($data[$this->idParent]) ? (int) $data[$this->idParent] : null) |
|
| 85 | + ->setDocumentId(isset($data[$this->idDocument]) ? (int) $data[$this->idDocument] : null) |
|
| 86 | + ->setFileId(isset($data[$this->idFile]) ? (int) $data[$this->idFile] : null) |
|
| 87 | + ->setDirectoryId(isset($data[$this->idDirectory]) ? (int) $data[$this->idDirectory] : null) |
|
| 88 | + ->setLinkId(isset($data[$this->idLink]) ? (int) $data[$this->idLink] : null) |
|
| 89 | 89 | ->setPath($data[$this->path]) |
| 90 | 90 | ->setBaseName($data[$this->baseName]) |
| 91 | 91 | ->setTitle($data[$this->title]) |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $parameters = $this->getRoutingParameters(); |
| 50 | 50 | $userName = $parameters['uri_parameter'] ?? ''; |
| 51 | 51 | $user = $this->getUser($userName); |
| 52 | - $userMeta = $this->getUserMeta((int)$user->getUserId()); |
|
| 52 | + $userMeta = $this->getUserMeta((int) $user->getUserId()); |
|
| 53 | 53 | |
| 54 | 54 | $blogPosts = []; |
| 55 | 55 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * @param Result $routeResult |
| 49 | 49 | * @return void |
| 50 | 50 | */ |
| 51 | - public function resolveMiddleware(string $application, Result &$routeResult) : void |
|
| 51 | + public function resolveMiddleware(string $application, Result&$routeResult) : void |
|
| 52 | 52 | { |
| 53 | 53 | $applicationEntity = $this->getApplicationEntity($application); |
| 54 | 54 | |
@@ -44,5 +44,5 @@ |
||
| 44 | 44 | * @param Result $routeResult |
| 45 | 45 | * @return void |
| 46 | 46 | */ |
| 47 | - public function resolveMiddleware(string $application, Result &$routeResult) : void; |
|
| 47 | + public function resolveMiddleware(string $application, Result&$routeResult) : void; |
|
| 48 | 48 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function setSecureConnection(bool $state) : ServiceInterface |
| 136 | 136 | { |
| 137 | - $this->setOption('secure', (bool)$state); |
|
| 137 | + $this->setOption('secure', (bool) $state); |
|
| 138 | 138 | |
| 139 | 139 | if (!empty($this->connectionId)) { |
| 140 | 140 | ftp_close($this->connectionId); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function setPassiveMode(bool $state) : ServiceInterface |
| 155 | 155 | { |
| 156 | - ftp_pasv($this->connectionId, (bool)$state); |
|
| 156 | + ftp_pasv($this->connectionId, (bool) $state); |
|
| 157 | 157 | return $this; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | if (strpos($path, '/') !== 0) { |
| 173 | - $path = $this->getRemotePath() . $path; |
|
| 173 | + $path = $this->getRemotePath().$path; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $chdirResult = @ftp_chdir($this->connectionId, $path); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function getRemotePath() : string |
| 191 | 191 | { |
| 192 | - return ftp_pwd($this->connectionId) . '/'; |
|
| 192 | + return ftp_pwd($this->connectionId).'/'; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | { |
| 203 | 203 | // if it's not an absolute path, we take it relative to the current folder |
| 204 | 204 | if (strpos($path, '/') !== 0) { |
| 205 | - $path = __DIR__ . '/' . $path; |
|
| 205 | + $path = __DIR__.'/'.$path; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | if (!realpath($path) || !is_dir($path)) { |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | 'Y-m-d H:i:s', |
| 281 | 281 | strtotime( |
| 282 | 282 | strpos($fileData['time'], ':') !== false |
| 283 | - ? $fileData['month'] . ' ' . $fileData['day'] . ' ' . date('Y') . ' ' . $fileData['time'] |
|
| 284 | - : $fileData['date'] . ' 12:00:00' |
|
| 283 | + ? $fileData['month'].' '.$fileData['day'].' '.date('Y').' '.$fileData['time'] |
|
| 284 | + : $fileData['date'].' 12:00:00' |
|
| 285 | 285 | ) |
| 286 | 286 | ), |
| 287 | 287 | 'basename' => $fileInfo['basename'], |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $mode += $mapper[$i][$permissions[$i]] ?? 0; |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - return (string)$mode; |
|
| 337 | + return (string) $mode; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -356,14 +356,14 @@ discard block |
||
| 356 | 356 | $this->checkLocalFile($sourceFileName); |
| 357 | 357 | $this->checkRemoteFile($destinationFileName); |
| 358 | 358 | |
| 359 | - if (!file_exists($this->localPath . '/' . $sourceFileName)) { |
|
| 360 | - throw new RuntimeException(sprintf('File not found: %s', $this->localPath . '/' . $sourceFileName), 1007); |
|
| 359 | + if (!file_exists($this->localPath.'/'.$sourceFileName)) { |
|
| 360 | + throw new RuntimeException(sprintf('File not found: %s', $this->localPath.'/'.$sourceFileName), 1007); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | $uploadResult = @ftp_put( |
| 364 | 364 | $this->connectionId, |
| 365 | 365 | $destinationFileName, |
| 366 | - $this->localPath . '/' . $sourceFileName, |
|
| 366 | + $this->localPath.'/'.$sourceFileName, |
|
| 367 | 367 | $fileMode |
| 368 | 368 | ); |
| 369 | 369 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | $downloadResult = @ftp_get( |
| 397 | 397 | $this->connectionId, |
| 398 | - $this->localPath . '/' . $localFileName, |
|
| 398 | + $this->localPath.'/'.$localFileName, |
|
| 399 | 399 | $remoteFileName, |
| 400 | 400 | $fileMode |
| 401 | 401 | ); |