From 4ea2a3e2affc8570f97587af4b173081e7be786a Mon Sep 17 00:00:00 2001 From: hslater Date: Mon, 27 Nov 2023 18:30:47 +1300 Subject: [PATCH] CS --- bootstrap.php | 2 +- composer.json | 14 ++++++--- includes/ServiceWiring.php | 22 +++++++------- src/AriaAttributesBuilder.php | 4 +-- src/Component/Badge.php | 6 ++-- src/Component/CallbackLiteral.php | 4 +-- src/Component/ComponentBase.php | 10 +++---- src/Component/Literal.php | 4 +-- src/Component/MessageLiteral.php | 4 +-- src/Component/NullComponent.php | 4 +-- src/Component/RestrictedTextLink.php | 22 +++++++------- src/Component/SimpleAccordion.php | 4 +-- src/Component/SimpleAccordionItem.php | 8 ++--- src/Component/SimpleBreadCrumb.php | 6 ++-- src/Component/SimpleButton.php | 10 +++---- src/Component/SimpleButtonGroup.php | 10 +++---- src/Component/SimpleCard.php | 6 ++-- src/Component/SimpleCardBody.php | 6 ++-- src/Component/SimpleCardFooter.php | 6 ++-- src/Component/SimpleCardHeader.php | 6 ++-- src/Component/SimpleCardImage.php | 10 +++---- src/Component/SimpleCardLink.php | 18 +++++------ src/Component/SimpleCardSubTitle.php | 6 ++-- src/Component/SimpleCardText.php | 6 ++-- src/Component/SimpleCardTitle.php | 6 ++-- src/Component/SimpleCollapsibleCard.php | 18 +++++------ src/Component/SimpleDropdown.php | 16 +++++----- src/Component/SimpleDropdownButton.php | 18 +++++------ src/Component/SimpleDropdownIcon.php | 18 +++++------ .../SimpleDropdownIconSplitButton.php | 30 +++++++++---------- src/Component/SimpleDropdownItemlist.php | 6 ++-- .../SimpleDropdownItemlistFromArray.php | 8 ++--- src/Component/SimpleDropdownItemlistItem.php | 6 ++-- src/Component/SimpleDropdownSplitButton.php | 28 ++++++++--------- src/Component/SimpleDropdownSplitLink.php | 30 +++++++++---------- src/Component/SimpleLink.php | 20 ++++++------- src/Component/SimpleLinklistGroup.php | 8 ++--- .../SimpleLinklistGroupFromArray.php | 10 +++---- src/Component/SimpleLinklistGroupItem.php | 6 ++-- src/Component/SimpleMediaObject.php | 12 ++++---- src/Component/SimplePanel.php | 6 ++-- src/Component/SimpleSeparator.php | 6 ++-- src/Component/SimpleTextLink.php | 20 ++++++------- src/Component/SimpleTreeLinkNode.php | 2 +- src/Component/SimpleTreeTextNode.php | 2 +- src/ComponentFilterFactory.php | 2 ++ src/ComponentManager.php | 6 ++-- src/ComponentRendererFactory.php | 6 ++-- src/DataAttributesBuilder.php | 4 +-- src/GenericComponentRenderer.php | 2 +- src/GenericSkinSlotRenderer.php | 2 +- ...takeCommonUIRegisterSkinSlotComponents.php | 4 +-- src/HtmlIdRegistry.php | 6 ++-- src/IAccordion.php | 2 +- src/IAccordionItem.php | 4 +-- src/IBadge.php | 4 +-- src/IBreadCrumb.php | 4 +-- src/IButton.php | 8 ++--- src/IButtonGroup.php | 6 ++-- src/ICard.php | 2 +- src/ICardBody.php | 2 +- src/ICardFooter.php | 2 +- src/ICardHeader.php | 2 +- src/ICardImage.php | 8 ++--- src/ICardLink.php | 16 +++++----- src/ICardSubTitle.php | 2 +- src/ICardText.php | 2 +- src/ICardTitle.php | 2 +- src/ICollapsibleCard.php | 14 ++++----- src/IComponent.php | 14 ++++----- src/IComponentFilter.php | 2 +- src/IComponentRenderer.php | 12 ++++---- src/IContainer.php | 2 +- src/IDropdown.php | 12 ++++---- src/IDropdownButton.php | 14 ++++----- src/IDropdownIcon.php | 14 ++++----- src/IDropdownIconSplitButton.php | 26 ++++++++-------- src/IDropdownItemlist.php | 2 +- src/IDropdownItemlistFromArray.php | 4 +-- src/IDropdownItemlistItem.php | 2 +- src/IDropdownSplitButton.php | 24 +++++++-------- src/IDropdownSplitLink.php | 26 ++++++++-------- src/ILink.php | 16 +++++----- src/ILinklistGroup.php | 4 +-- src/ILinklistGroupFromArray.php | 6 ++-- src/ILinklistGroupItem.php | 2 +- src/ILiteral.php | 2 +- src/IMediaObject.php | 10 +++---- src/IMessageLiteral.php | 2 +- src/IRenderer.php | 14 ++++----- src/IRestrictedComponent.php | 2 +- src/ISeparator.php | 2 +- src/ISkinSlotRegistry.php | 2 +- src/ISkinSlotRenderer.php | 2 +- src/ITabPanel.php | 20 ++++++------- src/ITextLink.php | 18 +++++------ src/ITreeNode.php | 2 +- src/LessVars.php | 2 ++ src/LinkFormatter.php | 6 ++-- src/Renderer/Accordion.php | 6 ++-- src/Renderer/Badge.php | 6 ++-- src/Renderer/Button.php | 6 ++-- src/Renderer/ButtonGroup.php | 6 ++-- src/Renderer/Card.php | 4 +-- src/Renderer/CardBody.php | 4 +-- src/Renderer/CardFooter.php | 4 +-- src/Renderer/CardHeader.php | 4 +-- src/Renderer/CardImage.php | 4 +-- src/Renderer/CardLink.php | 6 ++-- src/Renderer/CardSubTitle.php | 4 +-- src/Renderer/CardText.php | 4 +-- src/Renderer/CardTitle.php | 4 +-- src/Renderer/CollapsibleCard.php | 4 +-- src/Renderer/Container.php | 4 +-- src/Renderer/Dropdown.php | 6 ++-- src/Renderer/DropdownButton.php | 6 ++-- src/Renderer/DropdownIcon.php | 6 ++-- src/Renderer/DropdownIconSplitButton.php | 6 ++-- src/Renderer/DropdownItemlist.php | 6 ++-- src/Renderer/DropdownItemlistFromArray.php | 6 ++-- src/Renderer/DropdownItemlistItem.php | 6 ++-- src/Renderer/DropdownSplitButton.php | 6 ++-- src/Renderer/DropdownSplitLink.php | 6 ++-- src/Renderer/Link.php | 6 ++-- src/Renderer/LinklistGroup.php | 6 ++-- src/Renderer/LinklistGroupFromArray.php | 6 ++-- src/Renderer/LinklistGroupItem.php | 6 ++-- src/Renderer/Literal.php | 6 ++-- src/Renderer/MediaObject.php | 4 +-- src/Renderer/MessageLiteral.php | 6 ++-- src/Renderer/RendererBase.php | 6 ++-- src/Renderer/Separator.php | 6 ++-- src/Renderer/TextLink.php | 6 ++-- src/Renderer/TreeContainer.php | 4 +-- src/Renderer/TreeLinkNode.php | 4 +-- src/Renderer/TreeTextNode.php | 4 +-- src/SkinSlotRegistry.php | 6 ++-- src/SkinSlotRendererFactory.php | 2 +- tests/phpunit/ComponentManagerTest.php | 10 +++---- 139 files changed, 537 insertions(+), 527 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index b91f224..731d6f3 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -11,7 +11,7 @@ define( 'MWSTAKE_MEDIAWIKI_COMPONENT_COMMONUSERINTERFACE_VERSION', '3.2.4' ); MWStake\MediaWiki\ComponentLoader\Bootstrapper::getInstance() -->register( 'commonuserinterface', function () { +->register( 'commonuserinterface', static function () { $lessVars = \MWStake\MediaWiki\Component\CommonUserInterface\LessVars::getInstance(); // Provide the list of values diff --git a/composer.json b/composer.json index b858721..b6e88b0 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,14 @@ } ], "require": { + "composer/installers": "~1.0|~2", "mwstake/mediawiki-componentloader": "~1" }, "require-dev": { - "jakub-onderka/php-parallel-lint": "1.0.0", - "jakub-onderka/php-console-highlighter": "0.4.0", - "mediawiki/mediawiki-codesniffer": "29.0.0", - "mediawiki/minus-x": "1.0.0", + "mediawiki/mediawiki-codesniffer": "39.0.0", + "mediawiki/minus-x": "1.1.1", + "php-parallel-lint/php-console-highlighter": "1.0.0", + "php-parallel-lint/php-parallel-lint": "1.3.2", "phpunit/phpunit": "^8.5" }, "autoload": { @@ -41,5 +42,10 @@ "minus-x fix .", "phpcbf" ] + }, + "config": { + "allow-plugins": { + "composer/installers": true + } } } diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 9434d2c..5c68548 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -14,14 +14,14 @@ use MWStake\MediaWiki\Component\CommonUserInterface\TreeDataGenerator; return [ - 'MWStakeCommonUISkinSlotRendererFactory' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUISkinSlotRendererFactory' => static function ( MediaWikiServices $services ) { return new SkinSlotRendererFactory( $GLOBALS['mwsgCommonUISkinSlotRenderers'], $services->getObjectFactory() ); }, - 'MWStakeCommonUIComponentManager' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIComponentManager' => static function ( MediaWikiServices $services ) { $componentManager = ComponentManager::singleton( RequestContext::getMain(), $GLOBALS['mwsgCommonUISkinSlots'], @@ -34,7 +34,7 @@ return $componentManager; }, - 'MWStakeCommonUIComponentRendererFactory' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIComponentRendererFactory' => static function ( MediaWikiServices $services ) { return new ComponentRendererFactory( $GLOBALS['mwsgCommonUIComponentRendererRegistry'], $GLOBALS['mwsgCommonUIComponentRegistry'], @@ -43,24 +43,24 @@ ); }, - 'MWStakeCommonUIRendererDataTreeBuilder' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIRendererDataTreeBuilder' => static function ( MediaWikiServices $services ) { return new RendererDataTreeBuilder( $services->getService( 'MWStakeCommonUIComponentRendererFactory' ) ); }, - 'MWStakeCommonUIRendererDataTreeRenderer' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIRendererDataTreeRenderer' => static function ( MediaWikiServices $services ) { return new RendererDataTreeRenderer( $services->getService( 'MWStakeCommonUIComponentRendererFactory' ) ); }, - 'MWStakeCommonUIHtmlIdRegistry' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIHtmlIdRegistry' => static function ( MediaWikiServices $services ) { $registry = HtmlIdRegistry::singleton(); return $registry; }, - 'MWStakeCommonUIGenericComponentRenderer' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIGenericComponentRenderer' => static function ( MediaWikiServices $services ) { $renderer = new GenericComponentRenderer( $services->get( 'MWStakeCommonUIComponentManager' ), $services->get( 'MWStakeCommonUIRendererDataTreeBuilder' ), @@ -69,14 +69,14 @@ return $renderer; }, - 'MWStakeSkinSlotRegistry' => function ( MediaWikiServices $services ) { + 'MWStakeSkinSlotRegistry' => static function ( MediaWikiServices $services ) { $skinSlotRegistry = SkinSlotRegistry::singleton( $GLOBALS['mwsgCommonUISkinSlots'] ); return $skinSlotRegistry; }, - 'MWStakeLinkFormatter' => function ( MediaWikiServices $services ) { + 'MWStakeLinkFormatter' => static function ( MediaWikiServices $services ) { $linkFormatter = new LinkFormatter( $services->getMainConfig()->get( 'ExternalLinkTarget' ), $services->getMainConfig()->get( 'NoFollowLinks' ) @@ -84,14 +84,14 @@ return $linkFormatter; }, - 'MWStakeCommonUITreeDataGenerator' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUITreeDataGenerator' => static function ( MediaWikiServices $services ) { return new TreeDataGenerator( $GLOBALS['mwsgCommonUIComponentTreeNodeRegistry'], $services->getObjectFactory() ); }, - 'MWStakeCommonUIComponentFilterFactory' => function ( MediaWikiServices $services ) { + 'MWStakeCommonUIComponentFilterFactory' => static function ( MediaWikiServices $services ) { return new ComponentFilterFactory( $GLOBALS['mwsgCommonUIComponentFilters'], $services->getObjectFactory() diff --git a/src/AriaAttributesBuilder.php b/src/AriaAttributesBuilder.php index 8cfb616..f31c4c0 100644 --- a/src/AriaAttributesBuilder.php +++ b/src/AriaAttributesBuilder.php @@ -17,7 +17,7 @@ public static function factory() { * @param array $data * @return array */ - public function build( $data ) : array { + public function build( $data ): array { $attribs = []; foreach ( $data as $key => $value ) { @@ -35,7 +35,7 @@ public function build( $data ) : array { * @param array $data * @return string */ - public function toString( $data ) : string { + public function toString( $data ): string { $attribs = $this->build( $data ); return implode( ' ', $attribs ); diff --git a/src/Component/Badge.php b/src/Component/Badge.php index 3170124..5cde88d 100644 --- a/src/Component/Badge.php +++ b/src/Component/Badge.php @@ -26,21 +26,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } } diff --git a/src/Component/CallbackLiteral.php b/src/Component/CallbackLiteral.php index a85e518..bd7b729 100644 --- a/src/Component/CallbackLiteral.php +++ b/src/Component/CallbackLiteral.php @@ -31,7 +31,7 @@ public function __construct( $id, $callback ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->id; } @@ -40,7 +40,7 @@ public function getId() : string { * * @return string */ - public function getHtml() : string { + public function getHtml(): string { return call_user_func_array( $this->callback, [ $this->componentProcessData ] ); } } diff --git a/src/Component/ComponentBase.php b/src/Component/ComponentBase.php index 476d0db..9c7c4b2 100644 --- a/src/Component/ComponentBase.php +++ b/src/Component/ComponentBase.php @@ -17,7 +17,7 @@ abstract class ComponentBase implements IComponent { * * @inheritDoc */ - public function getRequiredRLModules() : array { + public function getRequiredRLModules(): array { return []; } @@ -25,7 +25,7 @@ public function getRequiredRLModules() : array { * * @inheritDoc */ - public function getRequiredRLStyles() : array { + public function getRequiredRLStyles(): array { return []; } @@ -33,7 +33,7 @@ public function getRequiredRLStyles() : array { * * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return []; } @@ -41,7 +41,7 @@ public function getSubComponents() : array { * * @inheritDoc */ - public function shouldRender( IContextSource $context ) : bool { + public function shouldRender( IContextSource $context ): bool { return true; } @@ -51,7 +51,7 @@ public function shouldRender( IContextSource $context ) : bool { * Usually this is SkinTemplate's `$tpl->data` * @return void */ - public function setComponentData( $data ) : void { + public function setComponentData( $data ): void { $this->componentProcessData = $data; } } diff --git a/src/Component/Literal.php b/src/Component/Literal.php index dcc2456..008f2d4 100644 --- a/src/Component/Literal.php +++ b/src/Component/Literal.php @@ -31,7 +31,7 @@ public function __construct( $id, $html ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->id; } @@ -40,7 +40,7 @@ public function getId() : string { * * @return string */ - public function getHtml() : string { + public function getHtml(): string { return $this->html; } } diff --git a/src/Component/MessageLiteral.php b/src/Component/MessageLiteral.php index b16f202..d433e2c 100644 --- a/src/Component/MessageLiteral.php +++ b/src/Component/MessageLiteral.php @@ -32,7 +32,7 @@ public function __construct( $id, $msg ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->id; } @@ -40,7 +40,7 @@ public function getId() : string { * * @return Message */ - public function getText() : Message { + public function getText(): Message { return $this->msg; } } diff --git a/src/Component/NullComponent.php b/src/Component/NullComponent.php index 0eab461..c0880a2 100644 --- a/src/Component/NullComponent.php +++ b/src/Component/NullComponent.php @@ -23,7 +23,7 @@ public function __construct( $id = 'null-component' ) { /** * @return string */ - public function getId() : string { + public function getId(): string { return $this->id; } @@ -31,7 +31,7 @@ public function getId() : string { * @param IContextSource $context * @return bool */ - public function shouldRender( IContextSource $context ) : bool { + public function shouldRender( IContextSource $context ): bool { return false; } } diff --git a/src/Component/RestrictedTextLink.php b/src/Component/RestrictedTextLink.php index 2335640..c0e9a5c 100644 --- a/src/Component/RestrictedTextLink.php +++ b/src/Component/RestrictedTextLink.php @@ -35,70 +35,70 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getRole() : string { + public function getRole(): string { return $this->options['role']; } /** * @inheritDoc */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @inheritDoc */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @inheritDoc */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } /** * @inheritDoc */ - public function getDataAttributes() : array { + public function getDataAttributes(): array { return $this->options['data']; } /** * @inheritDoc */ - public function getAriaAttributes() : array { + public function getAriaAttributes(): array { return $this->options['aria']; } /** * @inheritDoc */ - public function getHref() : string { + public function getHref(): string { return $this->options['href']; } /** * @inheritDoc */ - public function getRel() : string { + public function getRel(): string { return $this->options['rel']; } @@ -106,7 +106,7 @@ public function getRel() : string { * * @return array */ - public function getPermissions() : array { + public function getPermissions(): array { return $this->options['permissions']; } } diff --git a/src/Component/SimpleAccordion.php b/src/Component/SimpleAccordion.php index d3c0592..977fd4a 100644 --- a/src/Component/SimpleAccordion.php +++ b/src/Component/SimpleAccordion.php @@ -25,14 +25,14 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleAccordionItem.php b/src/Component/SimpleAccordionItem.php index 8486f37..9dd66c1 100644 --- a/src/Component/SimpleAccordionItem.php +++ b/src/Component/SimpleAccordionItem.php @@ -29,7 +29,7 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -37,21 +37,21 @@ public function getId() : string { * * @return Message */ - public function getHeaderText() : Message { + public function getHeaderText(): Message { return $this->options['header-text']; } /** * @return Message */ - public function getTooltip() : Message { + public function getTooltip(): Message { return $this->options['tooltip']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleBreadCrumb.php b/src/Component/SimpleBreadCrumb.php index 9714895..1613168 100644 --- a/src/Component/SimpleBreadCrumb.php +++ b/src/Component/SimpleBreadCrumb.php @@ -25,21 +25,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } } diff --git a/src/Component/SimpleButton.php b/src/Component/SimpleButton.php index 67c0a4a..85f236e 100644 --- a/src/Component/SimpleButton.php +++ b/src/Component/SimpleButton.php @@ -31,7 +31,7 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -39,21 +39,21 @@ public function getId() : string { * * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } /** * @return Message */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } @@ -61,7 +61,7 @@ public function getClasses() : array { * * @return bool */ - public function isDisabled() : bool { + public function isDisabled(): bool { return $this->options['disabled']; } } diff --git a/src/Component/SimpleButtonGroup.php b/src/Component/SimpleButtonGroup.php index 1265353..1ce2d6e 100644 --- a/src/Component/SimpleButtonGroup.php +++ b/src/Component/SimpleButtonGroup.php @@ -26,35 +26,35 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getRole() : string { + public function getRole(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } } diff --git a/src/Component/SimpleCard.php b/src/Component/SimpleCard.php index 4226b36..83475c5 100644 --- a/src/Component/SimpleCard.php +++ b/src/Component/SimpleCard.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardBody.php b/src/Component/SimpleCardBody.php index 3ad44a1..3b58597 100644 --- a/src/Component/SimpleCardBody.php +++ b/src/Component/SimpleCardBody.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardFooter.php b/src/Component/SimpleCardFooter.php index d8be1ae..d0e60d4 100644 --- a/src/Component/SimpleCardFooter.php +++ b/src/Component/SimpleCardFooter.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardHeader.php b/src/Component/SimpleCardHeader.php index 1525c81..a69e66a 100644 --- a/src/Component/SimpleCardHeader.php +++ b/src/Component/SimpleCardHeader.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardImage.php b/src/Component/SimpleCardImage.php index bd2c20e..024e5b4 100644 --- a/src/Component/SimpleCardImage.php +++ b/src/Component/SimpleCardImage.php @@ -34,35 +34,35 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getImageType() : string { + public function getImageType(): string { return $this->options['type']; } /** * @inheritDoc */ - public function getImageSrc() : string { + public function getImageSrc(): string { return $this->options['src']; } /** * @inheritDoc */ - public function getImageAltText() : Message { + public function getImageAltText(): Message { return $this->options['alt']; } } diff --git a/src/Component/SimpleCardLink.php b/src/Component/SimpleCardLink.php index a5ecdd6..f105193 100644 --- a/src/Component/SimpleCardLink.php +++ b/src/Component/SimpleCardLink.php @@ -37,63 +37,63 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getRole() : string { + public function getRole(): string { return $this->options['role']; } /** * @inheritDoc */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @inheritDoc */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @inheritDoc */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } /** * @inheritDoc */ - public function getDataAttributes() : array { + public function getDataAttributes(): array { return $this->options['data']; } /** * @inheritDoc */ - public function getHref() : string { + public function getHref(): string { return $this->options['href']; } /** * @inheritDoc */ - public function getRel() : string { + public function getRel(): string { return $this->options['rel']; } } diff --git a/src/Component/SimpleCardSubTitle.php b/src/Component/SimpleCardSubTitle.php index 66d1971..5c3fa02 100644 --- a/src/Component/SimpleCardSubTitle.php +++ b/src/Component/SimpleCardSubTitle.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardText.php b/src/Component/SimpleCardText.php index 5f47532..3afb5fd 100644 --- a/src/Component/SimpleCardText.php +++ b/src/Component/SimpleCardText.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCardTitle.php b/src/Component/SimpleCardTitle.php index 0646c0c..9e49a47 100644 --- a/src/Component/SimpleCardTitle.php +++ b/src/Component/SimpleCardTitle.php @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleCollapsibleCard.php b/src/Component/SimpleCollapsibleCard.php index 6baf4ed..70d1a57 100644 --- a/src/Component/SimpleCollapsibleCard.php +++ b/src/Component/SimpleCollapsibleCard.php @@ -38,21 +38,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } @@ -60,42 +60,42 @@ public function getSubComponents() : array { * * @return bool */ - public function getExpandedState() : bool { + public function getExpandedState(): bool { return $this->options['expanded']; } /** * @return string[] */ - public function getHeaderClasses() : array { + public function getHeaderClasses(): array { return $this->options['header-classes']; } /** * @return string[] */ - public function getBodyClasses() : array { + public function getBodyClasses(): array { return $this->options['body-classes']; } /** * @return Message */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @return Message */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } diff --git a/src/Component/SimpleDropdown.php b/src/Component/SimpleDropdown.php index dd9d68e..017c5f5 100644 --- a/src/Component/SimpleDropdown.php +++ b/src/Component/SimpleDropdown.php @@ -30,56 +30,56 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return Message */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @return Message */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } } diff --git a/src/Component/SimpleDropdownButton.php b/src/Component/SimpleDropdownButton.php index e0c0416..69ee461 100644 --- a/src/Component/SimpleDropdownButton.php +++ b/src/Component/SimpleDropdownButton.php @@ -31,56 +31,56 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return Message */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @return Message */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } @@ -88,7 +88,7 @@ public function getAriaLabel() : Message { * * @return bool */ - public function isDisabled() : bool { + public function isDisabled(): bool { return $this->options['disabled']; } } diff --git a/src/Component/SimpleDropdownIcon.php b/src/Component/SimpleDropdownIcon.php index aaeafc1..38573f6 100644 --- a/src/Component/SimpleDropdownIcon.php +++ b/src/Component/SimpleDropdownIcon.php @@ -32,56 +32,56 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return array */ - public function getIconClasses() : array { + public function getIconClasses(): array { return $this->options['icon-classes']; } /** * @return Message */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @return Message */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } @@ -89,7 +89,7 @@ public function getAriaLabel() : Message { * * @return string */ - public function getTabindex() : string { + public function getTabindex(): string { return $this->options['tabindex']; } } diff --git a/src/Component/SimpleDropdownIconSplitButton.php b/src/Component/SimpleDropdownIconSplitButton.php index e8f3109..621bd47 100644 --- a/src/Component/SimpleDropdownIconSplitButton.php +++ b/src/Component/SimpleDropdownIconSplitButton.php @@ -38,91 +38,91 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @return string */ - public function getHref() : string { + public function getHref(): string { return $this->options['button-href']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonGroupClasses() : array { + public function getButtonGroupClasses(): array { return $this->options['button-group-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getSplitButtonClasses() : array { + public function getSplitButtonClasses(): array { return $this->options['split-button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return Message */ - public function getIconClasses() : array { + public function getIconClasses(): array { return $this->options['icon-classes']; } /** * @return Message */ - public function getButtonTitle() : Message { + public function getButtonTitle(): Message { return $this->options['button-title']; } /** * @return Message */ - public function getSplitButtonTitle() : Message { + public function getSplitButtonTitle(): Message { return $this->options['split-button-title']; } /** * @return Message */ - public function getButtonAriaLabel() : Message { + public function getButtonAriaLabel(): Message { return $this->options['button-aria-label']; } /** * @return Message */ - public function getSplitButtonAriaLabel() : Message { + public function getSplitButtonAriaLabel(): Message { return $this->options['split-button-aria-label']; } @@ -130,7 +130,7 @@ public function getSplitButtonAriaLabel() : Message { * * @return bool */ - public function buttonIsDisabled() : bool { + public function buttonIsDisabled(): bool { return $this->options['button-disabled']; } @@ -138,7 +138,7 @@ public function buttonIsDisabled() : bool { * * @return bool */ - public function splitButtonIsDisabled() : bool { + public function splitButtonIsDisabled(): bool { return $this->options['split-button-disabled']; } } diff --git a/src/Component/SimpleDropdownItemlist.php b/src/Component/SimpleDropdownItemlist.php index 96b46c8..261b1a3 100644 --- a/src/Component/SimpleDropdownItemlist.php +++ b/src/Component/SimpleDropdownItemlist.php @@ -8,7 +8,7 @@ class SimpleDropdownItemlist extends ComponentBase implements IDropdownItemlist /** * - * @var array $options + * @var array */ private $options = []; @@ -29,7 +29,7 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -37,7 +37,7 @@ public function getId() : string { * * @return string[] */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } } diff --git a/src/Component/SimpleDropdownItemlistFromArray.php b/src/Component/SimpleDropdownItemlistFromArray.php index a471132..1763f8f 100644 --- a/src/Component/SimpleDropdownItemlistFromArray.php +++ b/src/Component/SimpleDropdownItemlistFromArray.php @@ -8,7 +8,7 @@ class SimpleDropdownItemlistFromArray extends ComponentBase implements IDropdown /** * - * @var array $options + * @var array */ private $options = []; @@ -29,14 +29,14 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getLinks() : array { + public function getLinks(): array { return $this->options['links']; } /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -44,7 +44,7 @@ public function getId() : string { * * @return string[] */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } } diff --git a/src/Component/SimpleDropdownItemlistItem.php b/src/Component/SimpleDropdownItemlistItem.php index 3f1f1ea..ebc52f1 100644 --- a/src/Component/SimpleDropdownItemlistItem.php +++ b/src/Component/SimpleDropdownItemlistItem.php @@ -8,7 +8,7 @@ class SimpleDropdownItemlistItem extends ComponentBase implements IDropdownIteml /** * - * @var array $options + * @var array */ private $options = []; @@ -29,7 +29,7 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -37,7 +37,7 @@ public function getId() : string { * * @return string[] */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } } diff --git a/src/Component/SimpleDropdownSplitButton.php b/src/Component/SimpleDropdownSplitButton.php index 36d4be2..177d054 100644 --- a/src/Component/SimpleDropdownSplitButton.php +++ b/src/Component/SimpleDropdownSplitButton.php @@ -37,84 +37,84 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonGroupClasses() : array { + public function getButtonGroupClasses(): array { return $this->options['button-group-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getSplitButtonClasses() : array { + public function getSplitButtonClasses(): array { return $this->options['split-button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return Message */ - public function getButtonText() : Message { + public function getButtonText(): Message { return $this->options['button-text']; } /** * @return Message */ - public function getButtonTitle() : Message { + public function getButtonTitle(): Message { return $this->options['button-title']; } /** * @return Message */ - public function getSplitButtonTitle() : Message { + public function getSplitButtonTitle(): Message { return $this->options['split-button-title']; } /** * @return Message */ - public function getButtonAriaLabel() : Message { + public function getButtonAriaLabel(): Message { return $this->options['button-aria-label']; } /** * @return Message */ - public function getSplitButtonAriaLabel() : Message { + public function getSplitButtonAriaLabel(): Message { return $this->options['split-button-aria-label']; } @@ -122,7 +122,7 @@ public function getSplitButtonAriaLabel() : Message { * * @return bool */ - public function buttonIsDisabled() : bool { + public function buttonIsDisabled(): bool { return $this->options['button-disabled']; } @@ -130,7 +130,7 @@ public function buttonIsDisabled() : bool { * * @return bool */ - public function splitButtonIsDisabled() : bool { + public function splitButtonIsDisabled(): bool { return $this->options['split-button-disabled']; } } diff --git a/src/Component/SimpleDropdownSplitLink.php b/src/Component/SimpleDropdownSplitLink.php index ba77275..204b300 100644 --- a/src/Component/SimpleDropdownSplitLink.php +++ b/src/Component/SimpleDropdownSplitLink.php @@ -38,91 +38,91 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @return array */ - public function getButtonGroupClasses() : array { + public function getButtonGroupClasses(): array { return $this->options['button-group-classes']; } /** * @return array */ - public function getButtonClasses() : array { + public function getButtonClasses(): array { return $this->options['button-classes']; } /** * @return array */ - public function getSplitButtonClasses() : array { + public function getSplitButtonClasses(): array { return $this->options['split-button-classes']; } /** * @return array */ - public function getMenuClasses() : array { + public function getMenuClasses(): array { return $this->options['menu-classes']; } /** * @return Message */ - public function getButtonText() : Message { + public function getButtonText(): Message { return $this->options['button-text']; } /** * @return Message */ - public function getButtonTitle() : Message { + public function getButtonTitle(): Message { return $this->options['button-title']; } /** * @return string */ - public function getButtonHref() : string { + public function getButtonHref(): string { return $this->options['button-href']; } /** * @return Message */ - public function getSplitButtonTitle() : Message { + public function getSplitButtonTitle(): Message { return $this->options['split-button-title']; } /** * @return Message */ - public function getButtonAriaLabel() : Message { + public function getButtonAriaLabel(): Message { return $this->options['button-aria-label']; } /** * @return Message */ - public function getSplitButtonAriaLabel() : Message { + public function getSplitButtonAriaLabel(): Message { return $this->options['split-button-aria-label']; } @@ -130,7 +130,7 @@ public function getSplitButtonAriaLabel() : Message { * * @return bool */ - public function buttonIsDisabled() : bool { + public function buttonIsDisabled(): bool { return $this->options['button-disabled']; } @@ -138,7 +138,7 @@ public function buttonIsDisabled() : bool { * * @return bool */ - public function splitButtonIsDisabled() : bool { + public function splitButtonIsDisabled(): bool { return $this->options['split-button-disabled']; } } diff --git a/src/Component/SimpleLink.php b/src/Component/SimpleLink.php index 92fa54f..74804bf 100644 --- a/src/Component/SimpleLink.php +++ b/src/Component/SimpleLink.php @@ -33,70 +33,70 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getRole() : string { + public function getRole(): string { return $this->options['role']; } /** * @inheritDoc */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @inheritDoc */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } /** * @inheritDoc */ - public function getDataAttributes() : array { + public function getDataAttributes(): array { return $this->options['data']; } /** * @inheritDoc */ - public function getAriaAttributes() : array { + public function getAriaAttributes(): array { return $this->options['aria']; } /** * @inheritDoc */ - public function getHref() : string { + public function getHref(): string { return $this->options['href']; } /** * @inheritDoc */ - public function getRel() : string { + public function getRel(): string { return $this->options['rel']; } } diff --git a/src/Component/SimpleLinklistGroup.php b/src/Component/SimpleLinklistGroup.php index 50b7bfa..25c96f5 100644 --- a/src/Component/SimpleLinklistGroup.php +++ b/src/Component/SimpleLinklistGroup.php @@ -8,7 +8,7 @@ class SimpleLinklistGroup extends ComponentBase implements ILinklistGroup { /** * - * @var array $options + * @var array */ private $options = []; @@ -30,21 +30,21 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getAriaAttributes() : array { + public function getAriaAttributes(): array { return $this->options['aria']; } } diff --git a/src/Component/SimpleLinklistGroupFromArray.php b/src/Component/SimpleLinklistGroupFromArray.php index 3dfbfdf..b7ba3c3 100644 --- a/src/Component/SimpleLinklistGroupFromArray.php +++ b/src/Component/SimpleLinklistGroupFromArray.php @@ -8,7 +8,7 @@ class SimpleLinklistGroupFromArray extends ComponentBase implements ILinklistGro /** * - * @var array $options + * @var array */ private $options = []; @@ -30,28 +30,28 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getLinks() : array { + public function getLinks(): array { return $this->options['links']; } /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @return array */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getAriaAttributes() : array { + public function getAriaAttributes(): array { return $this->options['aria']; } } diff --git a/src/Component/SimpleLinklistGroupItem.php b/src/Component/SimpleLinklistGroupItem.php index 3bf1873..926851f 100644 --- a/src/Component/SimpleLinklistGroupItem.php +++ b/src/Component/SimpleLinklistGroupItem.php @@ -8,7 +8,7 @@ class SimpleLinklistGroupItem extends ComponentBase implements ILinklistGroupIte /** * - * @var array $options + * @var array */ private $options = []; @@ -29,14 +29,14 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @return array */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } } diff --git a/src/Component/SimpleMediaObject.php b/src/Component/SimpleMediaObject.php index 59cc7a8..44b9402 100644 --- a/src/Component/SimpleMediaObject.php +++ b/src/Component/SimpleMediaObject.php @@ -35,42 +35,42 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } /** * @inheritDoc */ - public function getImageClasses() : array { + public function getImageClasses(): array { return $this->options['image-classes']; } /** * @inheritDoc */ - public function getBodyClasses() : array { + public function getBodyClasses(): array { return $this->options['body-classes']; } /** * @inheritDoc */ - public function getImageSrc() : string { + public function getImageSrc(): string { return $this->options['src']; } /** * @inheritDoc */ - public function getImageAltText() : Message { + public function getImageAltText(): Message { return $this->options['alt']; } } diff --git a/src/Component/SimplePanel.php b/src/Component/SimplePanel.php index 0974c85..83d00a9 100644 --- a/src/Component/SimplePanel.php +++ b/src/Component/SimplePanel.php @@ -37,7 +37,7 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } @@ -86,7 +86,7 @@ public function getTriggerCallbackFunctionName() { /** * @return string[] */ - public function getContainerClasses() : array { + public function getContainerClasses(): array { return $this->options['container-classes']; } @@ -108,7 +108,7 @@ public function getExpandedState() { /** * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } } diff --git a/src/Component/SimpleSeparator.php b/src/Component/SimpleSeparator.php index 0789c1f..5323119 100644 --- a/src/Component/SimpleSeparator.php +++ b/src/Component/SimpleSeparator.php @@ -23,7 +23,7 @@ public function __construct( $class ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return 'separator'; } @@ -32,7 +32,7 @@ public function getId() : string { * * @return string */ - public function getHtml() : string { + public function getHtml(): string { return $this->html; } @@ -40,7 +40,7 @@ public function getHtml() : string { * * @return string[] */ - public function getClasses() : array { + public function getClasses(): array { return $this->classes; } } diff --git a/src/Component/SimpleTextLink.php b/src/Component/SimpleTextLink.php index 39bdfd5..a5c46c6 100644 --- a/src/Component/SimpleTextLink.php +++ b/src/Component/SimpleTextLink.php @@ -33,70 +33,70 @@ public function __construct( $options ) { /** * @inheritDoc */ - public function getId() : string { + public function getId(): string { return $this->options['id']; } /** * @inheritDoc */ - public function getClasses() : array { + public function getClasses(): array { return $this->options['classes']; } /** * @inheritDoc */ - public function getRole() : string { + public function getRole(): string { return $this->options['role']; } /** * @inheritDoc */ - public function getText() : Message { + public function getText(): Message { return $this->options['text']; } /** * @inheritDoc */ - public function getTitle() : Message { + public function getTitle(): Message { return $this->options['title']; } /** * @inheritDoc */ - public function getAriaLabel() : Message { + public function getAriaLabel(): Message { return $this->options['aria-label']; } /** * @inheritDoc */ - public function getDataAttributes() : array { + public function getDataAttributes(): array { return $this->options['data']; } /** * @inheritDoc */ - public function getAriaAttributes() : array { + public function getAriaAttributes(): array { return $this->options['aria']; } /** * @inheritDoc */ - public function getHref() : string { + public function getHref(): string { return $this->options['href']; } /** * @inheritDoc */ - public function getRel() : string { + public function getRel(): string { return $this->options['rel']; } } diff --git a/src/Component/SimpleTreeLinkNode.php b/src/Component/SimpleTreeLinkNode.php index f885eba..7f6d619 100644 --- a/src/Component/SimpleTreeLinkNode.php +++ b/src/Component/SimpleTreeLinkNode.php @@ -73,7 +73,7 @@ public function getRole(): string { * * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } diff --git a/src/Component/SimpleTreeTextNode.php b/src/Component/SimpleTreeTextNode.php index 1a28f37..0d286e9 100644 --- a/src/Component/SimpleTreeTextNode.php +++ b/src/Component/SimpleTreeTextNode.php @@ -71,7 +71,7 @@ public function getRole(): string { * * @inheritDoc */ - public function getSubComponents() : array { + public function getSubComponents(): array { return $this->options['items']; } diff --git a/src/ComponentFilterFactory.php b/src/ComponentFilterFactory.php index 09e1da5..52cc19c 100644 --- a/src/ComponentFilterFactory.php +++ b/src/ComponentFilterFactory.php @@ -6,8 +6,10 @@ class ComponentFilterFactory { + /** @var array */ private $registeredFilters = []; + /** @var ObjectFactory */ private $objectFactory; /** diff --git a/src/ComponentManager.php b/src/ComponentManager.php index dbee83c..cb3b38f 100644 --- a/src/ComponentManager.php +++ b/src/ComponentManager.php @@ -71,7 +71,7 @@ class ComponentManager { /** * - * @var boolean + * @var bool */ private $async = false; @@ -107,7 +107,7 @@ class ComponentManager { */ public static function singleton( IContextSource $context, $slotSpecs, $enabledSlots, $componentFilterFactory, $objectFactory = null, $hookContainer = null, - $slotRegistry = null ) : ComponentManager { + $slotRegistry = null ): ComponentManager { if ( static::$instance == null ) { static::$instance = new ComponentManager( $slotSpecs, @@ -280,7 +280,7 @@ public function getComponentId( $component ) { * @param IRestrictedComponent $component * @return bool */ - private function checkPermissions( $component ) : bool { + private function checkPermissions( $component ): bool { $user = $this->context->getUser(); $services = MediaWikiServices::getInstance(); foreach ( $component->getPermissions() as $permission ) { diff --git a/src/ComponentRendererFactory.php b/src/ComponentRendererFactory.php index d2a94e4..d506164 100644 --- a/src/ComponentRendererFactory.php +++ b/src/ComponentRendererFactory.php @@ -68,7 +68,7 @@ public function getKey( $component ) { * @param string $rendererKey * @return IComponentRenderer */ - public function getRenderer( $rendererKey ) : IComponentRenderer { + public function getRenderer( $rendererKey ): IComponentRenderer { $spec = []; // Renderer available for current environment? @@ -78,7 +78,7 @@ public function getRenderer( $rendererKey ) : IComponentRenderer { // Try to fall back to "generic" renderer elseif ( isset( $this->rendererRegistry['*'][$rendererKey] ) ) { $spec = $this->rendererRegistry['*'][$rendererKey]; - } + } // Convert simple registration to `ObjectFactory` compatible spec if ( is_string( $spec ) && !empty( $spec ) ) { $callback = $spec; @@ -98,7 +98,7 @@ public function getRenderer( $rendererKey ) : IComponentRenderer { * * @return IComponentRenderer[] */ - public function getAllRenderers() : array { + public function getAllRenderers(): array { $componentKeys = array_keys( $this->componentRegistry ); $renderers = []; foreach ( $componentKeys as $key ) { diff --git a/src/DataAttributesBuilder.php b/src/DataAttributesBuilder.php index 13edf79..d4ec3a6 100644 --- a/src/DataAttributesBuilder.php +++ b/src/DataAttributesBuilder.php @@ -16,7 +16,7 @@ public static function factory() { * @param array $data * @return array */ - public function build( $data ) : array { + public function build( $data ): array { $attribs = []; foreach ( $data as $key => $value ) { @@ -34,7 +34,7 @@ public function build( $data ) : array { * @param array $data * @return string */ - public function toString( $data ) : string { + public function toString( $data ): string { $attribs = $this->build( $data ); return implode( ' ', $attribs ); diff --git a/src/GenericComponentRenderer.php b/src/GenericComponentRenderer.php index 047bfad..e9a4155 100644 --- a/src/GenericComponentRenderer.php +++ b/src/GenericComponentRenderer.php @@ -40,7 +40,7 @@ public function __construct( $componentManager, $rendererDataTreeBuilder, * @param IComponent $component * @return string */ - public function getHtml( $component ) : string { + public function getHtml( $component ): string { $componentTree = $this->componentManager->getCustomComponentTree( $component ); $rendererDataTree = $this->rendererDataTreeBuilder->getRendererDataTree( $componentTree ); return $this->RendererDataTreeRenderer->getHtml( $rendererDataTree ); diff --git a/src/GenericSkinSlotRenderer.php b/src/GenericSkinSlotRenderer.php index 00a0b8f..f2b1ce0 100644 --- a/src/GenericSkinSlotRenderer.php +++ b/src/GenericSkinSlotRenderer.php @@ -10,7 +10,7 @@ class GenericSkinSlotRenderer extends SkinSlotRendererBase { * that needs to pass `QuickTemplate::$data` * @return string */ - public function getHtml( $data = [] ) : string { + public function getHtml( $data = [] ): string { $componentTree = $this->componentManager->getSkinSlotComponentTree( $this->slotId ); $rendererDataTree = $this->rendererDataTreeBuilder->getRendererDataTree( $componentTree ); $html = $this->rendererDataTreeRenderer->getHtml( $rendererDataTree ); diff --git a/src/Hook/MWStakeCommonUIRegisterSkinSlotComponents.php b/src/Hook/MWStakeCommonUIRegisterSkinSlotComponents.php index 0b6260d..57d7744 100644 --- a/src/Hook/MWStakeCommonUIRegisterSkinSlotComponents.php +++ b/src/Hook/MWStakeCommonUIRegisterSkinSlotComponents.php @@ -1,6 +1,6 @@ htmlIds ) ) { $newId = Sanitizer::escapeIdForAttribute( $id ); array_push( $this->htmlIds, $newId ); diff --git a/src/IAccordion.php b/src/IAccordion.php index a034c3f..a746ec2 100644 --- a/src/IAccordion.php +++ b/src/IAccordion.php @@ -9,5 +9,5 @@ interface IAccordion extends IComponent { * * @return Message */ - public function getLabel() : Message; + public function getLabel(): Message; } diff --git a/src/IAccordionItem.php b/src/IAccordionItem.php index 9a10872..3f48d64 100644 --- a/src/IAccordionItem.php +++ b/src/IAccordionItem.php @@ -10,10 +10,10 @@ interface IAccordionItem extends IComponent { * * @return Message */ - public function getHeaderText() : Message; + public function getHeaderText(): Message; /** * @return Message */ - public function getTooltip() : Message; + public function getTooltip(): Message; } diff --git a/src/IBadge.php b/src/IBadge.php index 9eb3c85..a1c0ef1 100644 --- a/src/IBadge.php +++ b/src/IBadge.php @@ -12,10 +12,10 @@ interface IBadge { /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @inheritDoc */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/IBreadCrumb.php b/src/IBreadCrumb.php index 94e37ca..514b400 100644 --- a/src/IBreadCrumb.php +++ b/src/IBreadCrumb.php @@ -9,10 +9,10 @@ interface IBreadCrumb { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; } diff --git a/src/IButton.php b/src/IButton.php index b64f1d3..24cd614 100644 --- a/src/IButton.php +++ b/src/IButton.php @@ -10,21 +10,21 @@ interface IButton extends IComponent { * * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @inheritDoc */ - public function getClasses() : array; + public function getClasses(): array; /** * * @return bool */ - public function isDisabled() : bool; + public function isDisabled(): bool; } diff --git a/src/IButtonGroup.php b/src/IButtonGroup.php index 927e7ff..a118ae8 100644 --- a/src/IButtonGroup.php +++ b/src/IButtonGroup.php @@ -9,17 +9,17 @@ interface IButtonGroup { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * One of the `ARIARole::*` constants * * @return string */ - public function getRole() : string; + public function getRole(): string; } diff --git a/src/ICard.php b/src/ICard.php index be8a80a..55407d7 100644 --- a/src/ICard.php +++ b/src/ICard.php @@ -7,5 +7,5 @@ interface ICard { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; } diff --git a/src/ICardBody.php b/src/ICardBody.php index dd85b95..a995dcf 100644 --- a/src/ICardBody.php +++ b/src/ICardBody.php @@ -7,5 +7,5 @@ interface ICardBody { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICardFooter.php b/src/ICardFooter.php index 18fbb89..593d55f 100644 --- a/src/ICardFooter.php +++ b/src/ICardFooter.php @@ -7,5 +7,5 @@ interface ICardFooter { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICardHeader.php b/src/ICardHeader.php index ae656c9..f501c8a 100644 --- a/src/ICardHeader.php +++ b/src/ICardHeader.php @@ -7,5 +7,5 @@ interface ICardHeader { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICardImage.php b/src/ICardImage.php index 7745614..31801d3 100644 --- a/src/ICardImage.php +++ b/src/ICardImage.php @@ -9,22 +9,22 @@ interface ICardImage { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return CardImageType */ - public function getImageType() : string; + public function getImageType(): string; /** * * @return string */ - public function getImageSrc() : string; + public function getImageSrc(): string; /** * * @return Message */ - public function getImageAltText() : Message; + public function getImageAltText(): Message; } diff --git a/src/ICardLink.php b/src/ICardLink.php index b5b5880..f9c7e98 100644 --- a/src/ICardLink.php +++ b/src/ICardLink.php @@ -9,42 +9,42 @@ interface ICardLink { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return array */ - public function getDataAttributes() : array; + public function getDataAttributes(): array; /** * @return string */ - public function getHref() : string; + public function getHref(): string; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * One of the `ARIARole::*` constants * * @return string */ - public function getRole() : string; + public function getRole(): string; /** * @inheritDoc */ - public function getRel() : string; + public function getRel(): string; } diff --git a/src/ICardSubTitle.php b/src/ICardSubTitle.php index 18a9b7f..908fead 100644 --- a/src/ICardSubTitle.php +++ b/src/ICardSubTitle.php @@ -7,5 +7,5 @@ interface ICardSubTitle { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICardText.php b/src/ICardText.php index e81a70e..bc9c375 100644 --- a/src/ICardText.php +++ b/src/ICardText.php @@ -7,5 +7,5 @@ interface ICardText { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICardTitle.php b/src/ICardTitle.php index ee90540..c2322c2 100644 --- a/src/ICardTitle.php +++ b/src/ICardTitle.php @@ -7,5 +7,5 @@ interface ICardTitle { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ICollapsibleCard.php b/src/ICollapsibleCard.php index f9bbcb0..40b6ac3 100644 --- a/src/ICollapsibleCard.php +++ b/src/ICollapsibleCard.php @@ -9,36 +9,36 @@ interface ICollapsibleCard { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getHeaderClasses() : array; + public function getHeaderClasses(): array; /** * @return string[] */ - public function getBodyClasses() : array; + public function getBodyClasses(): array; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * * @return bool */ - public function getExpandedState() : bool; + public function getExpandedState(): bool; } diff --git a/src/IComponent.php b/src/IComponent.php index 5282ed7..68b5677 100644 --- a/src/IComponent.php +++ b/src/IComponent.php @@ -10,31 +10,31 @@ interface IComponent { * * @return string */ - public function getId() : string; + public function getId(): string; /** * * @return string[] */ - public function getRequiredRLModules() : array; + public function getRequiredRLModules(): array; /** * * @return string[] */ - public function getRequiredRLStyles() : array; + public function getRequiredRLStyles(): array; /** * @return IComponent[] */ - public function getSubComponents() : array; + public function getSubComponents(): array; /** * * @param IContextSource $context - * @return boolean + * @return bool */ - public function shouldRender( IContextSource $context ) : bool; + public function shouldRender( IContextSource $context ): bool; /** * @@ -42,5 +42,5 @@ public function shouldRender( IContextSource $context ) : bool; * Usually this is SkinTemplate's `$tpl->data` * @return void */ - public function setComponentData( $data ) : void; + public function setComponentData( $data ): void; } diff --git a/src/IComponentFilter.php b/src/IComponentFilter.php index f683190..2d1c9f8 100644 --- a/src/IComponentFilter.php +++ b/src/IComponentFilter.php @@ -10,7 +10,7 @@ interface IComponentFilter { * * @param IComponent $component * @param IContextSource $context - * @return boolean + * @return bool */ public function shouldRender( IComponent $component, IContextSource $context ): bool; diff --git a/src/IComponentRenderer.php b/src/IComponentRenderer.php index ce3329d..061bd81 100644 --- a/src/IComponentRenderer.php +++ b/src/IComponentRenderer.php @@ -10,40 +10,40 @@ interface IComponentRenderer { * @param array $data Data extracted from `IComponentRenderer::getTemplateData` * @return string */ - public function getHtml( $data ) : string; + public function getHtml( $data ): string; /** * If a component gets rendered in the inital page load these * RL modules will be loades automatically * @return array */ - public function getRLModules() : array; + public function getRLModules(): array; /** * If a component gets rendered in the inital page load these * RL module styles will be loades automatically * @return array */ - public function getRLModuleStyles() : array; + public function getRLModuleStyles(): array; /** * This is used to compile a clientside renderer. It will also load * RL modules from `getRLModules` and `getRLModuleStyles` * @return string */ - public function getTemplatePathname() : string; + public function getTemplatePathname(): string; /** * Used to convert component object into an array of simple data that can be rendered into HTML * Maybe called for serverside rendering or by an API module to send templatedata on the wire to * a clientside renderer * - * @param object $component Must implement a component interface that has + * @param IComponent $component Must implement a component interface that has * a renderer registered in `$mwsgCommonUIComponentRendererRegistry` * @param array $subComponentNodes The pre-created RendererDataTree nodes to be embedded * into the $object * * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array; + public function getRendererDataTreeNode( $component, $subComponentNodes ): array; } diff --git a/src/IContainer.php b/src/IContainer.php index 460a457..76785fb 100644 --- a/src/IContainer.php +++ b/src/IContainer.php @@ -5,7 +5,7 @@ interface IContainer { /** - * @ return string + * @return string */ public function getTagName(): string; diff --git a/src/IDropdown.php b/src/IDropdown.php index 9962c08..97cb5cb 100644 --- a/src/IDropdown.php +++ b/src/IDropdown.php @@ -9,30 +9,30 @@ interface IDropdown extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; } diff --git a/src/IDropdownButton.php b/src/IDropdownButton.php index c3065de..066f63d 100644 --- a/src/IDropdownButton.php +++ b/src/IDropdownButton.php @@ -9,36 +9,36 @@ interface IDropdownButton extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * * @return bool */ - public function isDisabled() : bool; + public function isDisabled(): bool; } diff --git a/src/IDropdownIcon.php b/src/IDropdownIcon.php index a7e683c..55ec232 100644 --- a/src/IDropdownIcon.php +++ b/src/IDropdownIcon.php @@ -9,36 +9,36 @@ interface IDropdownIcon extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return string[] */ - public function getIconClasses() : array; + public function getIconClasses(): array; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * * @return string */ - public function getTabindex() : string; + public function getTabindex(): string; } diff --git a/src/IDropdownIconSplitButton.php b/src/IDropdownIconSplitButton.php index 881120e..936b3aa 100644 --- a/src/IDropdownIconSplitButton.php +++ b/src/IDropdownIconSplitButton.php @@ -9,67 +9,67 @@ interface IDropdownIconSplitButton extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonGroupClasses() : array; + public function getButtonGroupClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string */ - public function getHref() : string; + public function getHref(): string; /** * @return string[] */ - public function getSplitButtonClasses() : array; + public function getSplitButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return array */ - public function getIconClasses() : array; + public function getIconClasses(): array; /** * @return Message */ - public function getButtonTitle() : Message; + public function getButtonTitle(): Message; /** * @return Message */ - public function getSplitButtonTitle() : Message; + public function getSplitButtonTitle(): Message; /** * @return Message */ - public function getButtonAriaLabel() : Message; + public function getButtonAriaLabel(): Message; /** * @return Message */ - public function getSplitButtonAriaLabel() : Message; + public function getSplitButtonAriaLabel(): Message; /** * * @return bool */ - public function buttonIsDisabled() : bool; + public function buttonIsDisabled(): bool; /** * * @return bool */ - public function splitButtonIsDisabled() : bool; + public function splitButtonIsDisabled(): bool; } diff --git a/src/IDropdownItemlist.php b/src/IDropdownItemlist.php index 513a89e..2228009 100644 --- a/src/IDropdownItemlist.php +++ b/src/IDropdownItemlist.php @@ -7,5 +7,5 @@ interface IDropdownItemlist { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/IDropdownItemlistFromArray.php b/src/IDropdownItemlistFromArray.php index 116e722..c679ff8 100644 --- a/src/IDropdownItemlistFromArray.php +++ b/src/IDropdownItemlistFromArray.php @@ -7,10 +7,10 @@ interface IDropdownItemlistFromArray { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @inheritDoc */ - public function getLinks() : array; + public function getLinks(): array; } diff --git a/src/IDropdownItemlistItem.php b/src/IDropdownItemlistItem.php index d276bb6..4ed4b5a 100644 --- a/src/IDropdownItemlistItem.php +++ b/src/IDropdownItemlistItem.php @@ -7,5 +7,5 @@ interface IDropdownItemlistItem { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/IDropdownSplitButton.php b/src/IDropdownSplitButton.php index 0e9c14f..2b44e4f 100644 --- a/src/IDropdownSplitButton.php +++ b/src/IDropdownSplitButton.php @@ -9,62 +9,62 @@ interface IDropdownSplitButton extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonGroupClasses() : array; + public function getButtonGroupClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string[] */ - public function getSplitButtonClasses() : array; + public function getSplitButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return Message */ - public function getButtonText() : Message; + public function getButtonText(): Message; /** * @return Message */ - public function getButtonTitle() : Message; + public function getButtonTitle(): Message; /** * @return Message */ - public function getSplitButtonTitle() : Message; + public function getSplitButtonTitle(): Message; /** * @return Message */ - public function getButtonAriaLabel() : Message; + public function getButtonAriaLabel(): Message; /** * @return Message */ - public function getSplitButtonAriaLabel() : Message; + public function getSplitButtonAriaLabel(): Message; /** * * @return bool */ - public function buttonIsDisabled() : bool; + public function buttonIsDisabled(): bool; /** * * @return bool */ - public function splitButtonIsDisabled() : bool; + public function splitButtonIsDisabled(): bool; } diff --git a/src/IDropdownSplitLink.php b/src/IDropdownSplitLink.php index 247cad7..f102f78 100644 --- a/src/IDropdownSplitLink.php +++ b/src/IDropdownSplitLink.php @@ -9,67 +9,67 @@ interface IDropdownSplitLink extends IComponent { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getButtonGroupClasses() : array; + public function getButtonGroupClasses(): array; /** * @return string[] */ - public function getButtonClasses() : array; + public function getButtonClasses(): array; /** * @return string[] */ - public function getSplitButtonClasses() : array; + public function getSplitButtonClasses(): array; /** * @return string[] */ - public function getMenuClasses() : array; + public function getMenuClasses(): array; /** * @return Message */ - public function getButtonText() : Message; + public function getButtonText(): Message; /** * @return Message */ - public function getButtonTitle() : Message; + public function getButtonTitle(): Message; /** * @return string */ - public function getButtonHref() : string; + public function getButtonHref(): string; /** * @return Message */ - public function getSplitButtonTitle() : Message; + public function getSplitButtonTitle(): Message; /** * @return Message */ - public function getButtonAriaLabel() : Message; + public function getButtonAriaLabel(): Message; /** * @return Message */ - public function getSplitButtonAriaLabel() : Message; + public function getSplitButtonAriaLabel(): Message; /** * * @return bool */ - public function buttonIsDisabled() : bool; + public function buttonIsDisabled(): bool; /** * * @return bool */ - public function splitButtonIsDisabled() : bool; + public function splitButtonIsDisabled(): bool; } diff --git a/src/ILink.php b/src/ILink.php index 0999c45..f5630d7 100644 --- a/src/ILink.php +++ b/src/ILink.php @@ -9,42 +9,42 @@ interface ILink { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return array */ - public function getDataAttributes() : array; + public function getDataAttributes(): array; /** * @return array */ - public function getAriaAttributes() : array; + public function getAriaAttributes(): array; /** * @return string */ - public function getHref() : string; + public function getHref(): string; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * One of the `ARIARole::*` constants * * @return string */ - public function getRole() : string; + public function getRole(): string; /** * @return string */ - public function getRel() : string; + public function getRel(): string; } diff --git a/src/ILinklistGroup.php b/src/ILinklistGroup.php index ecc6552..6d0dfea 100644 --- a/src/ILinklistGroup.php +++ b/src/ILinklistGroup.php @@ -7,10 +7,10 @@ interface ILinklistGroup { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return array */ - public function getAriaAttributes() : array; + public function getAriaAttributes(): array; } diff --git a/src/ILinklistGroupFromArray.php b/src/ILinklistGroupFromArray.php index 7fc78c8..13d896b 100644 --- a/src/ILinklistGroupFromArray.php +++ b/src/ILinklistGroupFromArray.php @@ -7,15 +7,15 @@ interface ILinklistGroupFromArray { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @inheritDoc */ - public function getLinks() : array; + public function getLinks(): array; /** * @return array */ - public function getAriaAttributes() : array; + public function getAriaAttributes(): array; } diff --git a/src/ILinklistGroupItem.php b/src/ILinklistGroupItem.php index 691244a..f5c64e6 100644 --- a/src/ILinklistGroupItem.php +++ b/src/ILinklistGroupItem.php @@ -7,5 +7,5 @@ interface ILinklistGroupItem { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ILiteral.php b/src/ILiteral.php index 05e2729..43e0ca6 100644 --- a/src/ILiteral.php +++ b/src/ILiteral.php @@ -7,5 +7,5 @@ interface ILiteral { /** * @return string */ - public function getHtml() : string; + public function getHtml(): string; } diff --git a/src/IMediaObject.php b/src/IMediaObject.php index 0d25195..c05baa2 100644 --- a/src/IMediaObject.php +++ b/src/IMediaObject.php @@ -9,27 +9,27 @@ interface IMediaObject { /** * @return string[] */ - public function getContainerClasses() : array; + public function getContainerClasses(): array; /** * @return string[] */ - public function getImageClasses() : array; + public function getImageClasses(): array; /** * @return string[] */ - public function getBodyClasses() : array; + public function getBodyClasses(): array; /** * * @return Message */ - public function getImageAltText() : Message; + public function getImageAltText(): Message; /** * * @return string */ - public function getImageSrc() : string; + public function getImageSrc(): string; } diff --git a/src/IMessageLiteral.php b/src/IMessageLiteral.php index 2d74b59..e49d040 100644 --- a/src/IMessageLiteral.php +++ b/src/IMessageLiteral.php @@ -9,5 +9,5 @@ interface IMessageLiteral { /** * @return Message */ - public function getText() : Message; + public function getText(): Message; } diff --git a/src/IRenderer.php b/src/IRenderer.php index 13816e8..17f139d 100644 --- a/src/IRenderer.php +++ b/src/IRenderer.php @@ -7,9 +7,9 @@ interface IRenderer { /** * * @param IComponent $component - * @return boolean + * @return bool */ - public function canRender( IComponent $component ) : bool; + public function canRender( IComponent $component ): bool; /** * Having this public should enable client-side rendering @@ -17,31 +17,31 @@ public function canRender( IComponent $component ) : bool; * @param IComponent $component * @return array */ - public function getTemplateData( IComponent $component ) : array; + public function getTemplateData( IComponent $component ): array; /** * Having this public should enable client-side rendering * * @return string */ - public function getTemplatePathname() : string; + public function getTemplatePathname(): string; /** * * @param IComponent $component * @return string */ - public function render( IComponent $component ) : string; + public function render( IComponent $component ): string; /** * * @return array */ - public function getRLModules() : array; + public function getRLModules(): array; /** * * @return array */ - public function getRLModuleStyles() : array; + public function getRLModuleStyles(): array; } diff --git a/src/IRestrictedComponent.php b/src/IRestrictedComponent.php index 60bbbf1..7cc27cc 100644 --- a/src/IRestrictedComponent.php +++ b/src/IRestrictedComponent.php @@ -8,5 +8,5 @@ interface IRestrictedComponent { * * @return string[] */ - public function getPermissions() : array; + public function getPermissions(): array; } diff --git a/src/ISeparator.php b/src/ISeparator.php index 34ff49e..f6b6e74 100644 --- a/src/ISeparator.php +++ b/src/ISeparator.php @@ -7,5 +7,5 @@ interface ISeparator { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; } diff --git a/src/ISkinSlotRegistry.php b/src/ISkinSlotRegistry.php index 43758ae..241457a 100644 --- a/src/ISkinSlotRegistry.php +++ b/src/ISkinSlotRegistry.php @@ -22,5 +22,5 @@ public function register( $skinSlot, $components ); * * @return array */ - public function getSkinSlots() : array; + public function getSkinSlots(): array; } diff --git a/src/ISkinSlotRenderer.php b/src/ISkinSlotRenderer.php index 86ace9c..7fcbf29 100644 --- a/src/ISkinSlotRenderer.php +++ b/src/ISkinSlotRenderer.php @@ -8,5 +8,5 @@ interface ISkinSlotRenderer { * @param array $data * @return string */ - public function getHtml( $data = [] ) : string; + public function getHtml( $data = [] ): string; } diff --git a/src/ITabPanel.php b/src/ITabPanel.php index 7bd1eb8..1e6ec40 100644 --- a/src/ITabPanel.php +++ b/src/ITabPanel.php @@ -11,49 +11,49 @@ interface ITabPanel { * * @return string */ - public function getId() : string; + public function getId(): string; /** * * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * * @return Message */ - public function getAriaDesc() : Message; + public function getAriaDesc(): Message; /** * * @return IComponent[] */ - public function getSubComponents() : array; + public function getSubComponents(): array; /** * * @param IContextSource $context - * @return boolean + * @return bool */ - public function shouldRender( IContextSource $context ) : bool; + public function shouldRender( IContextSource $context ): bool; /** * * @param IContextSource $context - * @return boolean + * @return bool */ - public function isActive( $context ) : bool; + public function isActive( $context ): bool; } diff --git a/src/ITextLink.php b/src/ITextLink.php index 043afa8..d4e5825 100644 --- a/src/ITextLink.php +++ b/src/ITextLink.php @@ -9,48 +9,48 @@ interface ITextLink { /** * @return string[] */ - public function getClasses() : array; + public function getClasses(): array; /** * @return array */ - public function getDataAttributes() : array; + public function getDataAttributes(): array; /** * @return array */ - public function getAriaAttributes() : array; + public function getAriaAttributes(): array; /** * @return string */ - public function getHref() : string; + public function getHref(): string; /** * @return Message */ - public function getText() : Message; + public function getText(): Message; /** * @return Message */ - public function getTitle() : Message; + public function getTitle(): Message; /** * @return Message */ - public function getAriaLabel() : Message; + public function getAriaLabel(): Message; /** * One of the `ARIARole::*` constants * * @return string */ - public function getRole() : string; + public function getRole(): string; /** * @return string */ - public function getRel() : string; + public function getRel(): string; } diff --git a/src/ITreeNode.php b/src/ITreeNode.php index ab9cf7d..4aa8698 100644 --- a/src/ITreeNode.php +++ b/src/ITreeNode.php @@ -5,7 +5,7 @@ interface ITreeNode { /** - * @return boolean + * @return bool */ public function isExpanded(): bool; diff --git a/src/LessVars.php b/src/LessVars.php index ecfb98c..48cda48 100644 --- a/src/LessVars.php +++ b/src/LessVars.php @@ -3,6 +3,8 @@ namespace MWStake\MediaWiki\Component\CommonUserInterface; class LessVars { + + /** @var LessVars */ protected static $instance = null; /** @var array */ diff --git a/src/LinkFormatter.php b/src/LinkFormatter.php index 3d8d73e..76df778 100644 --- a/src/LinkFormatter.php +++ b/src/LinkFormatter.php @@ -9,13 +9,13 @@ class LinkFormatter { /** * - * @var string|boolean + * @var string|bool */ private $externalLinkTarget = false; /** * - * @var boolean + * @var bool */ private $noFollowLinks = true; @@ -37,7 +37,7 @@ public function __construct( $externalLinkTarget = false, $noFollowLinks = true * @param array $links * @return array */ - public function formatLinks( $links ) : array { + public function formatLinks( $links ): array { $params = []; foreach ( $links as $key => $link ) { diff --git a/src/Renderer/Accordion.php b/src/Renderer/Accordion.php index 8171d3e..16ae40c 100644 --- a/src/Renderer/Accordion.php +++ b/src/Renderer/Accordion.php @@ -12,7 +12,7 @@ class Accordion extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IAccordion; } @@ -23,7 +23,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { return [ 'id' => $component->getId(), 'items' => $component->getLabel()->plain() @@ -35,7 +35,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/accordion.mustache'; } diff --git a/src/Renderer/Badge.php b/src/Renderer/Badge.php index be8ff3b..bb0f7c3 100644 --- a/src/Renderer/Badge.php +++ b/src/Renderer/Badge.php @@ -13,7 +13,7 @@ class Badge extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IBadge; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -48,7 +48,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/badge.mustache'; } diff --git a/src/Renderer/Button.php b/src/Renderer/Button.php index 801773f..9edfde9 100644 --- a/src/Renderer/Button.php +++ b/src/Renderer/Button.php @@ -13,7 +13,7 @@ class Button extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IButton; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -62,7 +62,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/button.mustache'; } diff --git a/src/Renderer/ButtonGroup.php b/src/Renderer/ButtonGroup.php index eff1e2c..8992b19 100644 --- a/src/Renderer/ButtonGroup.php +++ b/src/Renderer/ButtonGroup.php @@ -13,7 +13,7 @@ class ButtonGroup extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IButtonGroup; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -61,7 +61,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/button-group.mustache'; } diff --git a/src/Renderer/Card.php b/src/Renderer/Card.php index 7174020..0704e35 100644 --- a/src/Renderer/Card.php +++ b/src/Renderer/Card.php @@ -11,14 +11,14 @@ class Card extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardBody.php b/src/Renderer/CardBody.php index 56eba86..12e4410 100644 --- a/src/Renderer/CardBody.php +++ b/src/Renderer/CardBody.php @@ -11,14 +11,14 @@ class CardBody extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-body.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardFooter.php b/src/Renderer/CardFooter.php index dd8fd02..dbfbb64 100644 --- a/src/Renderer/CardFooter.php +++ b/src/Renderer/CardFooter.php @@ -11,14 +11,14 @@ class CardFooter extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-footer.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardHeader.php b/src/Renderer/CardHeader.php index 6ebb27f..3a64a52 100644 --- a/src/Renderer/CardHeader.php +++ b/src/Renderer/CardHeader.php @@ -11,14 +11,14 @@ class CardHeader extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-header.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardImage.php b/src/Renderer/CardImage.php index d92d4b7..9d208b7 100644 --- a/src/Renderer/CardImage.php +++ b/src/Renderer/CardImage.php @@ -10,14 +10,14 @@ class CardImage extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-img.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardLink.php b/src/Renderer/CardLink.php index e6a998c..27cfa86 100644 --- a/src/Renderer/CardLink.php +++ b/src/Renderer/CardLink.php @@ -14,7 +14,7 @@ class CardLink extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ICardLink; } @@ -25,7 +25,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -64,7 +64,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/card-link.mustache'; } diff --git a/src/Renderer/CardSubTitle.php b/src/Renderer/CardSubTitle.php index f05b9ab..d7be8b0 100644 --- a/src/Renderer/CardSubTitle.php +++ b/src/Renderer/CardSubTitle.php @@ -11,14 +11,14 @@ class CardSubTitle extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-subtitle.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardText.php b/src/Renderer/CardText.php index b48bc8f..88d5de5 100644 --- a/src/Renderer/CardText.php +++ b/src/Renderer/CardText.php @@ -11,14 +11,14 @@ class CardText extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-text.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CardTitle.php b/src/Renderer/CardTitle.php index 717e62d..9387caa 100644 --- a/src/Renderer/CardTitle.php +++ b/src/Renderer/CardTitle.php @@ -11,14 +11,14 @@ class CardTitle extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-title.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/CollapsibleCard.php b/src/Renderer/CollapsibleCard.php index f3a8fbd..9175fbe 100644 --- a/src/Renderer/CollapsibleCard.php +++ b/src/Renderer/CollapsibleCard.php @@ -11,14 +11,14 @@ class CollapsibleCard extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'collapsible-card.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/Container.php b/src/Renderer/Container.php index 9e7ae9f..4bd4379 100644 --- a/src/Renderer/Container.php +++ b/src/Renderer/Container.php @@ -11,14 +11,14 @@ class Container extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'container.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/Dropdown.php b/src/Renderer/Dropdown.php index 3e100b5..103e1b3 100644 --- a/src/Renderer/Dropdown.php +++ b/src/Renderer/Dropdown.php @@ -14,7 +14,7 @@ class Dropdown extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdown; } @@ -25,7 +25,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdown ) { @@ -74,7 +74,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown.mustache'; } diff --git a/src/Renderer/DropdownButton.php b/src/Renderer/DropdownButton.php index 7360d35..e468af1 100644 --- a/src/Renderer/DropdownButton.php +++ b/src/Renderer/DropdownButton.php @@ -13,7 +13,7 @@ class DropdownButton extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownButton; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdownButton ) { @@ -81,7 +81,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-button.mustache'; } diff --git a/src/Renderer/DropdownIcon.php b/src/Renderer/DropdownIcon.php index ca4238b..fdf68a6 100644 --- a/src/Renderer/DropdownIcon.php +++ b/src/Renderer/DropdownIcon.php @@ -13,7 +13,7 @@ class DropdownIcon extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownIcon; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdownIcon ) { @@ -81,7 +81,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-icon.mustache'; } diff --git a/src/Renderer/DropdownIconSplitButton.php b/src/Renderer/DropdownIconSplitButton.php index 880a411..e85846d 100644 --- a/src/Renderer/DropdownIconSplitButton.php +++ b/src/Renderer/DropdownIconSplitButton.php @@ -13,7 +13,7 @@ class DropdownIconSplitButton extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownIconSplitButton; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdownIconSplitButton ) { @@ -115,7 +115,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-icon-split-button.mustache'; } diff --git a/src/Renderer/DropdownItemlist.php b/src/Renderer/DropdownItemlist.php index b3737e5..e2deeed 100644 --- a/src/Renderer/DropdownItemlist.php +++ b/src/Renderer/DropdownItemlist.php @@ -13,7 +13,7 @@ class DropdownItemlist extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownItemlist; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -53,7 +53,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-itemlist.mustache'; } diff --git a/src/Renderer/DropdownItemlistFromArray.php b/src/Renderer/DropdownItemlistFromArray.php index a87d530..d99b288 100644 --- a/src/Renderer/DropdownItemlistFromArray.php +++ b/src/Renderer/DropdownItemlistFromArray.php @@ -15,7 +15,7 @@ class DropdownItemlistFromArray extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownItemlistFromArray; } @@ -26,7 +26,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -73,7 +73,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-itemlist-from-array.mustache'; } diff --git a/src/Renderer/DropdownItemlistItem.php b/src/Renderer/DropdownItemlistItem.php index e5e3c40..31a0e64 100644 --- a/src/Renderer/DropdownItemlistItem.php +++ b/src/Renderer/DropdownItemlistItem.php @@ -13,7 +13,7 @@ class DropdownItemlistItem extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownItemlistItem; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -53,7 +53,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-itemlist-item.mustache'; } diff --git a/src/Renderer/DropdownSplitButton.php b/src/Renderer/DropdownSplitButton.php index f519613..36c5170 100644 --- a/src/Renderer/DropdownSplitButton.php +++ b/src/Renderer/DropdownSplitButton.php @@ -13,7 +13,7 @@ class DropdownSplitButton extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownSplitButton; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdownSplitButton ) { @@ -107,7 +107,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-split-button.mustache'; } diff --git a/src/Renderer/DropdownSplitLink.php b/src/Renderer/DropdownSplitLink.php index d535963..e600333 100644 --- a/src/Renderer/DropdownSplitLink.php +++ b/src/Renderer/DropdownSplitLink.php @@ -13,7 +13,7 @@ class DropdownSplitLink extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IDropdownSplitLink; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; if ( $component instanceof IDropdownSplitLink ) { @@ -108,7 +108,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/dropdown-split-link.mustache'; } diff --git a/src/Renderer/Link.php b/src/Renderer/Link.php index 06279cc..87d4957 100644 --- a/src/Renderer/Link.php +++ b/src/Renderer/Link.php @@ -31,7 +31,7 @@ public function __construct( $mainConfig ) { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ILink; } @@ -42,7 +42,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -116,7 +116,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/link.mustache'; } diff --git a/src/Renderer/LinklistGroup.php b/src/Renderer/LinklistGroup.php index da4b7ec..6943c80 100644 --- a/src/Renderer/LinklistGroup.php +++ b/src/Renderer/LinklistGroup.php @@ -14,7 +14,7 @@ class LinklistGroup extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ILinklistGroup; } @@ -25,7 +25,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -66,7 +66,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/linklist-group.mustache'; } diff --git a/src/Renderer/LinklistGroupFromArray.php b/src/Renderer/LinklistGroupFromArray.php index 2083ebf..30243b4 100644 --- a/src/Renderer/LinklistGroupFromArray.php +++ b/src/Renderer/LinklistGroupFromArray.php @@ -15,7 +15,7 @@ class LinklistGroupFromArray extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ILinklistGroupFromArray; } @@ -26,7 +26,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -84,7 +84,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/linklist-group-from-array.mustache'; } diff --git a/src/Renderer/LinklistGroupItem.php b/src/Renderer/LinklistGroupItem.php index 2f72a60..1a4de7f 100644 --- a/src/Renderer/LinklistGroupItem.php +++ b/src/Renderer/LinklistGroupItem.php @@ -13,7 +13,7 @@ class LinklistGroupItem extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ILinklistGroupItem; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -55,7 +55,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/linklist-group-item.mustache'; } diff --git a/src/Renderer/Literal.php b/src/Renderer/Literal.php index 00b08b6..c1b2fa2 100644 --- a/src/Renderer/Literal.php +++ b/src/Renderer/Literal.php @@ -13,7 +13,7 @@ class Literal extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ILiteral; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -48,7 +48,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/literal.mustache'; } diff --git a/src/Renderer/MediaObject.php b/src/Renderer/MediaObject.php index 875f445..b1a300e 100644 --- a/src/Renderer/MediaObject.php +++ b/src/Renderer/MediaObject.php @@ -10,14 +10,14 @@ class MediaObject extends RendererBase { /** * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . 'card-img.mustache'; } /** * @inheritDoc */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ diff --git a/src/Renderer/MessageLiteral.php b/src/Renderer/MessageLiteral.php index 90b34df..75c510b 100644 --- a/src/Renderer/MessageLiteral.php +++ b/src/Renderer/MessageLiteral.php @@ -13,7 +13,7 @@ class MessageLiteral extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof IMessageLiteral; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -48,7 +48,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/literal.mustache'; } } diff --git a/src/Renderer/RendererBase.php b/src/Renderer/RendererBase.php index e7bf96c..b1a493a 100644 --- a/src/Renderer/RendererBase.php +++ b/src/Renderer/RendererBase.php @@ -29,7 +29,7 @@ public function __construct() { /** * @inheritDoc */ - public function getHtml( $data ) : string { + public function getHtml( $data ): string { $templatePathname = $this->getTemplatePathname(); $templateDirname = dirname( $templatePathname ); $templateFilename = basename( $templatePathname ); @@ -78,14 +78,14 @@ protected function getHtmlArmorExcludedFields() { /** * @inheritDoc */ - public function getRLModules() : array { + public function getRLModules(): array { return []; } /** * @inheritDoc */ - public function getRLModuleStyles() : array { + public function getRLModuleStyles(): array { return []; } } diff --git a/src/Renderer/Separator.php b/src/Renderer/Separator.php index d5d4edd..12ee6c3 100644 --- a/src/Renderer/Separator.php +++ b/src/Renderer/Separator.php @@ -13,7 +13,7 @@ class Separator extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ISeparator; } @@ -24,7 +24,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -49,7 +49,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/separator.mustache'; } diff --git a/src/Renderer/TextLink.php b/src/Renderer/TextLink.php index 2d0ab9b..de37af6 100644 --- a/src/Renderer/TextLink.php +++ b/src/Renderer/TextLink.php @@ -31,7 +31,7 @@ public function __construct( $mainConfig ) { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ITextLink; } @@ -42,7 +42,7 @@ public function canRender( IComponent $component ) : bool { * @param array $subComponentNodes * @return array */ - public function getRendererDataTreeNode( $component, $subComponentNodes ) : array { + public function getRendererDataTreeNode( $component, $subComponentNodes ): array { $templateData = []; /** @var IComponent $component */ @@ -113,7 +113,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ) : arra * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/link.mustache'; } diff --git a/src/Renderer/TreeContainer.php b/src/Renderer/TreeContainer.php index 5b97252..b0793ea 100644 --- a/src/Renderer/TreeContainer.php +++ b/src/Renderer/TreeContainer.php @@ -14,7 +14,7 @@ class TreeContainer extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ITreeContainer; } @@ -73,7 +73,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ): array * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/tree-container.mustache'; } diff --git a/src/Renderer/TreeLinkNode.php b/src/Renderer/TreeLinkNode.php index c44dc88..86dfce5 100644 --- a/src/Renderer/TreeLinkNode.php +++ b/src/Renderer/TreeLinkNode.php @@ -29,7 +29,7 @@ public function __construct( $mainConfig ) { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ITreeLinkNode; } @@ -93,7 +93,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ): array * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/tree-link-node.mustache'; } diff --git a/src/Renderer/TreeTextNode.php b/src/Renderer/TreeTextNode.php index a72f2e3..9e55bc5 100644 --- a/src/Renderer/TreeTextNode.php +++ b/src/Renderer/TreeTextNode.php @@ -14,7 +14,7 @@ class TreeTextNode extends RendererBase { * @param IComponent $component * @return bool */ - public function canRender( IComponent $component ) : bool { + public function canRender( IComponent $component ): bool { return $component instanceof ITreeTextNode; } @@ -54,7 +54,7 @@ public function getRendererDataTreeNode( $component, $subComponentNodes ): array * * @return string */ - public function getTemplatePathname() : string { + public function getTemplatePathname(): string { return $this->templateBasePath . '/tree-text-node.mustache'; } diff --git a/src/SkinSlotRegistry.php b/src/SkinSlotRegistry.php index b195f7c..a52517b 100644 --- a/src/SkinSlotRegistry.php +++ b/src/SkinSlotRegistry.php @@ -21,7 +21,7 @@ class SkinSlotRegistry implements ISkinSlotRegistry { * @param array $slotSpecs * @return SkinSlotRegistry */ - public static function singleton( $slotSpecs ) : SkinSlotRegistry { + public static function singleton( $slotSpecs ): SkinSlotRegistry { if ( static::$instance == null ) { static::$instance = new SkinSlotRegistry( $slotSpecs @@ -55,7 +55,7 @@ public function register( $skinSlot, $components ) { * * @return array */ - public function getSkinSlots() : array { + public function getSkinSlots(): array { return $this->slotSpecs; } @@ -63,7 +63,7 @@ public function getSkinSlots() : array { * @param string $regKey * @return array */ - public function getSkinSlot( $regKey ) : array { + public function getSkinSlot( $regKey ): array { if ( array_key_exists( $regKey, $this->slotSpecs ) ) { return $this->slotSpecs[$regKey]; } diff --git a/src/SkinSlotRendererFactory.php b/src/SkinSlotRendererFactory.php index cfcd9d7..de4824d 100644 --- a/src/SkinSlotRendererFactory.php +++ b/src/SkinSlotRendererFactory.php @@ -32,7 +32,7 @@ public function __construct( $registry, $objectFactory ) { * @param string $slotId * @return ISkinSlotRenderer */ - public function create( string $slotId ) : ISkinSlotRenderer { + public function create( string $slotId ): ISkinSlotRenderer { $spec = []; if ( isset( $this->registry[$slotId] ) ) { $spec = $this->registry[$slotId]; diff --git a/tests/phpunit/ComponentManagerTest.php b/tests/phpunit/ComponentManagerTest.php index 40378c8..0afa2ee 100644 --- a/tests/phpunit/ComponentManagerTest.php +++ b/tests/phpunit/ComponentManagerTest.php @@ -61,14 +61,14 @@ public function testInit() { $slots = []; $slots[ 'testSlot1' ] = [ 'test1' => [ - 'factory' => function () use ( $mockComponent1 ) { + 'factory' => static function () use ( $mockComponent1 ) { return $mockComponent1; } ], ]; $slots[ 'testSlot2' ] = [ 'test1' => [ - 'factory' => function () use ( $mockComponent2 ) { + 'factory' => static function () use ( $mockComponent2 ) { return $mockComponent2; } ] @@ -107,7 +107,7 @@ public function testGetRequiredRLModules() { $slots = []; $slots[ 'testSlot1' ] = [ 'test1' => [ - 'factory' => function () use ( $mockComponent1 ) { + 'factory' => static function () use ( $mockComponent1 ) { return $mockComponent1; } ], @@ -148,7 +148,7 @@ public function testGetRequiredRLStyles() { $slots = []; $slots[ 'testSlot1' ] = [ 'test1' => [ - 'factory' => function () use ( $mockComponent1 ) { + 'factory' => static function () use ( $mockComponent1 ) { return $mockComponent1; } ], @@ -174,7 +174,7 @@ public function testGetSkinSlotComponentTree() { $slots = []; $slots[ 'testSlot1' ] = [ 'test1' => [ - 'factory' => function () { + 'factory' => static function () { return new SimplePanel( [ 'id' => 'my-panel', 'title' => new RawMessage( 'My card' ),