From: Art4 Date: Fri, 13 Jun 2025 12:35:48 +0000 (+0000) Subject: Fix code style X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a06a816c08c3f71d29dcc4dadfed29a8a5aad90a;p=friendica.git Fix code style --- diff --git a/src/Content/Pager.php b/src/Content/Pager.php index 222247c6f5..1199ec758f 100644 --- a/src/Content/Pager.php +++ b/src/Content/Pager.php @@ -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)), diff --git a/src/Object/Image.php b/src/Object/Image.php index 283a8d4895..56c6f9f325 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -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);