Code improvements (#1649)
* use global namespace for faster lookups * phpstan level 5
This commit is contained in:
@@ -28,7 +28,7 @@ class ActivityControllerTest extends APIControllerBaseTest
|
||||
{
|
||||
use RateControllerTestTrait;
|
||||
|
||||
protected function getRateUrl(string $id = '1', ?string $rateId = null): string
|
||||
protected function getRateUrl($id = '1', $rateId = null): string
|
||||
{
|
||||
if (null !== $rateId) {
|
||||
return sprintf('/api/activities/%s/rates/%s', $id, $rateId);
|
||||
@@ -37,7 +37,7 @@ class ActivityControllerTest extends APIControllerBaseTest
|
||||
return sprintf('/api/activities/%s/rates', $id);
|
||||
}
|
||||
|
||||
protected function importTestRates(string $id): array
|
||||
protected function importTestRates($id): array
|
||||
{
|
||||
/** @var ActivityRateRepository $rateRepository */
|
||||
$rateRepository = $this->getEntityManager()->getRepository(ActivityRate::class);
|
||||
@@ -123,8 +123,8 @@ class ActivityControllerTest extends APIControllerBaseTest
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(count($expected), count($result));
|
||||
for ($i = 0; $i < count($result); $i++) {
|
||||
$this->assertEquals(\count($expected), \count($result));
|
||||
for ($i = 0; $i < \count($result); $i++) {
|
||||
$activity = $result[$i];
|
||||
$hasProject = $expected[$i][0];
|
||||
$this->assertStructure($activity, false);
|
||||
@@ -160,7 +160,7 @@ class ActivityControllerTest extends APIControllerBaseTest
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(5, count($result));
|
||||
$this->assertEquals(5, \count($result));
|
||||
$this->assertStructure($result[0], false);
|
||||
$this->assertEquals(1, $result[4]['project']);
|
||||
$this->assertEquals(2, $result[3]['project']);
|
||||
|
||||
Reference in New Issue
Block a user