Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified Coding Style checks: PSR12 replaces Symfony, risky not allowed anymore #737

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading