-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Psalm level 5 #2408
Psalm level 5 #2408
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -428,6 +428,7 @@ public function isEmpty() | |
|
||
/** | ||
* @return Traversable | ||
* @psalm-return Traversable<TKey, T> | ||
*/ | ||
#[ReturnTypeWillChange] | ||
public function getIterator() | ||
|
@@ -540,6 +541,7 @@ public function offsetExists($offset) | |
* @param mixed $offset | ||
* | ||
* @return mixed | ||
* @psalm-return T|null | ||
*/ | ||
#[ReturnTypeWillChange] | ||
public function offsetGet($offset) | ||
|
@@ -660,6 +662,11 @@ private function doAdd($value, $arrayAccess) | |
* @param mixed $offset | ||
* | ||
* @return bool|T|null | ||
* @psalm-return ( | ||
* $arrayAccess is false | ||
* ? T|null | ||
* : T|null|true | ||
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. oh boy, now we're programming in comments :D 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 can be really interesting when adding generics for example to |
||
* ) | ||
*/ | ||
private function doRemove($offset, bool $arrayAccess) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="4.20.0@f82a70e7edfc6cf2705e9374c8a0b6a974a779ed"> | ||
<file src="lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php"> | ||
<InvalidReturnStatement occurrences="1"> | ||
<code>$this->num($limit)</code> | ||
</InvalidReturnStatement> | ||
<InvalidReturnType occurrences="1"> | ||
<code>self</code> | ||
</InvalidReturnType> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php"> | ||
<InvalidArrayOffset occurrences="1"> | ||
<code>[$this->identifier => $this->getIdentifierValue($object)]</code> | ||
</InvalidArrayOffset> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php"> | ||
<InvalidArgument occurrences="1"> | ||
<code>$mapping</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/PersistentCollection/AbstractPersistentCollectionFactory.php"> | ||
<InvalidArgument occurrences="1"> | ||
<code>new PersistentCollection($coll, $dm, $dm->getUnitOfWork())</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php"> | ||
<InvalidArgument occurrences="5"> | ||
<code>$func</code> | ||
<code>$p</code> | ||
<code>$p</code> | ||
<code>$p</code> | ||
<code>$p</code> | ||
</InvalidArgument> | ||
<InvalidNullableReturnType occurrences="1"> | ||
<code>getMapping</code> | ||
</InvalidNullableReturnType> | ||
<InvalidReturnType occurrences="1"> | ||
<code>getTypeClass</code> | ||
</InvalidReturnType> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/Proxy/Resolver/ProxyManagerClassNameResolver.php"> | ||
<MoreSpecificImplementedParamType occurrences="1"> | ||
<code>$className</code> | ||
</MoreSpecificImplementedParamType> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/Repository/DefaultGridFSRepository.php"> | ||
<InvalidReturnStatement occurrences="1"> | ||
<code>$options + ['metadata' => (object) $metadata]</code> | ||
</InvalidReturnStatement> | ||
</file> | ||
<file src="lib/Doctrine/ODM/MongoDB/UnitOfWork.php"> | ||
<InvalidPropertyAssignmentValue occurrences="2"> | ||
<code>$this->identityMap</code> | ||
<code>$this->originalDocumentData</code> | ||
</InvalidPropertyAssignmentValue> | ||
<NullableReturnStatement occurrences="1"> | ||
<code>$mapping['targetDocument']</code> | ||
</NullableReturnStatement> | ||
</file> | ||
<file src="tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php"> | ||
<InvalidArgument occurrences="1"> | ||
<code>new ArrayCollection([$project])</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/CollectionPersisterTest.php"> | ||
<InvalidArgument occurrences="3"> | ||
<code>[$user->categories[0]->children, $user->categories[1]->children]</code> | ||
<code>[$user->categories[0]->children[0]->children, $user->categories[0]->children[1]->children]</code> | ||
<code>[$user->categories[0]->children[0]->children, $user->categories[0]->children[1]->children]</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomCollectionsTest.php"> | ||
<InvalidArgument occurrences="4"> | ||
<code>$i</code> | ||
<code>$i</code> | ||
<code>$j</code> | ||
<code>$j</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM81Test.php"> | ||
<InvalidNullableReturnType occurrences="1"> | ||
<code>DocumentManager</code> | ||
</InvalidNullableReturnType> | ||
<NullableReturnStatement occurrences="1"> | ||
<code>$this->dm</code> | ||
</NullableReturnStatement> | ||
</file> | ||
</files> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,7 @@ class GH1229Child | |
/** | ||
* @ODM\Field(type="int") | ||
* | ||
* @var int|null | ||
* @var int | ||
*/ | ||
public $order = 0; | ||
|
||
|
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.
null
doesn't look like an acceptable value for the array but I guess it comes fromconvertXMLElementValue
so let's live with thatThere 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.
yep, exactly