diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 7af113f..0d189df 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -38,7 +38,7 @@ class Navigation */ public static function install(string $path = null, DatabasePool $dbPool = null) : void { - $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); + $navData = \json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); $class = '\\Modules\\Navigation\\Admin\\Installer'; /** @var $class \Modules\Navigation\Admin\Installer */ diff --git a/Controller.php b/Controller.php index 6231521..1ef877c 100644 --- a/Controller.php +++ b/Controller.php @@ -297,8 +297,8 @@ final class Controller extends ModuleAbstract implements WebInterface private static function normalizeDbPath(string $path) : string { - return str_replace('\\', '/', - str_replace(realpath(__DIR__ . '/../../'), '', + return \str_replace('\\', '/', + \str_replace(realpath(__DIR__ . '/../../'), '', rtrim($path, '/') ) ); diff --git a/Models/Media.php b/Models/Media.php index 76b6634..3890382 100644 --- a/Models/Media.php +++ b/Models/Media.php @@ -269,7 +269,7 @@ class Media */ public function setPath(string $path) { - $this->path = str_replace('\\', '/', $path); + $this->path = \str_replace('\\', '/', $path); } /** diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index d528db3..45935ef 100644 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -26,7 +26,7 @@ class MediaMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array> * @since 1.0.0 */ protected static $columns = [ diff --git a/Models/UploadFile.php b/Models/UploadFile.php index 4d7344f..733acb6 100644 --- a/Models/UploadFile.php +++ b/Models/UploadFile.php @@ -48,7 +48,7 @@ class UploadFile /** * Allowed mime types. * - * @var array + * @var string[] * @since 1.0.0 */ private $allowedTypes = []; @@ -135,14 +135,14 @@ class UploadFile $this->fileName = $f['name']; } - $split = explode('.', $f['name']); + $split = \explode('.', $f['name']); $result[$key]['name'] = $split[0]; $extension = count($split) > 1 ? $split[count($split) - 1] : ''; $result[$key]['extension'] = $extension; // ! and empty same?! $result[$key]['filename'] = $this->fileName; - if (!$this->fileName || empty($this->fileName) || file_exists($path . '/' . $this->fileName)) { + if (!$this->fileName || empty($this->fileName) || \file_exists($path . '/' . $this->fileName)) { $rnd = ''; $limit = 0; @@ -183,7 +183,7 @@ class UploadFile return $result; } - if ($this->interlaced && in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) { + if ($this->interlaced && \in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) { $this->interlace($extension, $dest); } @@ -276,7 +276,7 @@ class UploadFile } /** - * @param int $maxSize + * @param int $maxSize Max allowed file size * * @return void * @@ -288,7 +288,7 @@ class UploadFile } /** - * @return array + * @return string[] * * @since 1.0.0 */ @@ -298,7 +298,7 @@ class UploadFile } /** - * @param array $allowedTypes + * @param string[] $allowedTypes Allowed file types * * @return void * @@ -310,7 +310,7 @@ class UploadFile } /** - * @param array $allowedTypes + * @param string[] $allowedTypes Allowed file types * * @return void * @@ -332,7 +332,9 @@ class UploadFile } /** - * @param string $outputDir + * Define output directory of the upload + * + * @param string $outputDir Output directory of the uploaded file * * @return void * @@ -354,7 +356,9 @@ class UploadFile } /** - * @param string $fileName + * Set the file name of the uploaded file + * + * @param string $fileName File name of the uploaded file * * @return void * @@ -366,7 +370,9 @@ class UploadFile } /** - * @param bool $preserveFileName + * Define if the uploaded file name should be the same file name as the original file + * + * @param bool $preserveFileName Keep file name of the original file * * @return void * diff --git a/Theme/Backend/media-single.tpl.php b/Theme/Backend/media-single.tpl.php index 5c3658d..f0c5467 100644 --- a/Theme/Backend/media-single.tpl.php +++ b/Theme/Backend/media-single.tpl.php @@ -81,8 +81,8 @@ echo $this->getData('nav')->render(); getPath())); ?> - - + + format('Y-m-d'); ?> @@ -103,7 +103,7 @@ echo $this->getData('nav')->render(); - isAbsolute() ? $path : __DIR__ . '/../../../../' . $path)) : ?> + isAbsolute() ? $path : __DIR__ . '/../../../../' . $path)) : ?>
diff --git a/Views/MediaView.php b/Views/MediaView.php
index 26eb0a6..31583ac 100644
--- a/Views/MediaView.php
+++ b/Views/MediaView.php
@@ -36,7 +36,7 @@ class MediaView extends View
     {
         if (is_file($media->getPath() . $sub)
             && StringUtils::startsWith(
-                str_replace('\\', '/', realpath($media->getPath() . $sub)),
+                \str_replace('\\', '/', realpath($media->getPath() . $sub)),
                 $media->getPath()
             )
         ) {
@@ -50,7 +50,7 @@ class MediaView extends View
     {
         if (is_dir($media->getPath() . $sub)
             && StringUtils::startsWith(
-                str_replace('\\', '/', realpath($media->getPath() . $sub)),
+                \str_replace('\\', '/', realpath($media->getPath() . $sub)),
                 $media->getPath()
             )
         ) {
@@ -65,14 +65,14 @@ class MediaView extends View
         return ($media->getExtension() === 'collection'
                 && !is_file($media->getPath() . $sub))
             || (is_dir($media->getPath())
-                && ($sub === null || is_dir($media->getPath() . $sub))
+                && ($sub === null || \is_dir($media->getPath() . $sub))
         );
     }
 
     protected function lineContentFunction(string $path) : array
     {
-        $output = file_get_contents($path);
-        $output = str_replace(["\r\n", "\r"], "\n", $output);
+        $output = \file_get_contents($path);
+        $output = \str_replace(["\r\n", "\r"], "\n", $output);
 
         return explode("\n", $output);
     }