Skip to content

Commit d4aa571

Browse files
committed
Fix code style
1 parent f8b5899 commit d4aa571

File tree

8 files changed

+24
-29
lines changed

8 files changed

+24
-29
lines changed

lib/Common/DefaultGridSampler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
final class DefaultGridSampler extends GridSampler
2626
{
27-
2827
/**
2928
* @return BitMatrix
3029
*/

lib/Common/GridSampler.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
namespace Zxing\Common;
1919

2020
use Zxing\NotFoundException;
21-
use Zxing\Common\PerspectiveTransform;
2221

2322
/**
2423
* Implementations of this class can, given locations of finder patterns for a QR code in an
@@ -36,7 +35,7 @@
3635
abstract class GridSampler
3736
{
3837
/**
39-
* @var mixed|\Zxing\Common\DefaultGridSampler|null
38+
* @var GridSampler|null
4039
*/
4140
private static $gridSampler;
4241

@@ -47,7 +46,7 @@ abstract class GridSampler
4746
* in the whole lifetime of the JVM. For instance, an Android activity can swap in
4847
* an implementation that takes advantage of native platform libraries.
4948
*
50-
* @param $newGridSampler The platform-specific object to install.
49+
* @param GridSampler $newGridSampler The platform-specific object to install.
5150
*/
5251
public static function setGridSampler($newGridSampler): void
5352
{
@@ -77,13 +76,13 @@ public static function getInstance()
7776
* <p>For efficiency, the method will check points from either end of the line until one is found
7877
* to be within the image. Because the set of points are assumed to be linear, this is valid.</p>
7978
*
80-
* @param $image image into which the points should map
81-
* @param $points actual points in x1,y1,...,xn,yn form
82-
* @param (float|mixed)[] $points
79+
* @param BitMatrix $image image into which the points should map
80+
* @param array $points actual points in x1,y1,...,xn,yn form
81+
* @param float[] $points
8382
*
8483
* @throws NotFoundException if an endpoint is lies outside the image boundaries
8584
*
86-
* @psalm-param array<int, float|mixed> $points
85+
* @psalm-param array<int, float> $points
8786
*/
8887
protected static function checkAndNudgePoints(
8988
BitMatrix $image,
@@ -146,7 +145,7 @@ protected static function checkAndNudgePoints(
146145
* transformation is determined by the coordinates of 4 points, in the original and transformed
147146
* image space.
148147
*
149-
* @param $image image to sample
148+
* @param image $image to sample
150149
* @param int $dimensionX width of {@link BitMatrix} to sample from image
151150
* @param int $dimensionY height of {@link BitMatrix} to sample from image
152151
* @param float $p1ToX point 1 preimage X

lib/Common/Reedsolomon/GenericGF.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ final class GenericGF
4747
/**
4848
* Create a representation of GF(size) using the given primitive polynomial.
4949
*
50-
* @param $primitive irreducible polynomial whose coefficients are represented by
50+
* @param int $primitive irreducible polynomial whose coefficients are represented by
5151
* the bits of an int, where the least-significant bit represents the constant
5252
* coefficient
53-
* @param $size the size of the field
54-
* @param $generatorBase the factor b in the generator polynomial can be 0- or 1-based
53+
* @param int $size the size of the field
54+
* @param int $generatorBase the factor b in the generator polynomial can be 0- or 1-based
5555
(g(x) = (x+a^b)(x+a^(b+1))...(x+a^(b+2t-1))).
5656
In most cases it should be 1, but for QR code it is 0.
5757
*/

lib/PlanarYUVLuminanceSource.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ public function renderThumbnail(): array
179179
}*/
180180

181181
/**
182-
*
183-
* @param int $width
184-
* @param int $height
185-
* @return void
182+
*
183+
* @param int $width
184+
* @param int $height
185+
* @return void
186186
*/
187187
private function reverseHorizontal(int $width, int $height): void
188188
{

lib/Qrcode/Decoder/DataMask.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public function isMasked($i, $j): bool
114114
*/
115115
final class DataMask001 extends DataMask
116116
{
117-
118117
public function isMasked($i, $j): bool
119118
{
120119
return ($i & 0x01) == 0;
@@ -126,7 +125,6 @@ public function isMasked($i, $j): bool
126125
*/
127126
final class DataMask010 extends DataMask
128127
{
129-
130128
public function isMasked($i, $j): bool
131129
{
132130
return $j % 3 == 0;
@@ -138,7 +136,6 @@ public function isMasked($i, $j): bool
138136
*/
139137
final class DataMask011 extends DataMask
140138
{
141-
142139
public function isMasked($i, $j): bool
143140
{
144141
return ($i + $j) % 3 == 0;
@@ -150,7 +147,6 @@ public function isMasked($i, $j): bool
150147
*/
151148
final class DataMask100 extends DataMask
152149
{
153-
154150
public function isMasked($i, $j): bool
155151
{
156152
return (int)(((int)($i / 2) + (int)($j / 3)) & 0x01) == 0;
@@ -162,7 +158,6 @@ public function isMasked($i, $j): bool
162158
*/
163159
final class DataMask101 extends DataMask
164160
{
165-
166161
public function isMasked($i, $j): bool
167162
{
168163
$temp = $i * $j;
@@ -176,7 +171,6 @@ public function isMasked($i, $j): bool
176171
*/
177172
final class DataMask110 extends DataMask
178173
{
179-
180174
public function isMasked($i, $j): bool
181175
{
182176
$temp = $i * $j;
@@ -190,7 +184,6 @@ public function isMasked($i, $j): bool
190184
*/
191185
final class DataMask111 extends DataMask
192186
{
193-
194187
public function isMasked($i, $j): bool
195188
{
196189
return (((($i + $j) & 0x01) + (($i * $j) % 3)) & 0x01) == 0;

lib/Qrcode/Detector/AlignmentPatternFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function find()
7070
$stateCount = [];
7171
for ($iGen = 0; $iGen < $height; $iGen++) {
7272
// Search from middle outwards
73-
$i = $middleI + (($iGen & 0x01) == 0 ? ($iGen + 1) / 2 : - (($iGen + 1) / 2));
73+
$i = $middleI + (($iGen & 0x01) == 0 ? ($iGen + 1) / 2 : -(($iGen + 1) / 2));
7474
$i = (int)($i);
7575
$stateCount[0] = 0;
7676
$stateCount[1] = 0;

lib/Qrcode/QRCodeReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function decode(BinaryBitmap $image, $hints = null)
9898
* @throws NotFoundException if a QR code cannot be found
9999
* @throws FormatException if a QR code cannot be decoded
100100
* @throws ChecksumException if error correction fails
101-
*
101+
*
102102
* @see com.google.zxing.datamatrix.DataMatrixReader#extractPureBits(BitMatrix)
103103
*/
104104
private static function extractPureBits(BitMatrix $image): BitMatrix

lib/RGBLuminanceSource.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ public function __construct(
6868
$this->top = $top;
6969
}
7070

71-
public function rotateCounterClockwise(): void {
72-
throw new \RuntimeException("This LuminanceSource does not support rotateCounterClockwise"); }
71+
public function rotateCounterClockwise(): void
72+
{
73+
throw new \RuntimeException("This LuminanceSource does not support rotateCounterClockwise");
74+
}
7375

74-
public function rotateCounterClockwise45(): void {
75-
throw new \RuntimeException("This LuminanceSource does not support rotateCounterClockwise45"); }
76+
public function rotateCounterClockwise45(): void
77+
{
78+
throw new \RuntimeException("This LuminanceSource does not support rotateCounterClockwise45");
79+
}
7680

7781
public function RGBLuminanceSource_($width, $height, $pixels): void
7882
{

0 commit comments

Comments
 (0)