From 05917f7286a9b050c60ff8a60685c329db4cda27 Mon Sep 17 00:00:00 2001 From: codemasher Date: Wed, 1 Dec 2021 22:49:32 +0100 Subject: [PATCH] :shower: removed html tags and javadoc remnants from docblocks --- src/Common/GF256.php | 8 +++--- src/Common/ReedSolomonDecoder.php | 14 ++++----- src/Decoder/BitMatrix.php | 22 +++++++-------- src/Decoder/Decoder.php | 16 +++++------ src/Decoder/LuminanceSourceInterface.php | 2 +- src/Detector/AlignmentPattern.php | 6 ++-- src/Detector/AlignmentPatternFinder.php | 26 ++++++++--------- src/Detector/Detector.php | 36 ++++++++++++------------ src/Detector/FinderPattern.php | 6 ++-- src/Detector/FinderPatternFinder.php | 28 +++++++++--------- src/Detector/GridSampler.php | 14 ++++----- src/Detector/PerspectiveTransform.php | 4 +-- src/Detector/ResultPoint.php | 8 +++--- 13 files changed, 95 insertions(+), 95 deletions(-) diff --git a/src/Common/GF256.php b/src/Common/GF256.php index 5ae7a85f9..7b2bfa98a 100644 --- a/src/Common/GF256.php +++ b/src/Common/GF256.php @@ -16,12 +16,12 @@ use InvalidArgumentException; use function array_fill; /** - *

This class contains utility methods for performing mathematical operations over - * the Galois Fields. Operations use a given primitive polynomial in calculations.

+ * This class contains utility methods for performing mathematical operations over + * the Galois Fields. Operations use a given primitive polynomial in calculations. * - *

Throughout this package, elements of the GF are represented as an {@code int} + * Throughout this package, elements of the GF are represented as an int * for convenience and speed (but at the cost of memory). - *

+ * * * @author Sean Owen * @author David Olivier diff --git a/src/Common/ReedSolomonDecoder.php b/src/Common/ReedSolomonDecoder.php index e575a87ed..54e01be7d 100644 --- a/src/Common/ReedSolomonDecoder.php +++ b/src/Common/ReedSolomonDecoder.php @@ -15,10 +15,10 @@ use RuntimeException; use function array_fill, count; /** - *

Implements Reed-Solomon decoding, as the name implies.

+ * Implements Reed-Solomon decoding, as the name implies. * - *

The algorithm will not be explained here, but the following references were helpful - * in creating this implementation:

+ * The algorithm will not be explained here, but the following references were helpful + * in creating this implementation: * * * - *

Much credit is due to William Rucklidge since portions of this code are an indirect - * port of his C++ Reed-Solomon implementation.

+ * Much credit is due to William Rucklidge since portions of this code are an indirect + * port of his C++ Reed-Solomon implementation. * * @author Sean Owen * @author William Rucklidge @@ -39,9 +39,9 @@ use function array_fill, count; final class ReedSolomonDecoder{ /** - *

Decodes given set of received codewords, which include both data and error-correction + * Decodes given set of received codewords, which include both data and error-correction * codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, - * in the input.

+ * in the input. * * @param array $received data and error-correction codewords * @param int $numEccCodewords number of error-correction codewords available diff --git a/src/Decoder/BitMatrix.php b/src/Decoder/BitMatrix.php index 52065842e..a355d1283 100644 --- a/src/Decoder/BitMatrix.php +++ b/src/Decoder/BitMatrix.php @@ -38,7 +38,7 @@ final class BitMatrix{ } /** - *

Sets the given bit to true.

+ * Sets the given bit to true. * * @param int $x ; The horizontal component (i.e. which column) * @param int $y ; The vertical component (i.e. which row) @@ -53,7 +53,7 @@ final class BitMatrix{ } /** - *

Flips the given bit. 1 << (0xf9 & 0x1f)

+ * Flips the given bit. 1 << (0xf9 & 0x1f) * * @param int $x ; The horizontal component (i.e. which column) * @param int $y ; The vertical component (i.e. which row) @@ -67,7 +67,7 @@ final class BitMatrix{ } /** - *

Sets a square region of the bit matrix to true.

+ * Sets a square region of the bit matrix to true. * * @param int $left ; The horizontal position to begin at (inclusive) * @param int $top ; The vertical position to begin at (inclusive) @@ -127,7 +127,7 @@ final class BitMatrix{ } /** - *

Gets the requested bit, where true means black.

+ * Gets the requested bit, where true means black. * * @param int $x The horizontal component (i.e. which column) * @param int $y The vertical component (i.e. which row) @@ -224,9 +224,9 @@ final class BitMatrix{ /** * Prepare the parser for a mirrored operation. - * This flag has effect only on the {@link #readFormatInformation()} and the - * {@link #readVersion()}. Before proceeding with {@link #readCodewords()} the - * {@link #mirror()} method should be called. + * This flag has effect only on the #readFormatInformation() and the + * #readVersion(). Before proceeding with #readCodewords() the + * #mirror() method should be called. * * @param bool $mirror Whether to read version and format information mirrored. */ @@ -251,9 +251,9 @@ final class BitMatrix{ } /** - *

Reads the bits in the {@link BitMatrix} representing the finder pattern in the + * Reads the bits in the BitMatrix representing the finder pattern in the * correct order in order to reconstruct the codewords bytes contained within the - * QR Code.

+ * QR Code. * * @return array bytes encoded within the QR Code * @throws \RuntimeException if the exact number of bytes expected is not read @@ -315,7 +315,7 @@ final class BitMatrix{ } /** - *

Reads format information from one of its two locations within the QR Code.

+ * Reads format information from one of its two locations within the QR Code. * * @return \chillerlan\QRCode\Common\FormatInformation encapsulating the QR Code's format info * @throws \RuntimeException if both format information locations cannot be parsed as @@ -422,7 +422,7 @@ final class BitMatrix{ } /** - *

Reads version information from one of its two locations within the QR Code.

+ * Reads version information from one of its two locations within the QR Code. * * @return \chillerlan\QRCode\Common\Version encapsulating the QR Code's version * @throws \RuntimeException if both version information locations cannot be parsed as diff --git a/src/Decoder/Decoder.php b/src/Decoder/Decoder.php index dbc652a4f..ef1801ec5 100644 --- a/src/Decoder/Decoder.php +++ b/src/Decoder/Decoder.php @@ -18,8 +18,8 @@ use chillerlan\QRCode\Detector\Detector; use function count, array_fill, mb_convert_encoding, mb_detect_encoding; /** - *

The main class which implements QR Code decoding -- as opposed to locating and extracting - * the QR Code from an image.

+ * The main class which implements QR Code decoding -- as opposed to locating and extracting + * the QR Code from an image. * * @author Sean Owen */ @@ -28,8 +28,8 @@ final class Decoder{ # private const GB2312_SUBSET = 1; /** - *

Decodes a QR Code represented as a {@link \chillerlan\QRCode\Decoder\BitMatrix}. - * A 1 or "true" is taken to mean a black module.

+ * Decodes a QR Code represented as a BitMatrix. + * A 1 or "true" is taken to mean a black module. * * @param \chillerlan\QRCode\Decoder\LuminanceSourceInterface $source * @@ -105,9 +105,9 @@ final class Decoder{ } /** - *

When QR Codes use multiple data blocks, they are actually interleaved. + * When QR Codes use multiple data blocks, they are actually interleaved. * That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This - * method will separate the data into original blocks.

+ * method will separate the data into original blocks. * * @param array $rawCodewords bytes as read directly from the QR Code * @param \chillerlan\QRCode\Common\Version $version version of the QR Code @@ -187,8 +187,8 @@ final class Decoder{ } /** - *

Given data and error-correction codewords received, possibly corrupted by errors, attempts to - * correct the errors in-place using Reed-Solomon error correction.

+ * Given data and error-correction codewords received, possibly corrupted by errors, attempts to + * correct the errors in-place using Reed-Solomon error correction. */ private function correctErrors(array $codewordBytes, int $numDataCodewords):array{ // First read into an array of ints diff --git a/src/Decoder/LuminanceSourceInterface.php b/src/Decoder/LuminanceSourceInterface.php index 50aa557f7..7e3dbdf5a 100644 --- a/src/Decoder/LuminanceSourceInterface.php +++ b/src/Decoder/LuminanceSourceInterface.php @@ -16,7 +16,7 @@ interface LuminanceSourceInterface{ /** * Fetches luminance data for the underlying bitmap. Values should be fetched using: - * {@code int luminance = array[y * width + x] & 0xff} + * `int luminance = array[y * width + x] & 0xff` * * @return array A row-major 2D array of luminance values. Do not use result.length as it may be * larger than width * height bytes on some platforms. Do not modify the contents diff --git a/src/Detector/AlignmentPattern.php b/src/Detector/AlignmentPattern.php index cd7910bf7..e2ac0a042 100644 --- a/src/Detector/AlignmentPattern.php +++ b/src/Detector/AlignmentPattern.php @@ -12,8 +12,8 @@ namespace chillerlan\QRCode\Detector; /** - *

Encapsulates an alignment pattern, which are the smaller square patterns found in - * all but the simplest QR Codes.

+ * Encapsulates an alignment pattern, which are the smaller square patterns found in + * all but the simplest QR Codes. * * @author Sean Owen */ @@ -21,7 +21,7 @@ final class AlignmentPattern extends ResultPoint{ /** * Combines this object's current estimate of a finder pattern position and module size - * with a new estimate. It returns a new {@code FinderPattern} containing an average of the two. + * with a new estimate. It returns a new FinderPattern containing an average of the two. */ public function combineEstimate(float $i, float $j, float $newModuleSize):self{ return new self( diff --git a/src/Detector/AlignmentPatternFinder.php b/src/Detector/AlignmentPatternFinder.php index a68e11589..f2928203e 100644 --- a/src/Detector/AlignmentPatternFinder.php +++ b/src/Detector/AlignmentPatternFinder.php @@ -15,16 +15,16 @@ use chillerlan\QRCode\Decoder\BitMatrix; use function abs, count; /** - *

This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder - * patterns but are smaller and appear at regular intervals throughout the image.

+ * This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder + * patterns but are smaller and appear at regular intervals throughout the image. * - *

At the moment this only looks for the bottom-right alignment pattern.

+ * At the moment this only looks for the bottom-right alignment pattern. * - *

This is mostly a simplified copy of {@link FinderPatternFinder}. It is copied, + * This is mostly a simplified copy of FinderPatternFinder. It is copied, * pasted and stripped down here for maximum performance but does unfortunately duplicate - * some code.

+ * some code. * - *

This class is thread-safe but not reentrant. Each thread must allocate its own object.

+ * This class is thread-safe but not reentrant. Each thread must allocate its own object. * * @author Sean Owen */ @@ -36,7 +36,7 @@ final class AlignmentPatternFinder{ private array $possibleCenters; /** - *

Creates a finder that will look in a portion of the whole image.

+ * Creates a finder that will look in a portion of the whole image. * * @param \chillerlan\QRCode\Decoder\BitMatrix $image image to search * @param float $moduleSize estimated module size so far @@ -48,8 +48,8 @@ final class AlignmentPatternFinder{ } /** - *

This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since - * it's pretty performance-critical and so is written to be fast foremost.

+ * This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since + * it's pretty performance-critical and so is written to be fast foremost. * * @param int $startX left column from which to start searching * @param int $startY top row from which to start searching @@ -163,10 +163,10 @@ final class AlignmentPatternFinder{ } /** - *

This is called when a horizontal scan finds a possible alignment pattern. It will + * This is called when a horizontal scan finds a possible alignment pattern. It will * cross check with a vertical scan, and if successful, will see if this pattern had been * found on a previous horizontal scan. If so, we consider it confirmed and conclude we have - * found the alignment pattern.

+ * found the alignment pattern. * * @param int[] $stateCount reading state module counts from horizontal scan * @param int $i row where alignment pattern may be found @@ -211,9 +211,9 @@ final class AlignmentPatternFinder{ } /** - *

After a horizontal scan finds a potential alignment pattern, this method + * After a horizontal scan finds a potential alignment pattern, this method * "cross-checks" by scanning down vertically through the center of the possible - * alignment pattern to see if the same proportion is detected.

+ * alignment pattern to see if the same proportion is detected. * * @param int $startI row where an alignment pattern was detected * @param int $centerJ center of the section that appears to cross an alignment pattern diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index d8a56695e..0ba19bbaa 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -19,8 +19,8 @@ use function abs, is_nan, max, min, round; use const NAN; /** - *

Encapsulates logic that can detect a QR Code in an image, even if the QR Code - * is rotated or skewed, or partially obscured.

+ * Encapsulates logic that can detect a QR Code in an image, even if the QR Code + * is rotated or skewed, or partially obscured. * * @author Sean Owen */ @@ -36,7 +36,7 @@ final class Detector{ } /** - *

Detects a QR Code in an image.

+ * Detects a QR Code in an image. */ public function detect():BitMatrix{ [$bottomLeft, $topLeft, $topRight] = (new FinderPatternFinder($this->bitMatrix))->find(); @@ -75,8 +75,8 @@ final class Detector{ } /** - *

Computes an average estimated module size based on estimated derived from the positions - * of the three finder patterns.

+ * Computes an average estimated module size based on estimated derived from the positions + * of the three finder patterns. * * @throws \RuntimeException */ @@ -95,9 +95,9 @@ final class Detector{ } /** - *

Estimates module size based on two finder patterns -- it uses - * {@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the - * width of each, measuring along the axis between their centers.

+ * Estimates module size based on two finder patterns -- it uses + * #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int) to figure the + * width of each, measuring along the axis between their centers. */ private function calculateModuleSizeOneWay(FinderPattern $pattern, FinderPattern $otherPattern):float{ @@ -128,9 +128,9 @@ final class Detector{ } /** - * See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of + * See #sizeOfBlackWhiteBlackRun(int, int, int, int); computes the total width of * a finder pattern by looking for a black-white-black run from the center in the direction - * of another po$(another finder pattern center), and in the opposite direction too.

+ * of another po$(another finder pattern center), and in the opposite direction too. */ private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, float $toX, float $toY):float{ $result = $this->sizeOfBlackWhiteBlackRun((int)$fromX, (int)$fromY, (int)$toX, (int)$toY); @@ -168,12 +168,12 @@ final class Detector{ } /** - *

This method traces a line from a po$in the image, in the direction towards another point. + * This method traces a line from a po$in the image, in the direction towards another point. * It begins in a black region, and keeps going until it finds white, then black, then white again. - * It reports the distance from the start to this point.

+ * It reports the distance from the start to this point. * - *

This is used when figuring out how wide a finder pattern is, when the finder pattern - * may be skewed or rotated.

+ * This is used when figuring out how wide a finder pattern is, when the finder pattern + * may be skewed or rotated. */ private function sizeOfBlackWhiteBlackRun(int $fromX, int $fromY, int $toX, int $toY):float{ // Mild variant of Bresenham's algorithm; @@ -241,8 +241,8 @@ final class Detector{ } /** - *

Computes the dimension (number of modules on a size) of the QR Code based on the position - * of the finder patterns and estimated module size.

+ * Computes the dimension (number of modules on a size) of the QR Code based on the position + * of the finder patterns and estimated module size. * * @throws \RuntimeException */ @@ -276,8 +276,8 @@ final class Detector{ } /** - *

Attempts to locate an alignment pattern in a limited region of the image, which is - * guessed to contain it.

+ * Attempts to locate an alignment pattern in a limited region of the image, which is + * guessed to contain it. * * @param float $overallEstModuleSize estimated module size so far * @param int $estAlignmentX x coordinate of center of area probably containing alignment pattern diff --git a/src/Detector/FinderPattern.php b/src/Detector/FinderPattern.php index 89339ce10..56e156cac 100644 --- a/src/Detector/FinderPattern.php +++ b/src/Detector/FinderPattern.php @@ -14,9 +14,9 @@ namespace chillerlan\QRCode\Detector; use function sqrt; /** - *

Encapsulates a finder pattern, which are the three square patterns found in + * Encapsulates a finder pattern, which are the three square patterns found in * the corners of QR Codes. It also encapsulates a count of similar finder patterns, - * as a convenience to the finder's bookkeeping.

+ * as a convenience to the finder's bookkeeping. * * @author Sean Owen */ @@ -58,7 +58,7 @@ final class FinderPattern extends ResultPoint{ /** * Combines this object's current estimate of a finder pattern position and module size - * with a new estimate. It returns a new {@code FinderPattern} containing a weighted average + * with a new estimate. It returns a new FinderPattern containing a weighted average * based on count. */ public function combineEstimate(float $i, float $j, float $newModuleSize):self{ diff --git a/src/Detector/FinderPatternFinder.php b/src/Detector/FinderPatternFinder.php index 251868647..0b6cf6df6 100644 --- a/src/Detector/FinderPatternFinder.php +++ b/src/Detector/FinderPatternFinder.php @@ -19,10 +19,10 @@ use function abs, count, usort; use const PHP_FLOAT_MAX; /** - *

This class attempts to find finder patterns in a QR Code. Finder patterns are the square - * markers at three corners of a QR Code.

+ * This class attempts to find finder patterns in a QR Code. Finder patterns are the square + * markers at three corners of a QR Code. * - *

This class is thread-safe but not reentrant. Each thread must allocate its own object. + * This class is thread-safe but not reentrant. Each thread must allocate its own object. * * @author Sean Owen */ @@ -37,7 +37,7 @@ final class FinderPatternFinder{ private bool $hasSkipped = false; /** - *

Creates a finder that will search the image for three finder patterns.

+ * Creates a finder that will search the image for three finder patterns. * * @param BitMatrix $bitMatrix image to search */ @@ -318,9 +318,9 @@ final class FinderPatternFinder{ } /** - *

After a horizontal scan finds a potential finder pattern, this method + * After a horizontal scan finds a potential finder pattern, this method * "cross-checks" by scanning down vertically through the center of the possible - * finder pattern to see if the same proportion is detected.

+ * finder pattern to see if the same proportion is detected. * * @param int $startI ; row where a finder pattern was detected * @param int $centerJ ; center of the section that appears to cross a finder pattern @@ -409,9 +409,9 @@ final class FinderPatternFinder{ } /** - *

Like {@link #crossCheckVertical(int, int, int, int)}, and in fact is basically identical, + * Like #crossCheckVertical(int, int, int, int), and in fact is basically identical, * except it reads horizontally instead of vertically. This is used to cross-cross - * check a vertical cross check and locate the real center of the alignment pattern.

+ * check a vertical cross check and locate the real center of the alignment pattern. */ private function crossCheckHorizontal(int $startJ, int $centerI, int $maxCount, int $originalStateCountTotal):?float{ $maxJ = $this->bitMatrix->getDimension(); @@ -489,13 +489,13 @@ final class FinderPatternFinder{ } /** - *

This is called when a horizontal scan finds a possible alignment pattern. It will + * This is called when a horizontal scan finds a possible alignment pattern. It will * cross check with a vertical scan, and if successful, will, ah, cross-cross-check * with another horizontal scan. This is needed primarily to locate the real horizontal * center of the pattern in cases of extreme skew. - * And then we cross-cross-cross check with another diagonal scan.

+ * And then we cross-cross-cross check with another diagonal scan. * - *

If that succeeds the finder pattern location is added to a list that tracks + * If that succeeds the finder pattern location is added to a list that tracks * the number of times each location has been nearly-matched as a finder pattern. * Each additional find is more evidence that the location is in fact a finder * pattern center @@ -581,7 +581,7 @@ final class FinderPatternFinder{ /** * @return bool true if we have found at least 3 finder patterns that have been detected - * at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the + * at least #CENTER_QUORUM times each, and, the estimated module size of the * candidates is "pretty similar" */ private function haveMultiplyConfirmedCenters():bool{ @@ -614,8 +614,8 @@ final class FinderPatternFinder{ } /** - * @return \chillerlan\QRCode\Detector\FinderPattern[] the 3 best {@link FinderPattern}s from our list of candidates. The "best" are - * those that have been detected at least {@link #CENTER_QUORUM} times, and whose module + * @return \chillerlan\QRCode\Detector\FinderPattern[] the 3 best FinderPatterns from our list of candidates. The "best" are + * those that have been detected at least #CENTER_QUORUM times, and whose module * size differs from the average among those patterns the least * @throws \RuntimeException if 3 such finder patterns do not exist */ diff --git a/src/Detector/GridSampler.php b/src/Detector/GridSampler.php index 2f252c9f9..dbbb3d780 100644 --- a/src/Detector/GridSampler.php +++ b/src/Detector/GridSampler.php @@ -23,7 +23,7 @@ use function array_fill, count, sprintf; * Imaging library, but which may not be available in other environments such as J2ME, and vice * versa. * - * The implementation used can be controlled by calling {@link #setGridSampler(GridSampler)} + * The implementation used can be controlled by calling #setGridSampler(GridSampler) * with an instance of a class which implements this interface. * * @author Sean Owen @@ -31,15 +31,15 @@ use function array_fill, count, sprintf; final class GridSampler{ /** - *

Checks a set of points that have been transformed to sample points on an image against - * the image's dimensions to see if the point are even within the image.

+ * Checks a set of points that have been transformed to sample points on an image against + * the image's dimensions to see if the point are even within the image. * - *

This method will actually "nudge" the endpoints back onto the image if they are found to be + * This method will actually "nudge" the endpoints back onto the image if they are found to be * barely (less than 1 pixel) off the image. This accounts for imperfect detection of finder - * patterns in an image where the QR Code runs all the way to the image border.

+ * patterns in an image where the QR Code runs all the way to the image border. * - *

For efficiency, the method will check points from either end of the line until one is found - * to be within the image. Because the set of points are assumed to be linear, this is valid.

+ * For efficiency, the method will check points from either end of the line until one is found + * to be within the image. Because the set of points are assumed to be linear, this is valid. * * @param \chillerlan\QRCode\Decoder\BitMatrix $bitMatrix image into which the points should map * @param float[] $points actual points in x1,y1,...,xn,yn form diff --git a/src/Detector/PerspectiveTransform.php b/src/Detector/PerspectiveTransform.php index 87c93d7c6..e7a137b0c 100644 --- a/src/Detector/PerspectiveTransform.php +++ b/src/Detector/PerspectiveTransform.php @@ -14,9 +14,9 @@ namespace chillerlan\QRCode\Detector; use function count; /** - *

This class implements a perspective transform in two dimensions. Given four source and four + * This class implements a perspective transform in two dimensions. Given four source and four * destination points, it will compute the transformation implied between them. The code is based - * directly upon section 3.4.2 of George Wolberg's "Digital Image Warping"; see pages 54-56.

+ * directly upon section 3.4.2 of George Wolberg's "Digital Image Warping"; see pages 54-56. * * @author Sean Owen */ diff --git a/src/Detector/ResultPoint.php b/src/Detector/ResultPoint.php index 5cc17116f..92997a746 100644 --- a/src/Detector/ResultPoint.php +++ b/src/Detector/ResultPoint.php @@ -14,8 +14,8 @@ namespace chillerlan\QRCode\Detector; use function abs; /** - *

Encapsulates a point of interest in an image containing a barcode. Typically, this - * would be the location of a finder pattern or the corner of the barcode, for example.

+ * Encapsulates a point of interest in an image containing a barcode. Typically, this + * would be the location of a finder pattern or the corner of the barcode, for example. * * @author Sean Owen */ @@ -56,8 +56,8 @@ abstract class ResultPoint{ } /** - *

Determines if this finder pattern "about equals" a finder pattern at the stated - * position and size -- meaning, it is at nearly the same center with nearly the same size.

+ * Determines if this finder pattern "about equals" a finder pattern at the stated + * position and size -- meaning, it is at nearly the same center with nearly the same size. */ public function aboutEquals(float $moduleSize, float $i, float $j):bool{