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 precise array_chunk signature #709

Merged
merged 2 commits into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/functionMap.php
Expand Up @@ -259,7 +259,7 @@
'AppendIterator::rewind' => ['void'],
'AppendIterator::valid' => ['bool'],
'array_change_key_case' => ['array', 'input'=>'array', 'case='=>'int'],
'array_chunk' => ['array[]', 'input'=>'array', 'size'=>'int', 'preserve_keys='=>'bool'],
'array_chunk' => ['array[]', 'input'=>'array', 'size'=>'positive-int', 'preserve_keys='=>'bool'],
'array_column' => ['array', 'array'=>'array', 'column_key'=>'mixed', 'index_key='=>'mixed'],
'array_combine' => ['array|false', 'keys'=>'array', 'values'=>'array'],
'array_count_values' => ['array<positive-int>', 'input'=>'array'],
Expand Down
4 changes: 3 additions & 1 deletion src/Parallel/Scheduler.php
Expand Up @@ -10,7 +10,9 @@

class Scheduler
{

/**
* @param positive-int $jobSize
*/
public function __construct(
private int $jobSize,
private int $maximumNumberOfProcesses,
Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Parallel/SchedulerTest.php
Expand Up @@ -72,6 +72,7 @@ public function dataSchedule(): array

/**
* @dataProvider dataSchedule
* @param positive-int $jobSize
* @param 0|positive-int $numberOfFiles
* @param array<int> $expectedJobSizes
*/
Expand Down