Skip to content

Commit 3783ef7

Browse files
committed
✨ RTFD!
1 parent 1423638 commit 3783ef7

File tree

9 files changed

+641
-32
lines changed

9 files changed

+641
-32
lines changed

docs/API-DecoderResult.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# `DecoderResult`
2+
3+
The full phpDocumentor API documentation can be found at [chillerlan.github.io/php-qrcode](https://chillerlan.github.io/php-qrcode/classes/chillerlan-QRCode-Decoder-DecoderResult.html).
4+
5+
## Methods
6+
7+
| method | return | description |
8+
|--------------------------------------------|------------|------------------------------------------------------------------------------------------------------------|
9+
| `__construct(iterable $properties = null)` | - | used internally by [`Decoder`](https://github.com/chillerlan/php-qrcode/blob/main/src/Decoder/Decoder.php) |
10+
| `__toString()` | `string` | returns the data contained in the QR symbol |
11+
| `hasStructuredAppend()` | `bool` | |
12+
| `getQRMatrix()` | `QRMatrix` | |
13+
14+
## Magic Properties (read-only)
15+
16+
| property | type | description |
17+
|-----------------------------|---------------|------------------|
18+
| `$rawBytes` | `BitBuffer` | |
19+
| `$version` | `Version` | |
20+
| `$eccLevel` | `EccLevel` | |
21+
| `$maskPattern` | `MaskPattern` | |
22+
| `$data` | `string` | defaults to `''` |
23+
| `$structuredAppendParity` | `int` | defaults to `-1` |
24+
| `$structuredAppendSequence` | `int` | defaults to `-1` |

docs/API-QRCode.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# `QRCode`
2+
3+
The full phpDocumentor API documentation can be found at [chillerlan.github.io/php-qrcode](https://chillerlan.github.io/php-qrcode/classes/chillerlan-QRCode-QRCode.html).
4+
5+
6+
## Methods
7+
<!-- using non-breaking spaces chr(255) in the longest method signature to force the silly table to stretch -->
8+
| method | return | description |
9+
|-----------------------------------------------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
10+
| `__construct(SettingsContainerInterface $options = null)` | - | see [`QROptions`](./API-QROptions.md) and [`SettingsContainerInterface`](https://github.com/chillerlan/php-settings-container/blob/main/src/SettingsContainerInterface.php) |
11+
| `setOptions(SettingsContainerInterface $options)` | `self` | Sets an options instance, internally called via the constructor |
12+
| `render(string $data, string $file = null)` | `mixed` | renders a QR Code for the given `$data` and `QROptions`, saves `$file` optionally, output depends on the chosen mode, see `QROutputInterface::dump()` |
13+
| `renderMatrix(QRMatrix $matrix, string $file = null)` | `mixed` | renders a QR Code for the given `QRMatrix` and `QROptions`, saves `$file` optionally, output depends on the chosen mode, see `QROutputInterface::dump()` |
14+
| `getQRMatrix()` | `QRMatrix` | returns a `QRMatrix` object for the given `$data` and current `QROptions` |
15+
| `addSegment(QRDataModeInterface $segment)` | `self` | Adds a `QRDataModeInterface` segment |
16+
| `clearSegments()` | `self` | Clears the data segments array |
17+
| `addNumericSegment(string $data)` | `self` | Adds a numeric data segment |
18+
| `addAlphaNumSegment(string $data)` | `self` | Adds an alphanumeric data segment |
19+
| `addKanjiSegment(string $data)` | `self` | Adds a Kanji data segment (Japanese 13-bit double-byte characters, Shift-JIS) |
20+
| `addHanziSegment(string $data)` | `self` | Adds a Hanzi data segment (simplified Chinese 13-bit double-byte characters, GB2312/GB18030) |
21+
| `addByteSegment(string $data)` | `self` | Adds an 8-bit byte data segment |
22+
| `addEciDesignator(int $encoding)` | `self` | Adds a standalone ECI designator |
23+
| `addEciSegment(int $encoding, string $data)` | `self` | Adds an ECI data segment (including designator) |
24+
| `readFromFile(string $path)` | `DecoderResult` | Reads a QR Code from a given file |
25+
| `readFromBlob(string $blob)` | `DecoderResult` | Reads a QR Code from the given data blob |
26+
| `readFromSource(LuminanceSourceInterface $source)` | `DecoderResult` | Reads a QR Code from the given luminance source |
27+
28+
29+
### Deprecated methods
30+
31+
| method | since | replacement |
32+
|------------------------------|---------|--------------------------------------------|
33+
| `getMatrix()` | `5.0.0` | `QRCode::getQRMatrix()` |
34+
| `isNumber(string $string)` | `5.0.0` | `Number::validateString(string $string)` |
35+
| `isAlphaNum(string $string)` | `5.0.0` | `AlphaNum::validateString(string $string)` |
36+
| `isKanji(string $string)` | `5.0.0` | `Kanji::validateString(string $string)` |
37+
| `isByte(string $string)` | `5.0.0` | `Byte::validateString(string $string)` |
38+
39+
40+
## Constants
41+
42+
### Deprecated constants
43+
44+
| name | since | replacement |
45+
|----------------------|---------|----------------------------------|
46+
| `VERSION_AUTO` | `5.0.0` | `Version::AUTO` |
47+
| `MASK_PATTERN_AUTO` | `5.0.0` | `MaskPattern::AUTO` |
48+
| `OUTPUT_MARKUP_SVG` | `5.0.0` | `QROutputInterface::MARKUP_SVG` |
49+
| `OUTPUT_MARKUP_HTML` | `5.0.0` | `QROutputInterface::MARKUP_HTML` |
50+
| `OUTPUT_IMAGE_PNG` | `5.0.0` | `QROutputInterface::GDIMAGE_PNG` |
51+
| `OUTPUT_IMAGE_JPG` | `5.0.0` | `QROutputInterface::GDIMAGE_JPG` |
52+
| `OUTPUT_IMAGE_GIF` | `5.0.0` | `QROutputInterface::GDIMAGE_GIF` |
53+
| `OUTPUT_STRING_JSON` | `5.0.0` | `QROutputInterface::STRING_JSON` |
54+
| `OUTPUT_STRING_TEXT` | `5.0.0` | `QROutputInterface::STRING_TEXT` |
55+
| `OUTPUT_IMAGICK` | `5.0.0` | `QROutputInterface::IMAGICK` |
56+
| `OUTPUT_FPDF` | `5.0.0` | `QROutputInterface::FPDF` |
57+
| `OUTPUT_CUSTOM` | `5.0.0` | `QROutputInterface::CUSTOM` |
58+
| `ECC_L` | `5.0.0` | `EccLevel::L` |
59+
| `ECC_M` | `5.0.0` | `EccLevel::M` |
60+
| `ECC_Q` | `5.0.0` | `EccLevel::Q` |
61+
| `ECC_H` | `5.0.0` | `EccLevel::H` |
62+
| `DATA_NUMBER` | `5.0.0` | `Mode::NUMBER` |
63+
| `DATA_ALPHANUM` | `5.0.0` | `Mode::ALPHANUM` |
64+
| `DATA_BYTE` | `5.0.0` | `Mode::BYTE` |
65+
| `DATA_KANJI` | `5.0.0` | `Mode::KANJI` |

docs/API-QRMatrix.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# `QRMatrix`
2+
3+
The full phpDocumentor API documentation can be found at [chillerlan.github.io/php-qrcode](https://chillerlan.github.io/php-qrcode/classes/chillerlan-QRCode-Data-QRMatrix.html).
4+
5+
## Methods
6+
<!-- using non-breaking spaces chr(255) in the longest method signature to force the silly table to stretch -->
7+
| method | return | description |
8+
|----------------------------------------------------------------------------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------|
9+
| `__construct(Version $version, EccLevel $eccLevel)` | - | |
10+
| `initFunctionalPatterns()` | `self` | shortcut to initialize the functional patterns |
11+
| `getMatrix()` | `array` | the internal matrix representation as a 2 dimensional array |
12+
| `getVersion()` | `Version\|null` | the current QR Code version instance |
13+
| `getEccLevel()` | `EccLevel\|null` | the current ECC level instance |
14+
| `getMaskPattern()` | `MaskPattern\|null` | the used mask pattern instance |
15+
| `getSize()` | `int` | the absoulute size of the matrix, including quiet zone (if set). `$version * 4 + 17 + 2 * $quietzone` |
16+
| `get(int $x, int $y)` | `int` | returns the value of the module |
17+
| `set(int $x, int $y, bool $value, int $M_TYPE)` | `self` | sets the `$M_TYPE` value for the module |
18+
| `setArea(int $startX, int $startY, int $width, int $height, bool $value, int $M_TYPE)` | `self` | Fills an area of $width * $height, from the given starting point $startX, $startY (top left) with $value for $M_TYPE |
19+
| `checkType(int $x, int $y, int $M_TYPE)` | `bool` | Checks whether a module is of the given $M_TYPE |
20+
| `checkTypeIn(int $x, int $y, array $M_TYPES)` | `bool` | Checks whether the module at ($x, $y) is in the given array of $M_TYPES, returns true if a match is found, otherwise false |
21+
| `check(int $x, int $y)` | `bool` | checks whether a module is true (dark) or false (light) |
22+
| `checkNeighbours(int $x, int $y, int $M_TYPE = null)` | `int` | Checks the status neighbouring modules of the given module at ($x, $y) and returns a bitmask with the results. |
23+
| `setDarkModule()` | `self` | |
24+
| `setFinderPattern()` | `self` | |
25+
| `setSeparators()` | `self` | |
26+
| `setAlignmentPattern()` | `self` | |
27+
| `setTimingPattern()` | `self` | |
28+
| `setVersionNumber()` | `self` | |
29+
| `setFormatInfo(MaskPattern $maskPattern = null)` | `self` | |
30+
| `setQuietZone(int $quietZoneSize)` | `self` | Draws the "quiet zone" of $quietZoneSize around the matrix |
31+
| `rotate90()` | `self` | Rotates the matrix by 90 degrees clock wise |
32+
| `setLogoSpace(int $width, int $height = null, int $startX = null, int $startY = null)` | `self` | Clears a space of $width * $height in order to add a logo or text. |
33+
| `writeCodewords(BitBuffer $bitBuffer)` | `self` | Maps the interleaved binary data on the matrix |
34+
| `mask(MaskPattern $maskPattern)` | `self` | Applies/reverses the mask pattern |
35+
36+
### Deprecated methods
37+
38+
| method | since | replacement |
39+
|-----------------|---------|------------------------------|
40+
| `matrix()` | `5.0.0` | `QRMatrix::getMatrix()` |
41+
| `eccLevel()` | `5.0.0` | `QRMatrix::getEccLevel()` |
42+
| `version()` | `5.0.0` | `QRMatrix::getVersion()` |
43+
| `maskPattern()` | `5.0.0` | `QRMatrix::getMaskPattern()` |
44+
| `size()` | `5.0.0` | `QRMatrix::getSize()` |
45+
46+
## Constants
47+
48+
The `_DARK` prefixed constans exist purely for convenience - their value is the same as `QRMatrix::M_XXX\|QRMatrix::IS_DARK`, see [`QROutputInterface`](./API-QROutputInterface.md).
49+
50+
| name | description |
51+
|--------------------|-----------------------------------------------------------------------------------|
52+
| `IS_DARK` | sets the "dark" flag for the given value: `QRMatrix::M_DATA \| QRMatrix::IS_DARK` |
53+
| `M_NULL` | module not set |
54+
| `M_DARKMODULE` | once per matrix at `$xy = [8, 4 * $version + 9]` |
55+
| `M_DATA` | the actual encoded data |
56+
| `M_DATA_DARK` | convenience |
57+
| `M_FINDER` | the 7x7 finder patterns |
58+
| `M_FINDER_DARK` | convenience |
59+
| `M_FINDER_DOT` | the inner 3x3 block of the finder pattern |
60+
| `M_SEPARATOR` | separator lines along the finder patterns |
61+
| `M_SEPARATOR_DARK` | convenience |
62+
| `M_ALIGNMENT` | the 5x5 alignment patterns |
63+
| `M_ALIGNMENT_DARK` | convenience |
64+
| `M_TIMING` | the timing pattern lines |
65+
| `M_TIMING_DARK` | convenience |
66+
| `M_FORMAT` | format information pattern |
67+
| `M_FORMAT_DARK` | convenience |
68+
| `M_VERSION` | version information pattern |
69+
| `M_VERSION_DARK` | convenience |
70+
| `M_QUIETZONE` | margin around the QR Code |
71+
| `M_QUIETZONE_DARK` | convenience |
72+
| `M_LOGO` | space for a logo image (not used yet) |
73+
| `M_LOGO_DARK` | convenience |
74+
| `M_TEST` | test value |
75+
| `M_TEST_DARK` | convenience |

0 commit comments

Comments
 (0)