diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index c860c516..683637a2 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -14,10 +14,8 @@ $config = new Config(); $config ->setFinder($finder) - ->setRiskyAllowed(true) ->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, + '@PSR12' => true, 'array_syntax' => ['syntax' => 'short'], 'no_empty_phpdoc' => true, 'no_unused_imports' => true, diff --git a/src/Smalot/PdfParser/Document.php b/src/Smalot/PdfParser/Document.php index df0a6402..964592e4 100644 --- a/src/Smalot/PdfParser/Document.php +++ b/src/Smalot/PdfParser/Document.php @@ -255,7 +255,7 @@ public function extractXMPMetadata(string $content): void if ('rdf:li' == $val['tag']) { $metadata[] = $val['value']; - // Else assign a value to this property + // Else assign a value to this property } else { $metadata[$val['tag']] = $val['value']; } diff --git a/src/Smalot/PdfParser/PDFObject.php b/src/Smalot/PdfParser/PDFObject.php index a0d16dfe..2c33e0e9 100644 --- a/src/Smalot/PdfParser/PDFObject.php +++ b/src/Smalot/PdfParser/PDFObject.php @@ -451,7 +451,7 @@ public function getSectionsText(?string $content): array $inTextBlock = true; $sections[] = $line; - // If an 'ET' is encountered, unset the $inTextBlock flag + // If an 'ET' is encountered, unset the $inTextBlock flag } elseif ('ET' == $line) { $inTextBlock = false; $sections[] = $line; diff --git a/src/Smalot/PdfParser/RawData/RawDataParser.php b/src/Smalot/PdfParser/RawData/RawDataParser.php index 6441646b..a6256f21 100644 --- a/src/Smalot/PdfParser/RawData/RawDataParser.php +++ b/src/Smalot/PdfParser/RawData/RawDataParser.php @@ -267,7 +267,8 @@ protected function decodeXrefStream(string $pdfData, int $startxref, array $xref if ( ('/' == $v[0]) && ('Type' == $v[1]) - && (isset($sarr[$k + 1]) + && ( + isset($sarr[$k + 1]) && '/' == $sarr[$k + 1][0] && 'XRef' == $sarr[$k + 1][1] ) @@ -293,7 +294,8 @@ protected function decodeXrefStream(string $pdfData, int $startxref, array $xref if ( '/' == $vdc[0] && 'Columns' == $vdc[1] - && (isset($decpar[$kdc + 1]) + && ( + isset($decpar[$kdc + 1]) && 'numeric' == $decpar[$kdc + 1][0] ) ) { @@ -301,7 +303,8 @@ protected function decodeXrefStream(string $pdfData, int $startxref, array $xref } elseif ( '/' == $vdc[0] && 'Predictor' == $vdc[1] - && (isset($decpar[$kdc + 1]) + && ( + isset($decpar[$kdc + 1]) && 'numeric' == $decpar[$kdc + 1][0] ) ) { @@ -407,7 +410,7 @@ protected function decodeXrefStream(string $pdfData, int $startxref, array $xref } $prev_row = $ddata[$k]; } // end for each row - // complete decoding + // complete decoding } else { // number of bytes in a row $rowlen = array_sum($wb);