Skip to content

Commit

Permalink
Simplified Coding Style checks: PSR12 replaces Symfony, risky not all…
Browse files Browse the repository at this point in the history
…owed anymore

also deployed some coding style adaptions
  • Loading branch information
k00ni committed Sep 26, 2024
1 parent ac8e667 commit 35c9351
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Smalot/PdfParser/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Smalot/PdfParser/PDFObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 7 additions & 4 deletions src/Smalot/PdfParser/RawData/RawDataParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand All @@ -293,15 +294,17 @@ 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]
)
) {
$columns = (int) $decpar[$kdc + 1][1];
} elseif (
'/' == $vdc[0]
&& 'Predictor' == $vdc[1]
&& (isset($decpar[$kdc + 1])
&& (
isset($decpar[$kdc + 1])
&& 'numeric' == $decpar[$kdc + 1][0]
)
) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 35c9351

Please sign in to comment.