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

PHPLIB-1158: Upgrade psalm+rector+phpcs jobs to PHP 8.2 #1113

Merged
merged 1 commit into from
Jun 21, 2023
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: 2 additions & 2 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ on:
jobs:
phpcs:
name: "phpcs"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "7.4"
- "8.2"
driver-version:
- "mongodb/mongo-php-driver@master"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ on:
jobs:
psalm:
name: "Psalm"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "7.4"
- "8.2"
driver-version:
- "mongodb/mongo-php-driver@master"

Expand Down
25 changes: 6 additions & 19 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
</UnsafeInstantiation>
</file>
<file src="src/Exception/InvalidArgumentException.php">
<UnsafeInstantiation occurrences="2">
<UnsafeInstantiation occurrences="1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you regenerated the baseline for this PR?

Copy link
Member Author

@GromNaN GromNaN Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, that's mostly resolved issues.

<code>new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, get_debug_type($value)))</code>
<code>new static('Expected update operator(s) or non-empty pipeline for ' . $name)</code>
</UnsafeInstantiation>
</file>
<file src="src/Exception/ResumeTokenException.php">
Expand Down Expand Up @@ -421,18 +420,13 @@
<code>$options['pipeline']</code>
<code>$this-&gt;options['typeMap']</code>
</MixedArgument>
<MixedAssignment occurrences="4">
<MixedAssignment occurrences="3">
<code>$cmd[$option]</code>
<code>$i</code>
<code>$options['session']</code>
<code>$options['writeConcern']</code>
</MixedAssignment>
</file>
<file src="src/Operation/CreateEncryptedCollection.php">
<DocblockTypeContradiction occurrences="2">
<code>! is_array($encryptedFields['fields'])</code>
<code>! is_array($field) &amp;&amp; ! is_object($field)</code>
</DocblockTypeContradiction>
<MixedArgument occurrences="1">
<code>$this-&gt;options['encryptedFields']</code>
</MixedArgument>
Expand Down Expand Up @@ -555,8 +549,7 @@
<MixedArrayAccess occurrences="1">
<code>$options['modifiers'][$modifier[1]]</code>
</MixedArrayAccess>
<MixedAssignment occurrences="5">
<code>$cmd['readConcern']</code>
<MixedAssignment occurrences="4">
<code>$options[$modifier[0]]</code>
<code>$options[$option]</code>
<code>$options['readPreference']</code>
Expand Down Expand Up @@ -712,9 +705,8 @@
<MixedArgument occurrences="1">
<code>$this-&gt;options['writeConcern']</code>
</MixedArgument>
<MixedAssignment occurrences="6">
<MixedAssignment occurrences="5">
<code>$cmd['bypassDocumentValidation']</code>
<code>$cmd['writeConcern']</code>
<code>$options[$option]</code>
<code>$options['session']</code>
<code>$options['writeConcern']</code>
Expand Down Expand Up @@ -799,18 +791,13 @@
<code>$typeMap['fieldPaths'][$fieldPath]</code>
<code>$value</code>
</MixedAssignment>
<MixedInferredReturnType occurrences="3">
<code>array|object</code>
<MixedInferredReturnType occurrences="2">
<code>array|object|null</code>
<code>array|object|null</code>
</MixedInferredReturnType>
<MixedOperand occurrences="1">
<code>$type</code>
</MixedOperand>
<MixedReturnStatement occurrences="3">
<MixedReturnStatement occurrences="2">
<code>$collectionInfo['options']['encryptedFields'] ?? null</code>
<code>$encryptedFieldsMap[$databaseName . '.' . $collectionName] ?? null</code>
<code>toPHP(fromPHP($document), $typeMap)</code>
</MixedReturnStatement>
</file>
</files>