]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/helper/html/links/class_HtmlLinkHelper.php
Continued:
[core.git] / framework / main / classes / helper / html / links / class_HtmlLinkHelper.php
index dcef00c9499257be5e446793e916aac632396186..6ad107220caa206dd40548c347328c5201861fa0 100644 (file)
@@ -5,7 +5,9 @@ namespace Org\Mxchange\CoreFramework\Helper;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Configuration\FrameworkConfiguration;
+use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
@@ -73,7 +75,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $helperInstance         A prepared instance of this helper
         * @throws      NoConfigEntryException  A deprecated exception at this point
         */
-       public static final function createHtmlLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = NULL) {
+       public static final function createHtmlLinkHelper (CompileableTemplate $templateInstance, string $linkName, $linkBase = NULL) {
                // Get new instance
                $helperInstance = new HtmlLinkHelper();
 
@@ -84,7 +86,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                $helperInstance->setLinkName($linkName);
 
                // Get the application instance
-               $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
+               $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Get the request instance
                $requestInstance = FrameworkBootstrap::getRequestInstance();
@@ -138,7 +140,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $extraContent   Optional extra HTML content
         * @return      $linkContent    Rendered text link content
         */
-       private function renderLinkContentWithTextExtraContent ($linkText, $linkTitle, $extraContent='') {
+       private function renderLinkContentWithTextExtraContent (string $linkText, string $linkTitle, string $extraContent = '') {
                // Construct link content
                $linkContent = sprintf('<a href="{?base_url?}/%s%s" title="%s">%s</a>',
                        $this->getLinkBase(),
@@ -157,8 +159,8 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $linkName       Name of the link we shall generate
         * @return      void
         */
-       protected final function setLinkName ($linkName) {
-               $this->linkName = (string) $linkName;
+       protected final function setLinkName (string $linkName) {
+               $this->linkName = $linkName;
        }
 
        /**
@@ -176,8 +178,8 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $linkBase       Base of the link we shall generate
         * @return      void
         */
-       protected final function setLinkBase ($linkBase) {
-               $this->linkBase = (string) $linkBase;
+       protected final function setLinkBase (string $linkBase) {
+               $this->linkBase = $linkBase;
        }
 
        /**
@@ -221,7 +223,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $groupCode      Code to open and close groups
         * @return      void
         */
-       public function addLinkGroup ($groupId, $groupText, $groupCode = 'div') {
+       public function addLinkGroup (string $groupId, string $groupText, string $groupCode = 'div') {
                // Is a group with that name open?
                if ($this->ifGroupOpenedPreviously()) {
                        // Then close it here
@@ -250,7 +252,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
-       public function addLinkNote ($groupId, $groupNote, $groupCode = 'div') {
+       public function addLinkNote (string $groupId, string $groupNote, string $groupCode = 'div') {
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
@@ -283,7 +285,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
-       protected function addActionLink ($linkAction, $linkText, $linkTitle) {
+       protected function addActionLink (string $linkAction, string $linkText, string $linkTitle) {
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
@@ -320,7 +322,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $languageId             Language id string to use
         * @return      void
         */
-       public function addActionLinkById ($linkAction, $languageId) {
+       public function addActionLinkById (string $linkAction, string $languageId) {
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');
 
@@ -338,7 +340,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $languageId             Language id string to use
         * @return      void
         */
-       public function addLinkWithTextById ($languageId) {
+       public function addLinkWithTextById (string $languageId) {
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');