[BUGFIX] UnableToLinkException::getLinkText() must be of the type string, null returned 99/57999/2
authorGerald Aistleitner <g.aistleitner@siwa.at>
Thu, 23 Aug 2018 06:28:58 +0000 (08:28 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 23 Aug 2018 10:43:54 +0000 (12:43 +0200)
Changed the default value of linkText to '' instead of null to prevent strict_type throwing an error.

Resolves: #85933
Releases: master, 8.7
Change-Id: I0a7567cd784360654649c11e686784ad3867858d
Reviewed-on: https://review.typo3.org/57999
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Typolink/UnableToLinkException.php

index fb7ea12..64525ca 100644 (file)
@@ -33,9 +33,9 @@ class UnableToLinkException extends Exception
      * @param string $message [optional] The Exception message to throw.
      * @param int $code [optional] The Exception code.
      * @param \Throwable $previous [optional] The previous throwable used for the exception chaining.
-     * @param string $linkText
+     * @param string $linkText [optional]
      */
-    public function __construct($message = '', $code = 0, \Throwable $previous = null, $linkText = null)
+    public function __construct($message = '', $code = 0, \Throwable $previous = null, $linkText = '')
     {
         parent::__construct($message, $code, $previous);
         $this->linkText = $linkText;