Skip to content

Conversation

@LastDragon-ru
Copy link
Contributor

Fixes #988

@codecov
Copy link

codecov bot commented Oct 26, 2021

Codecov Report

Merging #991 (9b810a8) into master (2e16ab2) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 9b810a8 differs from pull request most recent head 33f7220. Consider uploading reports for the commit 33f7220 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master     #991      +/-   ##
============================================
+ Coverage     94.43%   94.46%   +0.03%     
  Complexity       50       50              
============================================
  Files           118      118              
  Lines          9607     9608       +1     
============================================
+ Hits           9072     9076       +4     
+ Misses          535      532       -3     
Impacted Files Coverage Δ
src/Type/Definition/InputObjectField.php 94.28% <ø> (ø)
src/Language/AST/Node.php 91.07% <100.00%> (+5.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e16ab2...33f7220. Read the comment docs.

@LastDragon-ru
Copy link
Contributor Author

 55 | ERROR | Case of reference name "schema" and use statement "Schema" does not match.
    |       | (SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity)

Related to upstream :)

Also, I've added two phpstan-ignore because seems there is no way to tell it that cloneValue returns the same type as passed. If someone knows another way you are welcome.

@spawnia
Copy link
Collaborator

spawnia commented Oct 27, 2021

Inviting @simPod to the party, can you try and convince PHPStan that cloneValue actually returns correct results according to the generic types?

@simPod
Copy link
Collaborator

simPod commented Oct 27, 2021

I believe it's something that's missing on phpstan's side.

https://phpstan.org/r/f72cb47e-b951-40c2-a52f-8510c0170261

There's still a lot of work around generics there 🤷🏾‍♀️ baseline?

@spawnia
Copy link
Collaborator

spawnia commented Oct 27, 2021

Yeah. I am somewhat baffled by the error message in your example:

Function cloneValue() should return TCloneable of array|stdClass but returns TCloneable of stdClass.

Just from reading, it seems to me that PHPStan actually understood what is going on. However, it does not seem to recognize that TCloneable of stdClass is covariant to TCloneable of array<string>|stdClass.

Baseline it is then 👍

@spawnia spawnia changed the title Node::cloneDeep() will clone NodeList correctly. Clone NodeList in Node::cloneDeep() Oct 27, 2021
@spawnia spawnia merged commit 89263c5 into webonyx:master Oct 27, 2021
spawnia added a commit that referenced this pull request Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL\Language\AST\Node::cloneDeep() clones NodeList incorrectly

3 participants