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
Add stubs for ext-random (PHP 8.2) #8633
Conversation
…rrent`, `end` and `reset` Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
…s not return `null` Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
fix wrong php version id in $_FILES
Enhance type detection for internal php functions `key`, `current`, `end` and `reset`
…flection-stubs vimeo#7810/improve reflection stubs
…required-param-mismatch-missing-error ensure callbacks have the required number of params
|
||
define('MT_RAND_PHP', 1); | ||
|
||
namespace { |
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.
these functions and consts from above are existing ones (in PHP 8.1 and older) and moved to ext-random. Not sure what to do with stubs in this case
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.
Do we need those stubbed at all? Callmap should be enough for those. I skimmed the RFC, what I understood is that everything is in an extension but the extension is always installed and can't be disabled so it's basically part of the core.
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.
@orklah
this is a good question. ext-random should be a part of the code, but you can potentially recompile PHP without it (as far as I understand it in case of this ext). What do you need in such cases - just add to the Callmap?
|
||
public function getBytes(int $length): string {} | ||
|
||
public function shuffleArray(array $array): array {} |
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.
I would like to add more specific array info later as a separate PR (if it's possible)
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.
Fine by me :)
Add dictionary delta for PHP 8.2
Thanks for this! However, we kinda revamped our handling of extensions for Psalm 5. Would you mind targeting the master branch for this? It would be easier to merge later |
@orklah |
Allow to set PHP 8.2 version
Fix XMLReader::expand() nullable parameter $baseNode
First, simple version of functionality introduced or moved to
ext-random
.I'm new to make this sort of changes to Psalm and open for any suggestions (but prefer to spit changes into few PRs if it's possible).
At the first iteration it's almost a cope of https://github.com/php/php-src/blob/master/ext/random/random.stub.php