Skip to content

Commit

Permalink
More precise array_chunk signature
Browse files Browse the repository at this point in the history
fix Scheduler

fix cs

type __construct()

Update Scheduler.php

adjust test
  • Loading branch information
staabm authored and clxmstaab committed Jan 11, 2022
1 parent fb12769 commit c416825
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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
10 changes: 10 additions & 0 deletions src/Parallel/Scheduler.php
Expand Up @@ -11,6 +11,16 @@
class Scheduler
{

/** @var positive-int */
private int $jobSize;

private int $maximumNumberOfProcesses;

private int $minimumNumberOfJobsPerProcess;

/**
* @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

0 comments on commit c416825

Please sign in to comment.