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

@@ -46,11 +46,11 @@ class WidgetExtension extends AbstractExtension
*/
public function renderWidget($widget, array $options = [])
{
if (!($widget instanceof WidgetInterface) && !is_string($widget)) {
if (!($widget instanceof WidgetInterface) && !\is_string($widget)) {
throw new InvalidArgumentException('Widget must either implement WidgetInterface or be a string');
}
if (is_string($widget)) {
if (\is_string($widget)) {
if (!$this->service->hasWidget($widget)) {
throw new InvalidArgumentException(sprintf('Unknown widget "%s" requested', $widget));
}