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 Dec 22, 2021
1 parent e9dd3a3 commit 6acbd35
Show file tree
Hide file tree
Showing 3 changed files with 6 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
4 changes: 4 additions & 0 deletions src/Parallel/Scheduler.php
Expand Up @@ -11,12 +11,16 @@
class Scheduler
{

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

private int $maximumNumberOfProcesses;

private int $minimumNumberOfJobsPerProcess;

/**
* @param positive-int $jobSize
*/
public function __construct(
int $jobSize,
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 6acbd35

Please sign in to comment.