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

@@ -37,9 +37,9 @@ class DashboardSubscriberTest extends TestCase
$sut = $this->getSubscriber(false, 13, 28, 37, 5);
$event = new DashboardEvent(new User());
$this->assertEquals(0, count($event->getSections()));
$this->assertEquals(0, \count($event->getSections()));
$sut->onDashboardEvent($event);
$this->assertEquals(0, count($event->getSections()));
$this->assertEquals(0, \count($event->getSections()));
}
public function testWithAdminUser()
@@ -47,14 +47,14 @@ class DashboardSubscriberTest extends TestCase
$sut = $this->getSubscriber(true, 13, 28, 37, 5);
$event = new DashboardEvent(new User());
$this->assertEquals(0, count($event->getSections()));
$this->assertEquals(0, \count($event->getSections()));
$sut->onDashboardEvent($event);
$sections = $event->getSections();
$widgets = $sections[0]->getWidgets();
$this->assertEquals(1, count($sections));
$this->assertEquals(4, count($widgets));
$this->assertEquals(1, \count($sections));
$this->assertEquals(4, \count($widgets));
$this->assertEquals('stats.userTotal', $widgets[0]->getTitle());
$this->assertEquals(13, $widgets[0]->getData());