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

More specific superglobals feedback update #8561

Merged
merged 7 commits into from Oct 10, 2022

Conversation

kkmuffme
Copy link
Contributor

Fix #8559
Fix #8556

I think the $_FILES superglobal type is correct now, but absolute crap due to #8516

Ideally we would have 4 distinct array types for it like:

array<never, never> (= array{})
|array{error: int<0, 8>, name: string, size: int<0, max>, tmp_name: string, type: string}
|array{error: non-empty-list<int<0, 8>>, name: non-empty-list<string>, size: non-empty-list<int<0, max>>, tmp_name: non-empty-list<string>, type: non-empty-list<string>}
|array<string, array{error: int<0, 8>, name: string, size: int<0, max>, tmp_name: string, type: string}>
|array<string, array{error: non-empty-list<int<0, 8>>, name: non-empty-list<string>, size: non-empty-list<int<0, max>>, tmp_name: non-empty-list<string>, type: non-empty-list<string>}>

Feel free to make any changes necessary before merging, I won't have time until next weekend though.

@kkmuffme kkmuffme marked this pull request as ready for review October 10, 2022 14:33
@@ -719,6 +723,9 @@ public static function getGlobalType(string $var_id, int $codebase_analysis_php_
'HTTP_SEC_CH_UA_PLATFORM' => $non_empty_string_helper,
'HTTP_SEC_CH_UA_MOBILE' => $non_empty_string_helper,
'HTTP_SEC_CH_UA' => $non_empty_string_helper,
// phpunit
'APP_DEBUG' => $bool_string_helper,
Copy link
Contributor

Choose a reason for hiding this comment

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

For the record

  • Phpunit cast 'false' and 'true' to a boolean.
  • Symfony support using APP_DEBUG=0 or APP_DEBUG=1 in the .env file.
    So the best way to represent this is bool|string and force people to cast to bool.

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Oct 10, 2022
@orklah orklah merged commit 99395bb into vimeo:4.x Oct 10, 2022
@orklah
Copy link
Collaborator

orklah commented Oct 10, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
3 participants