Code improvements (#1649)

* use global namespace for faster lookups
* phpstan level 5
This commit is contained in:
Kevin Papst
2020-04-19 14:37:14 +02:00
committed by GitHub
parent 7b25e9acaf
commit 0f3fa8fdbe
183 changed files with 604 additions and 574 deletions

View File

@@ -214,7 +214,7 @@ abstract class ControllerBaseTest extends WebTestCase
self::assertEquals($expectedUrl, $element->getAttribute('href'));
}
self::assertEquals(count($buttons), $node->count(), 'Invalid amount of page actions');
self::assertEquals(\count($buttons), $node->count(), 'Invalid amount of page actions');
}
/**
@@ -239,9 +239,9 @@ abstract class ControllerBaseTest extends WebTestCase
$validationErrors = $submittedForm->filter('li.text-danger');
self::assertEquals(
count($fieldNames),
count($validationErrors),
sprintf('Expected %s validation errors, found %s', count($fieldNames), count($validationErrors))
\count($fieldNames),
\count($validationErrors),
sprintf('Expected %s validation errors, found %s', \count($fieldNames), \count($validationErrors))
);
foreach ($fieldNames as $name) {
@@ -251,7 +251,7 @@ abstract class ControllerBaseTest extends WebTestCase
self::assertNotNull($list, 'Form field has no validation message: ' . $name);
$validation = $list->filter('li.text-danger');
if (count($validation) < 1) {
if (\count($validation) < 1) {
// decorated form fields with icon have a different html structure, see kimai-theme.html.twig
/** @var \DOMElement $listMsg */
$listMsg = $field->parents()->getNode(1);