]> git.mxchange.org Git - friendica.git/commitdiff
Fix code style
authorArt4 <art4@wlabs.de>
Fri, 13 Jun 2025 12:35:48 +0000 (12:35 +0000)
committerArt4 <art4@wlabs.de>
Fri, 13 Jun 2025 12:35:48 +0000 (12:35 +0000)
src/Content/Pager.php
src/Object/Image.php

index 222247c6f56160fd49dfc77a9c44ff7b75aec3b9..1199ec758f966c45c2f25102ab12ccefedf3e634 100644 (file)
@@ -157,10 +157,10 @@ class Pager
                                'text'  => $this->l10n->t('newer'),
                                'class' => 'previous' . ($this->getPage() == 1 ? ' disabled' : '')
                        ],
-                       'next'  => [
+                       'next' => [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
                                'text'  => $this->l10n->t('older'),
-                               'class' =>  'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '')
+                               'class' => 'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '')
                        ]
                ];
 
@@ -211,12 +211,12 @@ class Pager
                        $numpages = (int) ceil($totalItemCount / $this->getItemsPerPage());
 
                        $numstart = 1;
-                       $numstop = $numpages;
+                       $numstop  = $numpages;
 
                        // Limit the number of displayed page number buttons.
                        if ($numpages > 8) {
                                $numstart = ($this->getPage() > 4) ? ($this->getPage() - 4) : 1;
-                               $numstop = ($this->getPage() > ($numpages - 7)) ? $numpages : ($numstart + 8);
+                               $numstop  = ($this->getPage() > ($numpages - 7)) ? $numpages : ($numstart + 8);
                        }
 
                        $pages = [];
@@ -239,7 +239,7 @@ class Pager
 
                        $data['pages'] = $pages;
 
-                       $lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages);
+                       $lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
 
                        $data['next'] = [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
index 283a8d48959bc36baec2b4d7c03a7effd6d41980..56c6f9f3259b58f9bef922143803f44e632e2d58 100644 (file)
@@ -48,8 +48,8 @@ class Image
        public function __construct(string $data, string $type = '', string $filename = '', bool $imagick = true)
        {
                $this->filename = $filename;
-               $type = Images::addMimeTypeByDataIfInvalid($type, $data);
-               $type = Images::addMimeTypeByExtensionIfInvalid($type, $filename);
+               $type           = Images::addMimeTypeByDataIfInvalid($type, $data);
+               $type           = Images::addMimeTypeByExtensionIfInvalid($type, $filename);
 
                if (Images::isSupportedMimeType($type)) {
                        $this->originType = $this->outputType = Images::getImageTypeByMimeType($type);
@@ -108,7 +108,7 @@ class Image
        private function isAnimatedWebP(string $data)
        {
                $header_format = 'A4Riff/I1Filesize/A4Webp/A4Vp/A74Chunk';
-               $header = @unpack($header_format, $data);
+               $header        = @unpack($header_format, $data);
 
                if (!isset($header['Riff']) || strtoupper($header['Riff']) !== 'RIFF') {
                        return false;
@@ -348,7 +348,7 @@ class Image
                        return false;
                }
 
-               $width = $this->getWidth();
+               $width  = $this->getWidth();
                $height = $this->getHeight();
 
                $scale = Images::getScalingDimensions($width, $height, $max);
@@ -412,8 +412,8 @@ class Image
                        return;
                }
 
-               $w = imagesx($this->image);
-               $h = imagesy($this->image);
+               $w       = imagesx($this->image);
+               $h       = imagesy($this->image);
                $flipped = imagecreate($w, $h);
                if ($horiz) {
                        for ($x = 0; $x < $w; $x++) {
@@ -521,7 +521,7 @@ class Image
                        return false;
                }
 
-               $width = $this->getWidth();
+               $width  = $this->getWidth();
                $height = $this->getHeight();
 
                if ((!$width) || (!$height)) {
@@ -530,22 +530,22 @@ class Image
 
                if ($width < $min && $height < $min) {
                        if ($width > $height) {
-                               $dest_width = $min;
+                               $dest_width  = $min;
                                $dest_height = intval(($height * $min) / $width);
                        } else {
-                               $dest_width = intval(($width * $min) / $height);
+                               $dest_width  = intval(($width * $min) / $height);
                                $dest_height = $min;
                        }
                } else {
                        if ($width < $min) {
-                               $dest_width = $min;
+                               $dest_width  = $min;
                                $dest_height = intval(($height * $min) / $width);
                        } else {
                                if ($height < $min) {
-                                       $dest_width = intval(($width * $min) / $height);
+                                       $dest_width  = intval(($width * $min) / $height);
                                        $dest_height = $min;
                                } else {
-                                       $dest_width = $width;
+                                       $dest_width  = $width;
                                        $dest_height = $height;
                                }
                        }
@@ -620,7 +620,7 @@ class Image
                                imagedestroy($this->image);
                        }
 
-                       $this->image = $dest;
+                       $this->image  = $dest;
                        $this->width  = imagesx($this->image);
                        $this->height = imagesy($this->image);
                }
@@ -797,9 +797,9 @@ class Image
                                        }
                                        $row[] = [$colors['r'], $colors['g'], $colors['b']];
                                } else {
-                                       $index = imagecolorat($image->image, $x, $y);
+                                       $index  = imagecolorat($image->image, $x, $y);
                                        $colors = @imagecolorsforindex($image->image, $index);
-                                       $row[] = [$colors['red'], $colors['green'], $colors['blue']];
+                                       $row[]  = [$colors['red'], $colors['green'], $colors['blue']];
                                }
                        }
                        $pixels[] = $row;
@@ -828,7 +828,7 @@ class Image
 
                if ($this->isImagick()) {
                        $this->image = new Imagick();
-                       $draw  = new ImagickDraw();
+                       $draw        = new ImagickDraw();
                        $this->image->newImage($scaled['width'], $scaled['height'], '', 'png');
                } else {
                        $this->image = imagecreatetruecolor($scaled['width'], $scaled['height']);
@@ -836,7 +836,7 @@ class Image
 
                for ($y = 0; $y < $scaled['height']; ++$y) {
                        for ($x = 0; $x < $scaled['width']; ++$x) {
-                               [$r, $g, $b] = $pixels[$y][$x];
+                               list($r, $g, $b) = $pixels[$y][$x];
                                if ($draw !== null) {
                                        $draw->setFillColor("rgb($r, $g, $b)");
                                        $draw->point($x, $y);