diff --git a/sources/application/UI/Base/AbstractUIBlockFactory.php b/sources/application/UI/Base/AbstractUIBlockFactory.php index 068550e93..3f7462896 100644 --- a/sources/application/UI/Base/AbstractUIBlockFactory.php +++ b/sources/application/UI/Base/AbstractUIBlockFactory.php @@ -14,18 +14,18 @@ namespace Combodo\iTop\Application\UI\Base; * @package Combodo\iTop\Application\UI\Base * @author Eric Espie * @since 3.0.0 - * @internal + * @api */ abstract class AbstractUIBlockFactory implements iUIBlockFactory { /** * @var string - * @used-by static::GetTwigTagName() + * @see static::GetTwigTagName() */ public const TWIG_TAG_NAME = 'UIBlock'; /** * @var string - * @useb-by static::GetUIBlockClassName() + * @see static::GetUIBlockClassName() */ public const UI_BLOCK_CLASS_NAME = UIBlock::class; diff --git a/sources/application/UI/Base/Component/Alert/AlertUIBlockFactory.php b/sources/application/UI/Base/Component/Alert/AlertUIBlockFactory.php index 30ce7631c..8fd953c51 100644 --- a/sources/application/UI/Base/Component/Alert/AlertUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Alert/AlertUIBlockFactory.php @@ -27,12 +27,15 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Guillaume Lajarige * @package Combodo\iTop\Application\UI\Base\Component\Alert * @since 3.0.0 + * @api * * @link /test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-alerts to see live examples */ class AlertUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIAlert'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Alert::class; /** diff --git a/sources/application/UI/Base/Component/Button/ButtonUIBlockFactory.php b/sources/application/UI/Base/Component/Button/ButtonUIBlockFactory.php index 68e115616..3a4b18036 100644 --- a/sources/application/UI/Base/Component/Button/ButtonUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Button/ButtonUIBlockFactory.php @@ -25,16 +25,18 @@ use Dict; /** * Class ButtonUIBlockFactory * - * @internal * @author Guillaume Lajarige * @package Combodo\iTop\Application\UI\Base\Component\Button * @since 3.0.0 + * @api * * @link /test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-buttons to see live examples */ class ButtonUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIButton'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Button::class; //--------------------------------------------- @@ -50,7 +52,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\Button\Button */ - public static function MakeNeutral(string $sLabel, string $sName = null, ?string $sId = null): Button + public static function MakeNeutral(string $sLabel, string $sName = null, ?string $sId = null) { $oButton = new ButtonJS($sLabel, $sId); $oButton->SetActionType(Button::ENUM_ACTION_TYPE_REGULAR) @@ -80,7 +82,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_PRIMARY, Button::ENUM_ACTION_TYPE_REGULAR, $sValue, $sName, $bIsSubmit, $sId); } @@ -101,7 +103,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_SECONDARY, Button::ENUM_ACTION_TYPE_REGULAR, $sValue, $sName, $bIsSubmit, $sId); } @@ -122,7 +124,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_VALIDATION, Button::ENUM_ACTION_TYPE_REGULAR, $sValue, $sName, $bIsSubmit, $sId); } @@ -144,7 +146,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_DESTRUCTIVE, Button::ENUM_ACTION_TYPE_REGULAR, $sValue, $sName, $bIsSubmit, $sId); } @@ -170,7 +172,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_NEUTRAL, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName, $bIsSubmit, $sId); } @@ -193,7 +195,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_PRIMARY, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName, $bIsSubmit, $sId); } @@ -215,7 +217,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_SECONDARY, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName, $bIsSubmit, $sId); } @@ -237,7 +239,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_VALIDATION, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName, $bIsSubmit, $sId); } @@ -259,7 +261,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { return static::MakeForAction($sLabel, Button::ENUM_COLOR_SCHEME_DESTRUCTIVE, Button::ENUM_ACTION_TYPE_ALTERNATIVE, $sValue, $sName, $bIsSubmit, $sId); } @@ -281,7 +283,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sValue = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { $sLabel = $sLabel ?? Dict::S('UI:Button:Cancel'); $sName = $sName ?? 'cancel'; @@ -333,7 +335,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory public static function MakeLinkNeutral( string $sURL, ?string $sLabel = '', ?string $sIconClasses = null, ?string $sTarget = null, ?string $sId = null - ): Button { + ) { if (empty($sTarget)) { $sTarget = ButtonURL::DEFAULT_TARGET; } @@ -416,7 +418,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sName = null, bool $bIsSubmit = false, ?string $sId = null - ): Button { + ) { $oButton = new ButtonJS($sLabel, $sId); $oButton->SetActionType($sActionType) ->SetColor($sColor); @@ -459,7 +461,7 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory string $sActionType, string $sTarget = null, ?string $sId = null - ): Button { + ) { $oButton = new ButtonURL($sLabel, $sURL, $sId, $sTarget); $oButton->SetActionType($sActionType) ->SetColor($sColor); diff --git a/sources/application/UI/Base/Component/ButtonGroup/ButtonGroupUIBlockFactory.php b/sources/application/UI/Base/Component/ButtonGroup/ButtonGroupUIBlockFactory.php index 5dbfe2167..f9b6c7786 100644 --- a/sources/application/UI/Base/Component/ButtonGroup/ButtonGroupUIBlockFactory.php +++ b/sources/application/UI/Base/Component/ButtonGroup/ButtonGroupUIBlockFactory.php @@ -14,14 +14,16 @@ use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu; /** * Class ButtonGroupUIBlockFactory * - * @internal * @author Guillaume Lajarige * @package Combodo\iTop\Application\UI\Base\Component\Button * @since 3.0.0 + * @api */ class ButtonGroupUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIButtonGroup'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = ButtonGroup::class; /** diff --git a/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSectionUIBlockFactory.php b/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSectionUIBlockFactory.php index 1c842fcff..6ff9172a9 100644 --- a/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSectionUIBlockFactory.php +++ b/sources/application/UI/Base/Component/CollapsibleSection/CollapsibleSectionUIBlockFactory.php @@ -10,11 +10,27 @@ namespace Combodo\iTop\Application\UI\Base\Component\CollapsibleSection; use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; +/** + * Class CollapsibleSectionUIBlockFactory + * + * @author Pierre Goiffon + * @package Combodo\iTop\Application\UI\Base\Component\CollapsibleSection + * @since 3.0.0 + * @api + */ class CollapsibleSectionUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UICollapsibleSection'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = CollapsibleSection::class; + /** + * @param string $sTitle + * @param string|null $sId + * + * @return \Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSection + */ public static function MakeStandard(string $sTitle, ?string $sId = null) { return new CollapsibleSection($sTitle, [], $sId); diff --git a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php index f85719b5f..dc122702b 100644 --- a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php +++ b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php @@ -33,13 +33,16 @@ use WebPage; /** * Class DataTableUIBlockFactory * - * @internal + * @author Anne-Catherine Cognet * @package Combodo\iTop\Application\UI\Base\Component\DataTable * @since 3.0.0 + * @api */ class DataTableUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIDataTable'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = DataTable::class; /** @@ -937,7 +940,7 @@ JS; * * @return \Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTable\FormTable */ - public static function MakeForForm(string $sRef, array $aColumns, array $aData = [], string $sFilter = ''): FormTable + public static function MakeForForm(string $sRef, array $aColumns, array $aData = [], string $sFilter = '') { $oTable = new FormTable("datatable_".$sRef); $oTable->SetRef($sRef); diff --git a/sources/application/UI/Base/Component/Field/FieldUIBlockFactory.php b/sources/application/UI/Base/Component/Field/FieldUIBlockFactory.php index 891c071d8..d45703168 100644 --- a/sources/application/UI/Base/Component/Field/FieldUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Field/FieldUIBlockFactory.php @@ -22,7 +22,9 @@ use Combodo\iTop\Application\UI\Base\UIBlock; */ class FieldUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIField'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Field::class; public static function MakeFromParams($aParams) diff --git a/sources/application/UI/Base/Component/FieldBadge/FieldBadgeUIBlockFactory.php b/sources/application/UI/Base/Component/FieldBadge/FieldBadgeUIBlockFactory.php index be13c6cb1..353254153 100644 --- a/sources/application/UI/Base/Component/FieldBadge/FieldBadgeUIBlockFactory.php +++ b/sources/application/UI/Base/Component/FieldBadge/FieldBadgeUIBlockFactory.php @@ -21,7 +21,9 @@ use ormStyle; */ class FieldBadgeUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIFieldBadge'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = FieldBadge::class; /** diff --git a/sources/application/UI/Base/Component/FieldSet/FieldSetUIBlockFactory.php b/sources/application/UI/Base/Component/FieldSet/FieldSetUIBlockFactory.php index 78e0554fb..ff6feb8a1 100644 --- a/sources/application/UI/Base/Component/FieldSet/FieldSetUIBlockFactory.php +++ b/sources/application/UI/Base/Component/FieldSet/FieldSetUIBlockFactory.php @@ -16,10 +16,13 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author eric Espie * @package Combodo\iTop\Application\UI\Base\Component\FieldSet * @since 3.0.0 + * @api */ class FieldSetUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIFieldSet'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = FieldSet::class; /** @@ -28,7 +31,7 @@ class FieldSetUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSet A standard fieldset in which you can add UIBlocks */ - public static function MakeStandard(string $sLegend, ?string $sId = null): FieldSet + public static function MakeStandard(string $sLegend, ?string $sId = null) { return new FieldSet($sLegend, $sId); } diff --git a/sources/application/UI/Base/Component/Form/FormUIBlockFactory.php b/sources/application/UI/Base/Component/Form/FormUIBlockFactory.php index c7f4af4cc..521699a50 100644 --- a/sources/application/UI/Base/Component/Form/FormUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Form/FormUIBlockFactory.php @@ -16,11 +16,13 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Component\Form * @since 3.0.0 - * @internal + * @api */ class FormUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIForm'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Form::class; /** diff --git a/sources/application/UI/Base/Component/Input/FileSelect/FileSelectUIBlockFactory.php b/sources/application/UI/Base/Component/Input/FileSelect/FileSelectUIBlockFactory.php index 55f1e0e8d..1eaf4d96a 100644 --- a/sources/application/UI/Base/Component/Input/FileSelect/FileSelectUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Input/FileSelect/FileSelectUIBlockFactory.php @@ -16,10 +16,13 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Component\Input\FileSelect * @since 3.0.0 + * @api */ class FileSelectUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIFileSelect'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = FileSelect::class; /** @@ -28,7 +31,7 @@ class FileSelectUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\Input\FileSelect\FileSelect A styled file input selector */ - public static function MakeStandard(string $sName, string $sId = null): FileSelect + public static function MakeStandard(string $sName, string $sId = null) { return new FileSelect($sName, $sId); } diff --git a/sources/application/UI/Base/Component/Input/InputUIBlockFactory.php b/sources/application/UI/Base/Component/Input/InputUIBlockFactory.php index fc57843d9..73f57157f 100644 --- a/sources/application/UI/Base/Component/Input/InputUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Input/InputUIBlockFactory.php @@ -21,10 +21,12 @@ use Combodo\iTop\Application\UI\Base\Component\Field\Field; */ class InputUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIInput'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Input::class; - public static function MakeForHidden(string $sName, string $sValue, ?string $sId = null): Input + public static function MakeForHidden(string $sName, string $sValue, ?string $sId = null) { $oInput = new Input($sId); @@ -35,7 +37,7 @@ class InputUIBlockFactory extends AbstractUIBlockFactory return $oInput; } - public static function MakeStandard(string $sType, string $sName, string $sValue, ?string $sId = null): Input + public static function MakeStandard(string $sType, string $sName, string $sValue, ?string $sId = null) { $oInput = new Input($sId); @@ -60,7 +62,7 @@ class InputUIBlockFactory extends AbstractUIBlockFactory public static function MakeForInputWithLabel( string $sLabel, string $sInputName, ?string $sInputValue = null, ?string $sInputId = null, string $sInputType = 'type' - ): InputWithLabel + ) { $oInput = new Input($sInputId); $oInput->SetType($sInputType); diff --git a/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php b/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php index edbb15128..91f1ec236 100644 --- a/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php @@ -16,13 +16,16 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Component\Input\Select * @since 3.0.0 + * @internal */ class SelectOptionUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UISelectOption'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = SelectOption::class; - public static function MakeForSelectOption(string $sValue, string $sLabel, bool $bSelected, ?string $sId = null): SelectOption + public static function MakeForSelectOption(string $sValue, string $sLabel, bool $bSelected, ?string $sId = null) { $oInput = new SelectOption($sId); diff --git a/sources/application/UI/Base/Component/Input/Select/SelectUIBlockFactory.php b/sources/application/UI/Base/Component/Input/Select/SelectUIBlockFactory.php index 76e788962..43c1c5e66 100644 --- a/sources/application/UI/Base/Component/Input/Select/SelectUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Input/Select/SelectUIBlockFactory.php @@ -21,7 +21,9 @@ use Combodo\iTop\Application\UI\Base\Component\Input\Select\Select; */ class SelectUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UISelect'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Select::class; /** @@ -32,7 +34,7 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\Input\Select\Select */ - public static function MakeForSelect(string $sName, ?string $sId = null): Select + public static function MakeForSelect(string $sName, ?string $sId = null) { $oInput = new Select($sId); $oInput->SetName($sName); @@ -51,7 +53,7 @@ class SelectUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\Input\Select\Select */ - public static function MakeForSelectWithLabel(string $sName, string $sLabel, ?string $sId = null): Select + public static function MakeForSelectWithLabel(string $sName, string $sLabel, ?string $sId = null) { $oInput = new Select($sId); $oInput->SetName($sName); diff --git a/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php b/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php index f01bbf77e..e1d047262 100644 --- a/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php @@ -24,10 +24,10 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; /** * Class PanelUIBlockFactory * - * @internal * @author Guillaume Lajarige * @package Combodo\iTop\Application\UI\Base\Component\Panel * @since 3.0.0 + * @api * * @link /test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-panels to see live examples */ diff --git a/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php b/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php index 1192ecd60..f665c5428 100644 --- a/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php @@ -16,10 +16,13 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Component\Spinner * @since 3.0.0 + * @internal */ class SpinnerUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UISpinner'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Spinner::class; public static function MakeStandard(?string $sId = null) diff --git a/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php b/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php index dbac9c162..7057dcbb1 100644 --- a/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php @@ -22,7 +22,9 @@ use Combodo\iTop\Application\UI\Base\UIBlock; */ class TitleUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UITitle'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Title::class; public static function MakeForPage(string $sTitle, ?string $sId = null) diff --git a/sources/application/UI/Base/Component/Toolbar/Separator/ToolbarSeparatorUIBlockFactory.php b/sources/application/UI/Base/Component/Toolbar/Separator/ToolbarSeparatorUIBlockFactory.php index b216c77d6..6c342abb9 100644 --- a/sources/application/UI/Base/Component/Toolbar/Separator/ToolbarSeparatorUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Toolbar/Separator/ToolbarSeparatorUIBlockFactory.php @@ -13,10 +13,10 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; /** * Class ToolbarSeparatorUIBlockFactory * - * @api * @author Guillaume Lajarige - * @since 3.0.0 * @package Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator + * @since 3.0.0 + * @api */ class ToolbarSeparatorUIBlockFactory extends AbstractUIBlockFactory { diff --git a/sources/application/UI/Base/Component/Toolbar/ToolbarSpacer/ToolbarSpacerUIBlockFactory.php b/sources/application/UI/Base/Component/Toolbar/ToolbarSpacer/ToolbarSpacerUIBlockFactory.php index 6ad42e3e6..7362a5259 100644 --- a/sources/application/UI/Base/Component/Toolbar/ToolbarSpacer/ToolbarSpacerUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Toolbar/ToolbarSpacer/ToolbarSpacerUIBlockFactory.php @@ -20,7 +20,9 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; */ class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIToolbarSpacer'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = ToolbarSpacer::class; /** @@ -28,7 +30,7 @@ class ToolbarSpacerUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarSpacer\ToolbarSpacer */ - public static function MakeStandard(string $sId = null): ToolbarSpacer + public static function MakeStandard(string $sId = null) { return new ToolbarSpacer($sId); } diff --git a/sources/application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php b/sources/application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php index 7b175b309..577c1908f 100644 --- a/sources/application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php +++ b/sources/application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php @@ -20,20 +20,22 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; */ class ToolbarUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIToolbar'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Toolbar::class; - public static function MakeForAction(string $sId = null): Toolbar + public static function MakeForAction(string $sId = null) { return new Toolbar($sId, ['ibo-toolbar--action']); } - public static function MakeStandard(string $sId = null, array $aContainerClasses = []): Toolbar + public static function MakeStandard(string $sId = null, array $aContainerClasses = []) { return new Toolbar($sId, $aContainerClasses); } - public static function MakeForButton(string $sId = null, array $aContainerClasses = []): Toolbar + public static function MakeForButton(string $sId = null, array $aContainerClasses = []) { return new Toolbar($sId, array_merge($aContainerClasses, ['ibo-toolbar--button'])); } diff --git a/sources/application/UI/Base/Layout/MultiColumn/Column/ColumnUIBlockFactory.php b/sources/application/UI/Base/Layout/MultiColumn/Column/ColumnUIBlockFactory.php index a3c224040..de8687773 100644 --- a/sources/application/UI/Base/Layout/MultiColumn/Column/ColumnUIBlockFactory.php +++ b/sources/application/UI/Base/Layout/MultiColumn/Column/ColumnUIBlockFactory.php @@ -17,20 +17,23 @@ use Combodo\iTop\Application\UI\Base\UIBlock; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column * @since 3.0.0 + * @api */ class ColumnUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIColumn'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = Column::class; - public static function MakeStandard(?string $sId = null): Column + public static function MakeStandard(?string $sId = null) { $oInput = new Column($sId); return $oInput; } - public static function MakeForBlock(UIBlock $oBlock, ?string $sId = null): Column + public static function MakeForBlock(UIBlock $oBlock, ?string $sId = null) { $oInput = new Column($sId); $oInput->AddSubBlock($oBlock); diff --git a/sources/application/UI/Base/Layout/MultiColumn/MultiColumnUIBlockFactory.php b/sources/application/UI/Base/Layout/MultiColumn/MultiColumnUIBlockFactory.php index 857747d18..5d6d0b439 100644 --- a/sources/application/UI/Base/Layout/MultiColumn/MultiColumnUIBlockFactory.php +++ b/sources/application/UI/Base/Layout/MultiColumn/MultiColumnUIBlockFactory.php @@ -15,13 +15,16 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; * @author Eric Espie * @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn * @since 3.0.0 + * @api */ class MultiColumnUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIMultiColumn'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = MultiColumn::class; - public static function MakeStandard(?string $sId = null): MultiColumn + public static function MakeStandard(?string $sId = null) { $oInput = new MultiColumn($sId); diff --git a/sources/application/UI/Base/Layout/UIContentBlockUIBlockFactory.php b/sources/application/UI/Base/Layout/UIContentBlockUIBlockFactory.php index 3c99dfd29..8dd5fa0e5 100644 --- a/sources/application/UI/Base/Layout/UIContentBlockUIBlockFactory.php +++ b/sources/application/UI/Base/Layout/UIContentBlockUIBlockFactory.php @@ -20,9 +20,19 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html; */ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory { + /** @inheritDoc */ public const TWIG_TAG_NAME = 'UIContentBlock'; + /** @inheritDoc */ public const UI_BLOCK_CLASS_NAME = UIContentBlock::class; + /** + * Make an empty UIContentBlock which can be used to embed anything or to surround another block with specific CSS classes. + * + * @param string|null $sId + * @param array $aContainerClasses + * + * @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock + */ public static function MakeStandard(string $sId = null, array $aContainerClasses = []) { return new UIContentBlock($sId, $aContainerClasses); @@ -34,6 +44,8 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory * * @param string $sCode * @param string|null $sId + * + * @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock */ public static function MakeForCode(string $sCode, string $sId = null) { @@ -44,6 +56,14 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory return $oCode; } + /** + * Used to display a block of preformatted text in a
 tag.
+	 *
+	 * @param string $sCode
+	 * @param string|null $sId
+	 *
+	 * @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock
+	 */
 	public static function MakeForPreformatted(string $sCode, string $sId = null)
 	{
 		$sCode = '
'.$sCode.'
'; diff --git a/sources/application/UI/Base/iUIBlockFactory.php b/sources/application/UI/Base/iUIBlockFactory.php index 435569e15..871376d80 100644 --- a/sources/application/UI/Base/iUIBlockFactory.php +++ b/sources/application/UI/Base/iUIBlockFactory.php @@ -9,21 +9,30 @@ namespace Combodo\iTop\Application\UI\Base; /** - * Interface UIBlockNode + * Interface iUIBlockFactory + * + * The UIBlockFactories should be prefered rathan than manually instantiating UIBlocks via their constructor for several reasons: + * * Factories' prototypes should be consistent over time + * * Factories that a block style will be consistent with the whole app. UI style over time (eg. Success messages are displayed in green in the app. If you manually create a green one for your purpose, if in the future we change success messages to be blue, yours will stay green, loosing their semantic meaning. Using the factories properly, your usages will migrate with the app. UI style seemlessly) * * @package Combodo\iTop\Application\UI\Base * @author Eric Espie * @since 3.0.0 + * @internal */ interface iUIBlockFactory { /** * @return string TWIG tag name that will be associated with this factory + * @used-by TWIG tags + * @internal */ public static function GetTwigTagName(): string; /** * @return string FQCN of the UIBlock produced by this factory + * @used-by TWIG tags + * @internal */ public static function GetUIBlockClassName(): string; } \ No newline at end of file