mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-24 15:47:54 +00:00
:octocat: omit parentheses around "new" calls
This commit is contained in:
@@ -16,7 +16,7 @@ header('Content-type: application/json');
|
||||
|
||||
$data = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
|
||||
|
||||
echo (new QRCode($options))->render($data); // -> JSON string
|
||||
echo new QRCode($options)->render($data); // -> JSON string
|
||||
```
|
||||
|
||||
The associated [JSON schema](https://json-schema.org/specification) can be found over at GitHub: [`qrcode.schema.json`](https://github.com/chillerlan/php-qrcode/blob/main/src/Output/qrcode.schema.json)
|
||||
@@ -28,7 +28,7 @@ The previous versions of `php-qrcode` (v5 and earlier) just dumped an array repr
|
||||
which is equivalent to the following:
|
||||
|
||||
```php
|
||||
$matrix = (new QRCode($options))->getQRMatrix(); // -> QRMatrix instance
|
||||
$matrix = new QRCode($options)->getQRMatrix(); // -> QRMatrix instance
|
||||
|
||||
// retrieve the internal matrix as an array of booleans
|
||||
$json = json_encode($matrix->getMatrix(true), $jsonFlags);
|
||||
|
||||
Reference in New Issue
Block a user