diff --git a/Exception/BadUserRoleException.php b/Exception/BadUserRoleException.php index a94639d6..8757511b 100644 --- a/Exception/BadUserRoleException.php +++ b/Exception/BadUserRoleException.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Exception; use Symfony\Component\Security\Core\User\UserInterface; -use WBW\Library\Core\IO\HTTPInterface; +use WBW\Library\Core\Helper\IO\HTTPInterface; /** * Bad user role exception. diff --git a/Form/Renderer/FormRenderer.php b/Form/Renderer/FormRenderer.php index dfd1072c..c8ee66a5 100644 --- a/Form/Renderer/FormRenderer.php +++ b/Form/Renderer/FormRenderer.php @@ -12,8 +12,8 @@ namespace WBW\Bundle\BootstrapBundle\Form\Renderer; use Symfony\Component\Translation\TranslatorInterface; -use WBW\Library\Core\Algorithm\Sorting\AlphabeticalTreeSort; -use WBW\Library\Core\Algorithm\Sorting\AlphabeticalTreeSortInterface; +use WBW\Library\Core\Helper\Sorting\AlphabeticalTreeNodeHelper; +use WBW\Library\Core\Model\Sorting\AlphabeticalTreeNodeInterface; /** * Form renderer. @@ -47,8 +47,8 @@ public static function render($option, TranslatorInterface $translator = null) { $output = "FormRendererInterface not implemented by this object"; } - if (true === ($option instanceof AlphabeticalTreeSortInterface)) { - $multiplier = AlphabeticalTreeSort::getLevel($option); + if (true === ($option instanceof AlphabeticalTreeNodeInterface)) { + $multiplier = AlphabeticalTreeNodeHelper::getLevel($option); $nbsp = html_entity_decode(" "); $symbol = html_entity_decode(0 === $multiplier ? "─" : "└"); $output = implode("", [str_repeat($nbsp, $multiplier * 3), $symbol, $nbsp, $output]); diff --git a/Navigation/NavigationItem.php b/Navigation/NavigationItem.php index db861f65..93484613 100644 --- a/Navigation/NavigationItem.php +++ b/Navigation/NavigationItem.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Navigation; use WBW\Library\Core\Node\AbstractNode; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Navigation item. @@ -100,9 +100,9 @@ public function toArray() { // Initialize the output. $output = []; - ArrayUtility::set($output, "href", $this->href, [null]); - ArrayUtility::set($output, "icon", $this->icon, [null]); - ArrayUtility::set($output, "span", $this->getId(), [null]); + ArrayHelper::set($output, "href", $this->href, [null]); + ArrayHelper::set($output, "icon", $this->icon, [null]); + ArrayHelper::set($output, "span", $this->getId(), [null]); // Check the nodes. if (0 < $this->size()) { diff --git a/Tests/Form/Renderer/FormRendererTest.php b/Tests/Form/Renderer/FormRendererTest.php index 708d08ff..a25a6e06 100644 --- a/Tests/Form/Renderer/FormRendererTest.php +++ b/Tests/Form/Renderer/FormRendererTest.php @@ -15,7 +15,7 @@ use WBW\Bundle\BootstrapBundle\Form\Renderer\FormRenderer; use WBW\Bundle\BootstrapBundle\Form\Renderer\TranslatedChoiceRendererInterface; use WBW\Bundle\BootstrapBundle\Tests\Cases\AbstractBootstrapFrameworkTestCase; -use WBW\Library\Core\Algorithm\Sorting\AlphabeticalTreeSortInterface; +use WBW\Library\Core\Model\Sorting\AlphabeticalTreeNodeInterface; /** * Form renderer test. @@ -41,13 +41,13 @@ protected function setUp() { // Set the mocks. $this->args = [ null, - $this->getMockBuilder(AlphabeticalTreeSortInterface::class)->getMock(), + $this->getMockBuilder(AlphabeticalTreeNodeInterface::class)->getMock(), $this->getMockBuilder(ChoiceRendererInterface::class)->getMock(), $this->getMockBuilder(TranslatedChoiceRendererInterface::class)->getMock(), $this, ]; - $this->args[1]->expects($this->any())->method("getAlphabeticalTreeSortParent")->willReturn(null); + $this->args[1]->expects($this->any())->method("getAlphabeticalTreeNodeParent")->willReturn(null); $this->args[2]->expects($this->any())->method("getChoiceLabel")->willReturn("choiceLabel"); $this->args[3]->expects($this->any())->method("getTranslatedChoiceLabel")->willReturn("translatedChoiceLabel"); } diff --git a/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.php b/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.php index d2641518..6b1d060a 100644 --- a/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.php +++ b/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.php @@ -15,7 +15,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Tests\Cases\AbstractBootstrapFrameworkTestCase; use WBW\Bundle\BootstrapBundle\Twig\Extension\CSS\ImageTwigExtension; -use WBW\Library\Core\Utility\IO\FileUtility; +use WBW\Library\Core\Helper\IO\FileHelper; /** * Image Twig extension. @@ -55,7 +55,7 @@ public function testBootstrapImageBase64Function() { $obj = new ImageTwigExtension(); - $ref = FileUtility::getContents(getcwd() . "/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.txt"); + $ref = FileHelper::getContents(getcwd() . "/Tests/Twig/Extension/CSS/ImageTwigExtensionTest.txt"); $src = getcwd() . "/Resources/doc/images/bootstrap-stack_1024x0860.png"; $arg0 = []; diff --git a/Twig/Extension/AbstractBootstrapTwigExtension.php b/Twig/Extension/AbstractBootstrapTwigExtension.php index 949767af..022aa4a6 100644 --- a/Twig/Extension/AbstractBootstrapTwigExtension.php +++ b/Twig/Extension/AbstractBootstrapTwigExtension.php @@ -13,7 +13,7 @@ use Twig_Extension; use WBW\Bundle\BootstrapBundle\Navigation\NavigationInterface; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Abstract Bootstrap Twig extension. @@ -59,7 +59,7 @@ public static function bootstrapHTMLElement($element, $content, array $attrs = [ $template = "<%element%%attributes%>%innerHTML%"; // Initialize the attributes. - $attributes = trim(StringUtility::parseArray($attrs)); + $attributes = trim(StringHelper::parseArray($attrs)); if (0 < strlen($attributes)) { $attributes = " " . $attributes; } @@ -68,7 +68,7 @@ public static function bootstrapHTMLElement($element, $content, array $attrs = [ $innerHTML = null !== $content ? trim($content, " ") : ""; // Return the HTML. - return StringUtility::replace($template, ["%element%", "%attributes%", "%innerHTML%"], [trim($element), $attributes, $innerHTML]); + return StringHelper::replace($template, ["%element%", "%attributes%", "%innerHTML%"], [trim($element), $attributes, $innerHTML]); } } diff --git a/Twig/Extension/CSS/AbstractImageTwigExtension.php b/Twig/Extension/CSS/AbstractImageTwigExtension.php index 1ff2e52f..f7bf8387 100644 --- a/Twig/Extension/CSS/AbstractImageTwigExtension.php +++ b/Twig/Extension/CSS/AbstractImageTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\CSS; use WBW\Bundle\BootstrapBundle\Twig\Extension\AbstractBootstrapTwigExtension; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Abstract image Twig extension. @@ -57,7 +57,7 @@ protected function bootstrapImage($src, $alt, $width, $height, $class, $usemap) $attributes["usemap"] = $usemap; // Return the HTML. - return StringUtility::replace($template, ["%attributes%"], [StringUtility::parseArray($attributes)]); + return StringHelper::replace($template, ["%attributes%"], [StringHelper::parseArray($attributes)]); } } diff --git a/Twig/Extension/CSS/ButtonTwigExtension.php b/Twig/Extension/CSS/ButtonTwigExtension.php index 8bcead6d..ddb2fff0 100644 --- a/Twig/Extension/CSS/ButtonTwigExtension.php +++ b/Twig/Extension/CSS/ButtonTwigExtension.php @@ -14,8 +14,8 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\BootstrapBundle; -use WBW\Library\Core\Utility\Argument\ArrayUtility; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Button Twig extension. @@ -47,7 +47,7 @@ public function __construct() { * @return string Returns the Bootstrap button "Danger". */ public function bootstrapButtonDangerFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_DANGER, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_DANGER, ArrayHelper::get($args, "icon")); } /** @@ -57,7 +57,7 @@ public function bootstrapButtonDangerFunction(array $args = []) { * @return string Returns the Bootstrap button "Default". */ public function bootstrapButtonDefaultFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_DEFAULT, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_DEFAULT, ArrayHelper::get($args, "icon")); } /** @@ -67,7 +67,7 @@ public function bootstrapButtonDefaultFunction(array $args = []) { * @return string Returns the Bootstrap button "Info". */ public function bootstrapButtonInfoFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_INFO, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_INFO, ArrayHelper::get($args, "icon")); } /** @@ -81,7 +81,7 @@ public function bootstrapButtonInfoFunction(array $args = []) { public function bootstrapButtonLinkFilter($button, $href = self::DEFAULT_HREF, $target = null) { $searches = [""]; $replaces = [""]; - return StringUtility::replace($button, $searches, $replaces); + return StringHelper::replace($button, $searches, $replaces); } /** @@ -91,7 +91,7 @@ public function bootstrapButtonLinkFilter($button, $href = self::DEFAULT_HREF, $ * @return string Returns the Bootstrap button "Link". */ public function bootstrapButtonLinkFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-link", ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-link", ArrayHelper::get($args, "icon")); } /** @@ -101,7 +101,7 @@ public function bootstrapButtonLinkFunction(array $args = []) { * @return string Returns the Bootstrap button "Primary". */ public function bootstrapButtonPrimaryFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_PRIMARY, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_PRIMARY, ArrayHelper::get($args, "icon")); } /** @@ -111,7 +111,7 @@ public function bootstrapButtonPrimaryFunction(array $args = []) { * @return string Returns the Bootstrap button transformed into a submit button. */ public function bootstrapButtonSubmitFilter($bootstrapButton) { - return StringUtility::replace($bootstrapButton, ["type=\"button\""], ["type=\"submit\""]); + return StringHelper::replace($bootstrapButton, ["type=\"button\""], ["type=\"submit\""]); } /** @@ -121,7 +121,7 @@ public function bootstrapButtonSubmitFilter($bootstrapButton) { * @return string Returns the Bootstrap button "Success". */ public function bootstrapButtonSuccessFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_SUCCESS, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_SUCCESS, ArrayHelper::get($args, "icon")); } /** @@ -131,7 +131,7 @@ public function bootstrapButtonSuccessFunction(array $args = []) { * @return string Returns the Bootstrap button "Warning". */ public function bootstrapButtonWarningFunction(array $args = []) { - return $this->bootstrapButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "title"), ArrayUtility::get($args, "size", false), ArrayUtility::get($args, "block", false), ArrayUtility::get($args, "active", false), ArrayUtility::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_WARNING, ArrayUtility::get($args, "icon")); + return $this->bootstrapButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "title"), ArrayHelper::get($args, "size", false), ArrayHelper::get($args, "block", false), ArrayHelper::get($args, "active", false), ArrayHelper::get($args, "disable", false), "btn-" . BootstrapBundle::BOOTSTRAP_WARNING, ArrayHelper::get($args, "icon")); } /** diff --git a/Twig/Extension/CSS/CodeTwigExtension.php b/Twig/Extension/CSS/CodeTwigExtension.php index 3940d948..2ce66541 100644 --- a/Twig/Extension/CSS/CodeTwigExtension.php +++ b/Twig/Extension/CSS/CodeTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\CSS; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Code Twig extension. @@ -44,7 +44,7 @@ public function __construct() { * @return string Returns the Bootstrap basic block. */ public function bootstrapBasicBlockFunction(array $args = []) { - return $this->bootstrapBasicBlock(ArrayUtility::get($args, "content")); + return $this->bootstrapBasicBlock(ArrayHelper::get($args, "content")); } /** @@ -54,7 +54,7 @@ public function bootstrapBasicBlockFunction(array $args = []) { * @return string Returns the Bootstrap inline. */ public function bootstrapInlineFunction(array $args = []) { - return $this->bootstrapInline(ArrayUtility::get($args, "content")); + return $this->bootstrapInline(ArrayHelper::get($args, "content")); } /** @@ -64,7 +64,7 @@ public function bootstrapInlineFunction(array $args = []) { * @return string Returns the Bootstrap smaple output. */ public function bootstrapSampleOutputFunction(array $args = []) { - return $this->bootstrapSampleOutput(ArrayUtility::get($args, "content")); + return $this->bootstrapSampleOutput(ArrayHelper::get($args, "content")); } /** @@ -74,7 +74,7 @@ public function bootstrapSampleOutputFunction(array $args = []) { * @return string Returns the Bootstrap user input. */ public function bootstrapUserInputFunction(array $args = []) { - return $this->bootstrapUserInput(ArrayUtility::get($args, "content")); + return $this->bootstrapUserInput(ArrayHelper::get($args, "content")); } /** @@ -84,7 +84,7 @@ public function bootstrapUserInputFunction(array $args = []) { * @return string Returns the Bootstrap variable. */ public function bootstrapVariableFunction(array $args = []) { - return $this->bootstrapVariable(ArrayUtility::get($args, "content")); + return $this->bootstrapVariable(ArrayHelper::get($args, "content")); } /** diff --git a/Twig/Extension/CSS/GridTwigExtension.php b/Twig/Extension/CSS/GridTwigExtension.php index 42d153e0..27d12bad 100644 --- a/Twig/Extension/CSS/GridTwigExtension.php +++ b/Twig/Extension/CSS/GridTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\CSS; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Grid Twig extension. @@ -64,7 +64,7 @@ public function bootstrapGridFunction(array $args = []) { * @return string Returns the Bootstrap grid with offset. */ public function bootstrapGridOffsetFunction(array $args = []) { - return $this->bootstrapGrid(ArrayUtility::get($args, "lgOffset"), ArrayUtility::get($args, "mdOffset"), ArrayUtility::get($args, "smOffset"), ArrayUtility::get($args, "xsOffset"), ArrayUtility::get($args, "recopyOffset", false), "offset-"); + return $this->bootstrapGrid(ArrayHelper::get($args, "lgOffset"), ArrayHelper::get($args, "mdOffset"), ArrayHelper::get($args, "smOffset"), ArrayHelper::get($args, "xsOffset"), ArrayHelper::get($args, "recopyOffset", false), "offset-"); } /** @@ -74,7 +74,7 @@ public function bootstrapGridOffsetFunction(array $args = []) { * @return string Returns the Bootstrap grid with pull. */ public function bootstrapGridPullFunction(array $args = []) { - return $this->bootstrapGrid(ArrayUtility::get($args, "lgPull"), ArrayUtility::get($args, "mdPull"), ArrayUtility::get($args, "smPull"), ArrayUtility::get($args, "xsPull"), ArrayUtility::get($args, "recopyPull", false), "pull-"); + return $this->bootstrapGrid(ArrayHelper::get($args, "lgPull"), ArrayHelper::get($args, "mdPull"), ArrayHelper::get($args, "smPull"), ArrayHelper::get($args, "xsPull"), ArrayHelper::get($args, "recopyPull", false), "pull-"); } /** @@ -84,7 +84,7 @@ public function bootstrapGridPullFunction(array $args = []) { * @return string Returns the Bootstrap grid with push. */ public function bootstrapGridPushFunction(array $args = []) { - return $this->bootstrapGrid(ArrayUtility::get($args, "lgPush"), ArrayUtility::get($args, "mdPush"), ArrayUtility::get($args, "smPush"), ArrayUtility::get($args, "xsPush"), ArrayUtility::get($args, "recopyPush", false), "push-"); + return $this->bootstrapGrid(ArrayHelper::get($args, "lgPush"), ArrayHelper::get($args, "mdPush"), ArrayHelper::get($args, "smPush"), ArrayHelper::get($args, "xsPush"), ArrayHelper::get($args, "recopyPush", false), "push-"); } /** @@ -94,7 +94,7 @@ public function bootstrapGridPushFunction(array $args = []) { * @return string Returns the Bootstrap grid with stacked-to-horizontal. */ public function bootstrapGridStackedFunction(array $args = []) { - return $this->bootstrapGrid(ArrayUtility::get($args, "lg"), ArrayUtility::get($args, "md"), ArrayUtility::get($args, "sm"), ArrayUtility::get($args, "xs"), ArrayUtility::get($args, "recopy", false), ""); + return $this->bootstrapGrid(ArrayHelper::get($args, "lg"), ArrayHelper::get($args, "md"), ArrayHelper::get($args, "sm"), ArrayHelper::get($args, "xs"), ArrayHelper::get($args, "recopy", false), ""); } /** diff --git a/Twig/Extension/CSS/ImageTwigExtension.php b/Twig/Extension/CSS/ImageTwigExtension.php index 27fbe5dd..723bb953 100644 --- a/Twig/Extension/CSS/ImageTwigExtension.php +++ b/Twig/Extension/CSS/ImageTwigExtension.php @@ -15,7 +15,7 @@ use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Serializer\Normalizer\DataUriNormalizer; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Image Twig extension. @@ -82,10 +82,10 @@ private function base64Encode($uri) { public function bootstrapImageBase64Function(array $args = []) { // Initialize the src. - $src = $this->base64Encode(ArrayUtility::get($args, "src")); + $src = $this->base64Encode(ArrayHelper::get($args, "src")); // Return the Bootstrap image. - return $this->bootstrapImage($src, ArrayUtility::get($args, "alt"), ArrayUtility::get($args, "width"), ArrayUtility::get($args, "height"), ArrayUtility::get($args, "class"), ArrayUtility::get($args, "usemap")); + return $this->bootstrapImage($src, ArrayHelper::get($args, "alt"), ArrayHelper::get($args, "width"), ArrayHelper::get($args, "height"), ArrayHelper::get($args, "class"), ArrayHelper::get($args, "usemap")); } /** diff --git a/Twig/Extension/CSS/TypographyTwigExtension.php b/Twig/Extension/CSS/TypographyTwigExtension.php index a0d17e83..a331f54b 100644 --- a/Twig/Extension/CSS/TypographyTwigExtension.php +++ b/Twig/Extension/CSS/TypographyTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\CSS; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Typography Twig extension. @@ -44,7 +44,7 @@ public function __construct() { * @return string Returns the Bootstrap bold text. */ public function bootstrapBoldFunction(array $args = []) { - return $this->bootstrapBold(ArrayUtility::get($args, "content")); + return $this->bootstrapBold(ArrayHelper::get($args, "content")); } /** @@ -54,7 +54,7 @@ public function bootstrapBoldFunction(array $args = []) { * @return string Returns the Bootstrap deleted text. */ public function bootstrapDeletedFunction(array $args = []) { - return $this->bootstrapDeleted(ArrayUtility::get($args, "content")); + return $this->bootstrapDeleted(ArrayHelper::get($args, "content")); } /** @@ -64,7 +64,7 @@ public function bootstrapDeletedFunction(array $args = []) { * @return string Returns the Bootstrap heading 1. */ public function bootstrapHeading1Function(array $args = []) { - return $this->bootstrapHeading(1, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(1, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -74,7 +74,7 @@ public function bootstrapHeading1Function(array $args = []) { * @return string Returns the Bootstrap heading 2. */ public function bootstrapHeading2Function(array $args = []) { - return $this->bootstrapHeading(2, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(2, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -84,7 +84,7 @@ public function bootstrapHeading2Function(array $args = []) { * @return string Returns the Bootstrap heading 3. */ public function bootstrapHeading3Function(array $args = []) { - return $this->bootstrapHeading(3, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(3, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -94,7 +94,7 @@ public function bootstrapHeading3Function(array $args = []) { * @return string Returns the Bootstrap heading 4. */ public function bootstrapHeading4Function(array $args = []) { - return $this->bootstrapHeading(4, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(4, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -104,7 +104,7 @@ public function bootstrapHeading4Function(array $args = []) { * @return string Returns the Bootstrap heading 5. */ public function bootstrapHeading5Function(array $args = []) { - return $this->bootstrapHeading(5, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(5, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -114,7 +114,7 @@ public function bootstrapHeading5Function(array $args = []) { * @return string Returns the Bootstrap heading 6. */ public function bootstrapHeading6Function(array $args = []) { - return $this->bootstrapHeading(6, ArrayUtility::get($args, "content"), ArrayUtility::get($args, "description"), ArrayUtility::get($args, "class")); + return $this->bootstrapHeading(6, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class")); } /** @@ -124,7 +124,7 @@ public function bootstrapHeading6Function(array $args = []) { * @return string Returns the Bootstrap inserted text. */ public function bootstrapInsertedFunction(array $args = []) { - return $this->bootstrapInserted(ArrayUtility::get($args, "content")); + return $this->bootstrapInserted(ArrayHelper::get($args, "content")); } /** @@ -134,7 +134,7 @@ public function bootstrapInsertedFunction(array $args = []) { * @return string Returns the Bootstrap marked text. */ public function bootstrapMarkedFunction(array $args = []) { - return $this->bootstrapMarked(ArrayUtility::get($args, "content")); + return $this->bootstrapMarked(ArrayHelper::get($args, "content")); } /** @@ -144,7 +144,7 @@ public function bootstrapMarkedFunction(array $args = []) { * @return string Returns the Bootstrap italic text. */ public function bootstrapItalicFunction(array $args = []) { - return $this->bootstrapItalic(ArrayUtility::get($args, "content")); + return $this->bootstrapItalic(ArrayHelper::get($args, "content")); } /** @@ -154,7 +154,7 @@ public function bootstrapItalicFunction(array $args = []) { * @return string Returns the Bootstrap small text. */ public function bootstrapSmallFunction(array $args = []) { - return $this->bootstrapSmall(ArrayUtility::get($args, "content")); + return $this->bootstrapSmall(ArrayHelper::get($args, "content")); } /** @@ -164,7 +164,7 @@ public function bootstrapSmallFunction(array $args = []) { * @return string Returns the Bootstrap strike through text. */ public function bootstrapStrikeThroughFunction(array $args = []) { - return $this->bootstrapStrikeThrough(ArrayUtility::get($args, "content")); + return $this->bootstrapStrikeThrough(ArrayHelper::get($args, "content")); } /** @@ -174,7 +174,7 @@ public function bootstrapStrikeThroughFunction(array $args = []) { * @return string Returns the Bootstrap underlined text. */ public function bootstrapUnderlinedFunction(array $args = []) { - return $this->bootstrapUnderlined(ArrayUtility::get($args, "content")); + return $this->bootstrapUnderlined(ArrayHelper::get($args, "content")); } /** diff --git a/Twig/Extension/Component/AbstractDropdownTwigExtension.php b/Twig/Extension/Component/AbstractDropdownTwigExtension.php index 9611f0b0..2e498b87 100644 --- a/Twig/Extension/Component/AbstractDropdownTwigExtension.php +++ b/Twig/Extension/Component/AbstractDropdownTwigExtension.php @@ -13,7 +13,7 @@ use WBW\Bundle\BootstrapBundle\BootstrapBundle; use WBW\Bundle\BootstrapBundle\Twig\Extension\AbstractBootstrapTwigExtension; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Abstract dropdown Twig extension. @@ -55,7 +55,7 @@ protected function bootstrapDropdownButton($content, $id, $expanded, $class) { $attributes["id"][] = null !== $id ? $id : ""; $attributes["data-toggle"][] = "dropdown"; $attributes["aria-haspopup"][] = "true"; - $attributes["aria-expanded"][] = StringUtility::parseBoolean($expanded); + $attributes["aria-expanded"][] = StringHelper::parseBoolean($expanded); // Initialize the parameters. $innerHTML = (null !== $content ? $content : "") . ""; diff --git a/Twig/Extension/Component/AlertTwigExtension.php b/Twig/Extension/Component/AlertTwigExtension.php index c94de7be..7dc30e9c 100644 --- a/Twig/Extension/Component/AlertTwigExtension.php +++ b/Twig/Extension/Component/AlertTwigExtension.php @@ -14,7 +14,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\BootstrapBundle; use WBW\Bundle\BootstrapBundle\Navigation\NavigationInterface; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Alert Twig extension. @@ -46,7 +46,7 @@ public function __construct() { * @return string Returns the Bootstrap alert "Danger". */ public function bootstrapAlertDangerFunction(array $args = []) { - return $this->bootstrapAlert(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_DANGER); + return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_DANGER); } /** @@ -56,7 +56,7 @@ public function bootstrapAlertDangerFunction(array $args = []) { * @return string Returns the Bootstrap alert "Info". */ public function bootstrapAlertInfoFunction(array $args = []) { - return $this->bootstrapAlert(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_INFO); + return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_INFO); } /** @@ -70,10 +70,10 @@ public function bootstrapAlertLinkFunction(array $args = []) { // Initialize the attributes. $attributes = []; - $attributes["href"] = ArrayUtility::get($args, "href", NavigationInterface::NAVIGATION_HREF_DEFAULT); + $attributes["href"] = ArrayHelper::get($args, "href", NavigationInterface::NAVIGATION_HREF_DEFAULT); // Initialize the parameters. - $innerHTML = ArrayUtility::get($args, "content"); + $innerHTML = ArrayHelper::get($args, "content"); // Return the HTML. return self::bootstrapHTMLElement("a", $innerHTML, $attributes); @@ -86,7 +86,7 @@ public function bootstrapAlertLinkFunction(array $args = []) { * @return string Returns the Bootstrap alert "Success". */ public function bootstrapAlertSuccessFunction(array $args = []) { - return $this->bootstrapAlert(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_SUCCESS); + return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_SUCCESS); } /** @@ -96,7 +96,7 @@ public function bootstrapAlertSuccessFunction(array $args = []) { * @return string Returns the Bootstrap alert "Warning". */ public function bootstrapAlertWarningFunction(array $args = []) { - return $this->bootstrapAlert(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_WARNING); + return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapBundle::BOOTSTRAP_WARNING); } /** diff --git a/Twig/Extension/Component/BadgeTwigExtension.php b/Twig/Extension/Component/BadgeTwigExtension.php index 54cc877e..d7d18a6c 100644 --- a/Twig/Extension/Component/BadgeTwigExtension.php +++ b/Twig/Extension/Component/BadgeTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\Component; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Badge component Twig extension. @@ -44,7 +44,7 @@ public function __construct() { * @return string Returns the Bootstrap badge. */ public function bootstrapBadgeFunction(array $args = []) { - return $this->bootstrapBadge(ArrayUtility::get($args, "content")); + return $this->bootstrapBadge(ArrayHelper::get($args, "content")); } /** diff --git a/Twig/Extension/Component/DropdownTwigExtension.php b/Twig/Extension/Component/DropdownTwigExtension.php index 581dffc5..62a3a6a0 100644 --- a/Twig/Extension/Component/DropdownTwigExtension.php +++ b/Twig/Extension/Component/DropdownTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\Component; use Twig_SimpleFunction; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Dropdown Twig extension. @@ -44,7 +44,7 @@ public function __construct() { * @return string Returns the Bootstrap dropdown "Button". */ public function bootstrapDropdownButtonFunction(array $args = []) { - return $this->bootstrapDropdownButton(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "id"), ArrayUtility::get($args, "expanded", true), ArrayUtility::get($args, "class", "default")); + return $this->bootstrapDropdownButton(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "id"), ArrayHelper::get($args, "expanded", true), ArrayHelper::get($args, "class", "default")); } /** @@ -63,7 +63,7 @@ public function bootstrapDropdownDividerFunction() { * @return string Returns the Bootstrap dropdown "Header". */ public function bootstrapDropdownHeaderFunction(array $args = []) { - return $this->bootstrapDropdownHeader(ArrayUtility::get($args, "content")); + return $this->bootstrapDropdownHeader(ArrayHelper::get($args, "content")); } /** diff --git a/Twig/Extension/Component/GlyphiconTwigExtension.php b/Twig/Extension/Component/GlyphiconTwigExtension.php index 715a0a40..631df119 100644 --- a/Twig/Extension/Component/GlyphiconTwigExtension.php +++ b/Twig/Extension/Component/GlyphiconTwigExtension.php @@ -13,7 +13,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\IconRendererTwigExtensionInterface; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Glyphicon Twig extension. @@ -45,7 +45,7 @@ public function __construct() { * @return string Returns the Bootstrap glyphicon. */ public function bootstrapGlyphiconFunction(array $args = []) { - return $this->bootstrapGlyphicon(ArrayUtility::get($args, "name", "home"), ArrayUtility::get($args, "style")); + return $this->bootstrapGlyphicon(ArrayHelper::get($args, "name", "home"), ArrayHelper::get($args, "style")); } /** diff --git a/Twig/Extension/Component/LabelTwigExtension.php b/Twig/Extension/Component/LabelTwigExtension.php index 81dab185..758cee2e 100644 --- a/Twig/Extension/Component/LabelTwigExtension.php +++ b/Twig/Extension/Component/LabelTwigExtension.php @@ -13,7 +13,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\BootstrapBundle; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Label Twig extension. @@ -45,7 +45,7 @@ public function __construct() { * @return string Returns the Bootstrap label "Danger". */ public function bootstrapLabelDangerFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_DANGER); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_DANGER); } /** @@ -55,7 +55,7 @@ public function bootstrapLabelDangerFunction(array $args = []) { * @return string Returns the Bootstrap label "Default". */ public function bootstrapLabelDefaultFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_DEFAULT); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_DEFAULT); } /** @@ -65,7 +65,7 @@ public function bootstrapLabelDefaultFunction(array $args = []) { * @return string Returns the Bootstrap label "Info". */ public function bootstrapLabelInfoFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_INFO); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_INFO); } /** @@ -75,7 +75,7 @@ public function bootstrapLabelInfoFunction(array $args = []) { * @return string Returns the Bootstrap label "Primary". */ public function bootstrapLabelPrimaryFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_PRIMARY); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_PRIMARY); } /** @@ -85,7 +85,7 @@ public function bootstrapLabelPrimaryFunction(array $args = []) { * @return string Returns the Bootstrap label "Success". */ public function bootstrapLabelSuccessFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_SUCCESS); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_SUCCESS); } /** @@ -95,7 +95,7 @@ public function bootstrapLabelSuccessFunction(array $args = []) { * @return string Returns the Bootstrap label "Warning". */ public function bootstrapLabelWarningFunction(array $args = []) { - return $this->bootstrapLabel(ArrayUtility::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_WARNING); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapBundle::BOOTSTRAP_WARNING); } /** diff --git a/Twig/Extension/Component/ProgressBarTwigExtension.php b/Twig/Extension/Component/ProgressBarTwigExtension.php index 5de6d16c..79d4ee89 100644 --- a/Twig/Extension/Component/ProgressBarTwigExtension.php +++ b/Twig/Extension/Component/ProgressBarTwigExtension.php @@ -13,7 +13,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\BootstrapBundle; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Progress bar Twig extension. @@ -45,7 +45,7 @@ public function __construct() { * @return string Returns the Bootstrap progress bar "Basic". */ public function bootstrapProgressBarBasicFunction(array $args = []) { - return $this->bootstrapProgressBar(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "value", 50), ArrayUtility::get($args, "min", 0), ArrayUtility::get($args, "max", 100), ArrayUtility::get($args, "striped", false), ArrayUtility::get($args, "animated", false)); + return $this->bootstrapProgressBar(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "value", 50), ArrayHelper::get($args, "min", 0), ArrayHelper::get($args, "max", 100), ArrayHelper::get($args, "striped", false), ArrayHelper::get($args, "animated", false)); } /** @@ -55,7 +55,7 @@ public function bootstrapProgressBarBasicFunction(array $args = []) { * @return string Returns the Bootstrap progress bar "Danger". */ public function bootstrapProgressBarDangerFunction(array $args = []) { - return $this->bootstrapProgressBar(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "value", 50), ArrayUtility::get($args, "min", 0), ArrayUtility::get($args, "max", 100), ArrayUtility::get($args, "striped", false), ArrayUtility::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_DANGER); + return $this->bootstrapProgressBar(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "value", 50), ArrayHelper::get($args, "min", 0), ArrayHelper::get($args, "max", 100), ArrayHelper::get($args, "striped", false), ArrayHelper::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_DANGER); } /** @@ -65,7 +65,7 @@ public function bootstrapProgressBarDangerFunction(array $args = []) { * @return string Returns the Bootstrap progress bar "Info". */ public function bootstrapProgressBarInfoFunction(array $args = []) { - return $this->bootstrapProgressBar(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "value", 50), ArrayUtility::get($args, "min", 0), ArrayUtility::get($args, "max", 100), ArrayUtility::get($args, "striped", false), ArrayUtility::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_INFO); + return $this->bootstrapProgressBar(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "value", 50), ArrayHelper::get($args, "min", 0), ArrayHelper::get($args, "max", 100), ArrayHelper::get($args, "striped", false), ArrayHelper::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_INFO); } /** @@ -75,7 +75,7 @@ public function bootstrapProgressBarInfoFunction(array $args = []) { * @return string Returns the Bootstrap progress bar "Success". */ public function bootstrapProgressBarSuccessFunction(array $args = []) { - return $this->bootstrapProgressBar(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "value", 50), ArrayUtility::get($args, "min", 0), ArrayUtility::get($args, "max", 100), ArrayUtility::get($args, "striped", false), ArrayUtility::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_SUCCESS); + return $this->bootstrapProgressBar(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "value", 50), ArrayHelper::get($args, "min", 0), ArrayHelper::get($args, "max", 100), ArrayHelper::get($args, "striped", false), ArrayHelper::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_SUCCESS); } /** @@ -85,7 +85,7 @@ public function bootstrapProgressBarSuccessFunction(array $args = []) { * @return string Returns the Bootstrap progress bar "Warning". */ public function bootstrapProgressBarWarningFunction(array $args = []) { - return $this->bootstrapProgressBar(ArrayUtility::get($args, "content"), ArrayUtility::get($args, "value", 50), ArrayUtility::get($args, "min", 0), ArrayUtility::get($args, "max", 100), ArrayUtility::get($args, "striped", false), ArrayUtility::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_WARNING); + return $this->bootstrapProgressBar(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "value", 50), ArrayHelper::get($args, "min", 0), ArrayHelper::get($args, "max", 100), ArrayHelper::get($args, "striped", false), ArrayHelper::get($args, "animated", false), "progress-bar-" . BootstrapBundle::BOOTSTRAP_WARNING); } /** diff --git a/Twig/Extension/Plugin/AbstractJQueryInputMaskTwigExtension.php b/Twig/Extension/Plugin/AbstractJQueryInputMaskTwigExtension.php index 80f47a2c..81ef8e2f 100644 --- a/Twig/Extension/Plugin/AbstractJQueryInputMaskTwigExtension.php +++ b/Twig/Extension/Plugin/AbstractJQueryInputMaskTwigExtension.php @@ -13,7 +13,7 @@ use WBW\Bundle\BootstrapBundle\Twig\Extension\AbstractBootstrapTwigExtension; use WBW\Bundle\BootstrapBundle\Twig\Extension\BootstrapRendererTwigExtension; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Abstract jQuery input mask Twig extension. @@ -65,7 +65,7 @@ protected function jQueryInputMask($selector, $mask, array $options, $scriptTag) $template = "$('%selector%').inputmask(\"%mask%\",%arguments%);"; // Initialize the parameters. - $innerHTML = StringUtility::replace($template, ["%selector%", "%mask%", "%arguments%"], [$selector, $mask, json_encode($options)]); + $innerHTML = StringHelper::replace($template, ["%selector%", "%mask%", "%arguments%"], [$selector, $mask, json_encode($options)]); // Return the HTML if (true === $scriptTag) { diff --git a/Twig/Extension/Plugin/AbstractMaterialDesignIconicFontTwigExtension.php b/Twig/Extension/Plugin/AbstractMaterialDesignIconicFontTwigExtension.php index d0ecaa2d..5b488990 100644 --- a/Twig/Extension/Plugin/AbstractMaterialDesignIconicFontTwigExtension.php +++ b/Twig/Extension/Plugin/AbstractMaterialDesignIconicFontTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\Plugin; use WBW\Bundle\BootstrapBundle\Twig\Extension\AbstractBootstrapTwigExtension; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Abstract Material Design Iconic Font Twig extension. @@ -97,7 +97,7 @@ protected function materialDesignIconicFontList($items) { protected function materialDesignIconicFontListIcon($icon, $content) { // Initialize the parameters. - $glyphicon = null !== $icon ? StringUtility::replace($icon, ["class=\"zmdi"], ["class=\"zmdi-hc-li zmdi"]) : ""; + $glyphicon = null !== $icon ? StringHelper::replace($icon, ["class=\"zmdi"], ["class=\"zmdi-hc-li zmdi"]) : ""; $innerHTML = null !== $content ? $content : ""; // Return the HTML. diff --git a/Twig/Extension/Plugin/FontAwesomeTwigExtension.php b/Twig/Extension/Plugin/FontAwesomeTwigExtension.php index 35a0a2ef..a654cd00 100644 --- a/Twig/Extension/Plugin/FontAwesomeTwigExtension.php +++ b/Twig/Extension/Plugin/FontAwesomeTwigExtension.php @@ -14,7 +14,7 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\IconRendererTwigExtensionInterface; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Font Awesome Twig extension. @@ -45,7 +45,7 @@ public function __construct() { * @return Returns the Font Awesome icon. */ public function fontAwesomeIconFunction(array $args = []) { - return $this->fontAwesomeIcon(ArrayUtility::get($args, "font"), ArrayUtility::get($args, "name", "home"), ArrayUtility::get($args, "size"), ArrayUtility::get($args, "fixedWidth", false), ArrayUtility::get($args, "bordered", false), ArrayUtility::get($args, "pull"), ArrayUtility::get($args, "animated"), ArrayUtility::get($args, "style")); + return $this->fontAwesomeIcon(ArrayHelper::get($args, "font"), ArrayHelper::get($args, "name", "home"), ArrayHelper::get($args, "size"), ArrayHelper::get($args, "fixedWidth", false), ArrayHelper::get($args, "bordered", false), ArrayHelper::get($args, "pull"), ArrayHelper::get($args, "animated"), ArrayHelper::get($args, "style")); } /** diff --git a/Twig/Extension/Plugin/JQueryInputMaskTwigExtension.php b/Twig/Extension/Plugin/JQueryInputMaskTwigExtension.php index 3769419f..1e0f16c2 100644 --- a/Twig/Extension/Plugin/JQueryInputMaskTwigExtension.php +++ b/Twig/Extension/Plugin/JQueryInputMaskTwigExtension.php @@ -13,7 +13,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\BootstrapRendererTwigExtension; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * jQuery Input mask Twig Extension. @@ -46,7 +46,7 @@ public function __construct(BootstrapRendererTwigExtension $renderer) { * @return string Returns the jQuery input mask. */ public function jQueryInputMaskFunction(array $args = []) { - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), ArrayUtility::get($args, "mask", ""), ArrayUtility::get($args, "opts", []), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), ArrayHelper::get($args, "mask", ""), ArrayHelper::get($args, "opts", []), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -57,7 +57,7 @@ public function jQueryInputMaskFunction(array $args = []) { */ public function jQueryInputMaskPhoneNumberFunction(array $args = []) { $defaultMask = "99 99 99 99 99"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -68,7 +68,7 @@ public function jQueryInputMaskPhoneNumberFunction(array $args = []) { */ public function jQueryInputMaskSIRETNumberFunction(array $args = []) { $defaultMask = "999 999 999 99999"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -79,7 +79,7 @@ public function jQueryInputMaskSIRETNumberFunction(array $args = []) { */ public function jQueryInputMaskSocialSecurityNumberFunction(array $args = []) { $defaultMask = "9 99 99 99 999 999 99"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -90,7 +90,7 @@ public function jQueryInputMaskSocialSecurityNumberFunction(array $args = []) { */ public function jQueryInputMaskTime12Function(array $args = []) { $defaultMask = "hh:mm t"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, array_merge($this->prepareOptions($args, null), ["hourFormat" => "12", "placeholder" => "__:__ _m"]), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, array_merge($this->prepareOptions($args, null), ["hourFormat" => "12", "placeholder" => "__:__ _m"]), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -101,7 +101,7 @@ public function jQueryInputMaskTime12Function(array $args = []) { */ public function jQueryInputMaskTime24Function(array $args = []) { $defaultMask = "hh:mm"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, array_merge($this->prepareOptions($args, null), ["hourFormat" => "24", "placeholder" => "__:__"]), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, array_merge($this->prepareOptions($args, null), ["hourFormat" => "24", "placeholder" => "__:__"]), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -112,7 +112,7 @@ public function jQueryInputMaskTime24Function(array $args = []) { */ public function jQueryInputMaskVATNumberFunction(array $args = []) { $defaultMask = "**999 999 999 99"; - return $this->jQueryInputMask(ArrayUtility::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayUtility::get($args, "scriptTag", false)); + return $this->jQueryInputMask(ArrayHelper::get($args, "selector"), $defaultMask, $this->prepareOptions($args, $defaultMask), ArrayHelper::get($args, "scriptTag", false)); } /** @@ -142,10 +142,10 @@ public function getFunctions() { private function prepareOptions(array $args, $defaultMask) { // Initialize the options. - $options = ArrayUtility::get($args, "opts", []); + $options = ArrayHelper::get($args, "opts", []); - $options["autoUnmask"] = ArrayUtility::get($options, "autoUnmask", true); - $options["removeMaskOnSubmit"] = ArrayUtility::get($options, "removeMaskOnSubmit", true); + $options["autoUnmask"] = ArrayHelper::get($options, "autoUnmask", true); + $options["removeMaskOnSubmit"] = ArrayHelper::get($options, "removeMaskOnSubmit", true); if (null !== $defaultMask) { $options["placeholder"] = preg_replace("/[^\ ][.]*/", "_", $defaultMask); } diff --git a/Twig/Extension/Plugin/MaterialDesignIconicFontTwigExtension.php b/Twig/Extension/Plugin/MaterialDesignIconicFontTwigExtension.php index 42ff3ad2..026b0fbf 100644 --- a/Twig/Extension/Plugin/MaterialDesignIconicFontTwigExtension.php +++ b/Twig/Extension/Plugin/MaterialDesignIconicFontTwigExtension.php @@ -14,7 +14,7 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\IconRendererTwigExtensionInterface; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Material Design Iconic Font Twig extension. @@ -68,7 +68,7 @@ public function getFunctions() { * @return Returns the Material Design Iconic Font icon. */ public function materialDesignIconicFontIconFunction(array $args = []) { - return $this->materialDesignIconicFontIcon(ArrayUtility::get($args, "name", "home"), ArrayUtility::get($args, "size"), ArrayUtility::get($args, "fixedWidth", false), ArrayUtility::get($args, "border", false), ArrayUtility::get($args, "pull"), ArrayUtility::get($args, "spin"), ArrayUtility::get($args, "rotate"), ArrayUtility::get($args, "flip"), ArrayUtility::get($args, "style")); + return $this->materialDesignIconicFontIcon(ArrayHelper::get($args, "name", "home"), ArrayHelper::get($args, "size"), ArrayHelper::get($args, "fixedWidth", false), ArrayHelper::get($args, "border", false), ArrayHelper::get($args, "pull"), ArrayHelper::get($args, "spin"), ArrayHelper::get($args, "rotate"), ArrayHelper::get($args, "flip"), ArrayHelper::get($args, "style")); } /** diff --git a/Twig/Extension/Plugin/MeteoconsTwigExtension.php b/Twig/Extension/Plugin/MeteoconsTwigExtension.php index 091c2210..52652cc1 100644 --- a/Twig/Extension/Plugin/MeteoconsTwigExtension.php +++ b/Twig/Extension/Plugin/MeteoconsTwigExtension.php @@ -13,7 +13,7 @@ use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\IconRendererTwigExtensionInterface; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Meteocons Twig extension. @@ -55,7 +55,7 @@ public function getFunctions() { * @return string Returns a Meteocons icon. */ public function meteoconsIconFunction(array $args = []) { - return $this->meteoconsIcon(ArrayUtility::get($args, "name", "A"), ArrayUtility::get($args, "style")); + return $this->meteoconsIcon(ArrayHelper::get($args, "name", "A"), ArrayHelper::get($args, "style")); } /** diff --git a/Twig/Extension/Utility/FormButtonTwigExtension.php b/Twig/Extension/Utility/FormButtonTwigExtension.php index 8f49dad3..d3d2ba50 100644 --- a/Twig/Extension/Utility/FormButtonTwigExtension.php +++ b/Twig/Extension/Utility/FormButtonTwigExtension.php @@ -14,7 +14,7 @@ use Symfony\Component\Translation\TranslatorInterface; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\CSS\ButtonTwigExtension; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Form button Twig extension. @@ -64,7 +64,7 @@ public function bootstrapFormButtonCancelFunction(array $args = []) { $but = $this->getExtension()->bootstrapButtonDefaultFunction(["content" => $txt, "title" => $txt, "icon" => "remove"]); // Return the HTML. - return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayUtility::get($args, "href", self::DEFAULT_HREF)); + return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayHelper::get($args, "href", self::DEFAULT_HREF)); } /** @@ -76,7 +76,7 @@ public function bootstrapFormButtonCancelFunction(array $args = []) { public function bootstrapFormButtonDefaultFunction(array $args = []) { // Initialize the buttons. - $cancelButton = $this->bootstrapFormButtonCancelFunction(["href" => ArrayUtility::get($args, "cancel_href")]); + $cancelButton = $this->bootstrapFormButtonCancelFunction(["href" => ArrayHelper::get($args, "cancel_href")]); $submitButton = $this->bootstrapFormButtonSubmitFunction(); // Return the HTML. diff --git a/Twig/Extension/Utility/RoleLabelTwigExtension.php b/Twig/Extension/Utility/RoleLabelTwigExtension.php index d4d6ee0f..be269325 100644 --- a/Twig/Extension/Utility/RoleLabelTwigExtension.php +++ b/Twig/Extension/Utility/RoleLabelTwigExtension.php @@ -16,7 +16,7 @@ use Symfony\Component\Translation\TranslatorInterface; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\Component\LabelTwigExtension; -use WBW\Library\Core\Utility\Argument\StringUtility; +use WBW\Library\Core\Helper\Argument\StringHelper; /** * Role label Twig extension. @@ -62,7 +62,7 @@ public function __construct(TranslatorInterface $translator, LabelTwigExtension private function applyColor($label, $content, $color) { $searches = ">" . $content; $replaces = " style=\"background-color:" . $color . ";\"" . $searches; - return StringUtility::replace($label, [$searches], [$replaces]); + return StringHelper::replace($label, [$searches], [$replaces]); } /** @@ -133,7 +133,7 @@ public function getExtension() { * Set the extension. * * @param LabelTwigExtension $extension The extension. - * @return RoleLabelUtilityTwigExtension Returns this role label utility Twig extension. + * @return RoleLabelHelperTwigExtension Returns this role label utility Twig extension. */ protected function setExtension(LabelTwigExtension $extension) { $this->extension = $extension; diff --git a/Twig/Extension/Utility/TableButtonTwigExtension.php b/Twig/Extension/Utility/TableButtonTwigExtension.php index 4b8ce462..ff0619f2 100644 --- a/Twig/Extension/Utility/TableButtonTwigExtension.php +++ b/Twig/Extension/Utility/TableButtonTwigExtension.php @@ -14,7 +14,7 @@ use Symfony\Component\Translation\TranslatorInterface; use Twig_SimpleFunction; use WBW\Bundle\BootstrapBundle\Twig\Extension\CSS\ButtonTwigExtension; -use WBW\Library\Core\Utility\Argument\ArrayUtility; +use WBW\Library\Core\Helper\Argument\ArrayHelper; /** * Table button Twig extension. @@ -58,8 +58,8 @@ public function __construct(TranslatorInterface $translator, ButtonTwigExtension public function bootstrapRowButtonDefaultFunction(array $args = []) { // Initialize the buttons. - $editButton = $this->bootstrapRowButtonEditFunction(["href" => ArrayUtility::get($args, "edit_href")]); - $deleteButton = $this->bootstrapRowButtonDeleteFunction(["href" => ArrayUtility::get($args, "delete_href")]); + $editButton = $this->bootstrapRowButtonEditFunction(["href" => ArrayHelper::get($args, "edit_href")]); + $deleteButton = $this->bootstrapRowButtonDeleteFunction(["href" => ArrayHelper::get($args, "delete_href")]); // Return the HTML. return implode(" ", [$editButton, $deleteButton]); @@ -80,7 +80,7 @@ public function bootstrapRowButtonDeleteFunction(array $args = []) { $but = $this->getExtension()->bootstrapButtonDangerFunction(["title" => $txt, "icon" => "trash"]); // Return the HTML. - return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayUtility::get($args, "href", self::DEFAULT_HREF)); + return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayHelper::get($args, "href", self::DEFAULT_HREF)); } /** @@ -98,7 +98,7 @@ public function bootstrapRowButtonEditFunction(array $args = []) { $but = $this->getExtension()->bootstrapButtonDefaultFunction(["title" => $txt, "icon" => "pencil"]); // Return the HTML. - return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayUtility::get($args, "href", self::DEFAULT_HREF)); + return $this->getExtension()->bootstrapButtonLinkFilter($but, ArrayHelper::get($args, "href", self::DEFAULT_HREF)); } /** @@ -127,7 +127,7 @@ public function getFunctions() { * Set the extension. * * @param ButtonTwigExtension $extension The extension. - * @return TableButtonUtilityTwigExtension Returns this table button Twig extension. + * @return TableButtonHelperTwigExtension Returns this table button Twig extension. */ protected function setExtension(ButtonTwigExtension $extension) { $this->extension = $extension; diff --git a/composer.json b/composer.json index b9f99b70..d4b96bf6 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "symfony/serializer": "^2.6|^3.0", "symfony/translation": "^2.6|^3.0", "twig/twig": "^1.0||^2.0", - "webeweb/core-library": "^2.0", + "webeweb/core-library": "^3.0", "webeweb/syntaxhighlighter-bundle": "^1.0" }, "require-dev": {