-
-
Notifications
You must be signed in to change notification settings - Fork 514
Upgrade to PHPStan 2.1 #2761
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
Merged
Merged
Upgrade to PHPStan 2.1 #2761
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e6a1525
Upgrade to PHPStan 1.12
GromNaN 2eb5686
Ensure we don't have phpstan deprecation
GromNaN 3d37635
[doc] Set TKey type on Collection
GromNaN 98d7620
Upgrade to phpstan 2
GromNaN 93ce178
Run PHPStan on PHP 8.4
GromNaN a9de625
PersistentCollections is not always present
GromNaN f7b28ba
Keep type assertions even when type is declared
GromNaN fb72224
Use @param-out for by-reference parameter
GromNaN 7e91e3d
Set properties to null instead of unset, as property hooks could be u…
GromNaN 485a4ad
Fix generic types
GromNaN 0d87f6e
Fix property.unusedType on private collection property
GromNaN 6334ffb
Fix type of $visited parameter set by-reference, changed since we use…
GromNaN 5781f1b
ReflectionProperty::isInitialized() is always available since PHP 8.4
GromNaN f297df1
Ignore missingType.generics on UnitOfWork::$persisters
GromNaN 85e8976
Don't check Metadata generic type
GromNaN 5ee4db9
Ignore arguments.count error on method calls with variable name
GromNaN 337ed2a
Update baseline
GromNaN 0aa7519
Fix type of Profile::$profileId
GromNaN f4a4da8
Remove incorrect @throw annotation
GromNaN 3afc991
Make Expr constructor final, as it is instanciated with new static
GromNaN 283db7f
Revert order change
GromNaN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ jobs: | |
| strategy: | ||
| matrix: | ||
| php-version: | ||
| - "8.2" | ||
| - "8.4" | ||
|
|
||
| steps: | ||
| - name: "Checkout code" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,6 +255,7 @@ final class UnitOfWork implements PropertyChangedListener | |
| * The document persister instances used to persist document instances. | ||
| * | ||
| * @var array<class-string, Persisters\DocumentPersister> | ||
| * @phpstan-ignore missingType.generics | ||
| */ | ||
| private array $persisters = []; | ||
|
|
||
|
|
@@ -1749,7 +1750,7 @@ public function persist(object $document): void | |
| * NOTE: This method always considers documents that are not yet known to | ||
| * this UnitOfWork as NEW. | ||
| * | ||
| * @param array<string, object> $visited | ||
| * @param array<int, object> $visited | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a bug from #2738 |
||
| * | ||
| * @throws InvalidArgumentException | ||
| * @throws MongoDBException | ||
|
|
@@ -1952,7 +1953,7 @@ private function doMerge(object $document, array &$visited, ?object $prevManaged | |
| $prop = $this->reflectionService->getAccessibleProperty($class->name, $name); | ||
| assert($prop instanceof ReflectionProperty); | ||
|
|
||
| if (method_exists($prop, 'isInitialized') && ! $prop->isInitialized($document)) { | ||
| if (! $prop->isInitialized($document)) { | ||
|
Comment on lines
-1955
to
+1956
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| continue; | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating all doc examples, the
Collectionclass has 2 type templates.