Skip to content

Commit efd538f

Browse files
committed
fix some phpcs warnings
1 parent e9bee8f commit efd538f

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

examples/class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,12 @@ public function log($level, $message, array $context = [])
5454
$image = $image->invert();
5555

5656
$image->writeToFile($argv[2]);
57+
58+
/*
59+
* Local variables:
60+
* tab-width: 4
61+
* c-basic-offset: 4
62+
* End:
63+
* vim600: expandtab sw=4 ts=4 fdm=marker
64+
* vim<600: expandtab sw=4 ts=4
65+
*/

examples/sig.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# an S-shaped curve which boosts the slope in the mid-tones and drops it for
1111
# white and black.
1212

13-
function sigmoid(float $alpha, float $beta, bool $ushort = FALSE): Vips\Image
13+
function sigmoid(float $alpha, float $beta, bool $ushort = false): Vips\Image
1414
{
1515
# make a identity LUT, that is, a lut where each pixel has the value of
1616
# its index ... if you map an image through the identity, you get the
@@ -33,7 +33,7 @@ function sigmoid(float $alpha, float $beta, bool $ushort = FALSE): Vips\Image
3333
#
3434
# though that's missing a term -- it should be
3535
#
36-
# (1/(1+exp(β*(α-u))) - 1/(1+exp(β*α))) /
36+
# (1/(1+exp(β*(α-u))) - 1/(1+exp(β*α))) /
3737
# (1/(1+exp(β*(α-1))) - 1/(1+exp(β*α)))
3838
#
3939
# ie. there should be an extra α in the second term
@@ -47,7 +47,7 @@ function sigmoid(float $alpha, float $beta, bool $ushort = FALSE): Vips\Image
4747

4848
# and get the format right ... $result will be a float image after all
4949
# that maths, but we want uchar or ushort
50-
$result = $result->cast($ushort ?
50+
$result = $result->cast($ushort ?
5151
Vips\BandFormat::USHORT : Vips\BandFormat::UCHAR);
5252

5353
return $result;
@@ -73,7 +73,7 @@ function sigLAB(Vips\Image $image, float $alpha, float $beta): Vips\Image
7373
$image = $image->colourspace(Vips\Interpretation::LABS);
7474

7575
# make a 16-bit LUT, then shrink by x2 to make it fit the range of L in labs
76-
$lut = sigmoid($alpha, $beta, TRUE);
76+
$lut = sigmoid($alpha, $beta, true);
7777
$lut = $lut->shrinkh(2)->multiply(0.5);
7878
$lut = $lut->cast(Vips\BandFormat::SHORT);
7979

@@ -89,8 +89,10 @@ function sigLAB(Vips\Image $image, float $alpha, float $beta): Vips\Image
8989
# after the manipulation above, $image will just be tagged as a generic
9090
# multiband image, vips will no longer know that it's a labs, so we need to
9191
# tell colourspace what the source space is
92-
$image = $image->colourspace($old_interpretation,
93-
["source_space" => Vips\Interpretation::LABS]);
92+
$image = $image->colourspace(
93+
$old_interpretation,
94+
["source_space" => Vips\Interpretation::LABS]
95+
);
9496

9597
return $image;
9698
}

0 commit comments

Comments
 (0)