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

Remove usages of deprecated TList types #15

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

danog
Copy link
Contributor

@danog danog commented Nov 27, 2023

No description provided.

@danog danog mentioned this pull request Nov 27, 2023
@danog
Copy link
Contributor Author

danog commented Nov 27, 2023

Btw @azjezz could you merge and tag a release? This is kind of breaking our end to end tests on Psalm :)

@veewee
Copy link
Collaborator

veewee commented Nov 27, 2023

Thanks for th PR.

I Just ran these changes against PSL 2.8 and got following errors:

ERROR: InvalidReturnType - ../src/Psl/Str/Byte/split.php:18:12 - The declared return type 'list<string>' for Psl\Str\Byte\split is incorrect, got 'list{0?: string, ...<string>}' (see https://psalm.dev/011)
 * @return list<string>


ERROR: InvalidReturnStatement - ../src/Psl/Str/Byte/split.php:26:20 - The inferred type 'list<string>' does not match the declared return type 'list<string>' for Psl\Str\Byte\split (see https://psalm.dev/128)
            return chunk($string);


ERROR: InvalidReturnType - ../src/Psl/Str/split.php:18:12 - The declared return type 'list<string>' for Psl\Str\split is incorrect, got 'list{0?: string, ...<string>}' (see https://psalm.dev/011)
 * @return list<string>


ERROR: InvalidReturnStatement - ../src/Psl/Str/split.php:26:20 - The inferred type 'list<string>' does not match the declared return type 'list<string>' for Psl\Str\split (see https://psalm.dev/128)
            return chunk($string, 1, $encoding);

Can you take a look at what is going wrong exactly?
The TList seems to be deprecated for a while now indeed. Do we need to bump the minimum version in composer.json or is this change cross version compatible?

It's currently at:

"vimeo/psalm": "^5.0"

FYI: I added a Github action to validate against PSL and rebased your branch. Now you get realtime feedback of what I am seeing ;)

@veewee veewee force-pushed the rm_tlist branch 2 times, most recently from 28c6047 to 582a832 Compare November 27, 2023 18:40
@danog
Copy link
Contributor Author

danog commented Nov 28, 2023

My bad @veewee, should be all fixed now!
Bumped psalm too, to avoid issues with bugs in old versions.

@veewee
Copy link
Collaborator

veewee commented Nov 28, 2023

That works better. Thanks!

@veewee veewee merged commit bf6d560 into php-standard-library:main Nov 28, 2023
3 checks passed
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.

None yet

2 participants