Fix types hint in UserQuery.php (#5045)

* Fix types hint in UserQuery.php
In particular, we had a mix of strings and integers for the query state
Pass PHPStan level 9

* Unneeded null check
This commit is contained in:
Alexandre Alapetite
2023-01-28 13:37:09 +01:00
committed by GitHub
parent d8744a9ec1
commit e617830e96
2 changed files with 46 additions and 47 deletions

View File

@@ -74,8 +74,8 @@ class UserQueryTest extends PHPUnit\Framework\TestCase {
public function test__construct_whenUnknownQuery_doesStoreParameters() {
$query = array('get' => 'q');
$user_query = new FreshRSS_UserQuery($query);
$this->assertNull($user_query->getGetName());
$this->assertNull($user_query->getGetType());
$this->assertEmpty($user_query->getGetName());
$this->assertEmpty($user_query->getGetType());
}
public function test__construct_whenName_storesName() {
@@ -93,7 +93,7 @@ class UserQueryTest extends PHPUnit\Framework\TestCase {
}
public function test__construct_whenState_storesState() {
$state = 'some state';
$state = FreshRSS_Entry::STATE_ALL;
$query = array('state' => $state);
$user_query = new FreshRSS_UserQuery($query);
$this->assertEquals($state, $user_query->getState());
@@ -118,7 +118,7 @@ class UserQueryTest extends PHPUnit\Framework\TestCase {
'name' => 'some name',
'order' => 'some order',
'search' => 'some search',
'state' => 'some state',
'state' => FreshRSS_Entry::STATE_ALL,
'url' => 'some url',
);
$user_query = new FreshRSS_UserQuery($query);