Skip to content

Ci/phpstan#695

Open
nickvergessen wants to merge 5 commits into
masterfrom
ci/phpstan
Open

Ci/phpstan#695
nickvergessen wants to merge 5 commits into
masterfrom
ci/phpstan

Conversation

@nickvergessen
Copy link
Copy Markdown
Member

$ composer run phpstan -- --verbose
> vendor/bin/phpstan analyse -c phpstan.neon '--verbose'
 9/9 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%  1 sec

 ------ --------------------------------------------------------------------------------------------------------------------------------------- 
  Line   Controller/APIController.php                                                                                                           
 ------ --------------------------------------------------------------------------------------------------------------------------------------- 
  71     Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType,        
         list<array<string, int|true>> given.                                                                                                   
         🪪  argument.type                                                                                                                      
  78     Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType, array  
         given.                                                                                                                                 
         🪪  argument.type                                                                                                                      
  82     Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType, array  
         given.                                                                                                                                 
         🪪  argument.type                                                                                                                      
  98     Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType,        
         array<string, int|true> given.                                                                                                         
         🪪  argument.type                                                                                                                      
  121    Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType, array  
         given.                                                                                                                                 
         🪪  argument.type                                                                                                                      
  133    Parameter #1 $data of class OCP\AppFramework\Http\DataResponse constructor expects T of OCP\AppFramework\Http\DataResponseType, array  
         given.                                                                                                                                 
         🪪  argument.type                                                                                                                      
 ------ --------------------------------------------------------------------------------------------------------------------------------------- 


                                                                                                                        
 [ERROR] Found 6 errors                                                                                                 
                                                                                                                        

Elapsed time: 1 second
Used memory: 92 MB

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen self-assigned this May 15, 2026
@nickvergessen nickvergessen marked this pull request as ready for review May 15, 2026 13:04
@nickvergessen nickvergessen requested a review from samin-z as a code owner May 15, 2026 13:04
Comment on lines 69 to 82
@@ -75,6 +76,7 @@ public function testAddRetentionInvalidTimeUnit(): void {
}

public function testAddRetentionInvalidTimeAmount(): void {
$this->markTestSkipped('Test is no longer applicable as the Dispatcher is limiting values');
$response = $this->api->addRetention(42, 3, 128_000);
$this->assertSame(Http::STATUS_BAD_REQUEST, $response->getStatus());
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These can be removed now, right?

Comment on lines -157 to +147
* @return DataResponse<Http::STATUS_NO_CONTENT|Http::STATUS_NOT_FOUND, list<empty>, array{}>
* @return DataResponse<Http::STATUS_NO_CONTENT|Http::STATUS_NOT_FOUND, array{}, array{}>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should stay list<empty>

Comment on lines -89 to +92
* @param 0|1|2|3 $timeunit Time unit of the retention (days, weeks, months, years)
* @param int<0, 3> $timeunit Time unit of the retention (days, weeks, months, years)
* @psalm-param Constants::UNIT_* $timeunit
* @param positive-int $timeamount Amount of time units that have to be passed
* @param 0|1 $timeafter Whether retention time is based creation time (0) or modification time (1)
* @param int<1, 32000> $timeamount Amount of time units that have to be passed
* @param int<0, 1> $timeafter Whether retention time is based creation time (0) or modification time (1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not so happy about converting enums to ranges :/ This makes the specifications worse and clients that generate code from it, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants