[BUGFIX] Restore compatibility with PHP 7.0 65/58665/5
authorOliver Klee <typo3-coding@oliverklee.de>
Sat, 20 Oct 2018 15:32:34 +0000 (17:32 +0200)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 22 Oct 2018 17:38:16 +0000 (19:38 +0200)
As this version of the extension is marked as compatible with TYPO3 8.7,
it should also be compatible with the lowest PHP version required for
TYPO3 8.7, i.e., PHP 7.0.

Hence, there must not be any nullable return type declarations.

Also state compatibility with PHP 7.0.x up to 7.2.x in the `composer.json`.
(This also allows PhpStorm to automatically determine the PHP language
level.)

Resolves: #86710

Change-Id: I41a14355573e85f59155ab892f1373af9d345166
Reviewed-on: https://review.typo3.org/58665
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
Classes/Utility/LocalizationUtility.php
composer.json

index b1195c2..fb13375 100644 (file)
@@ -175,7 +175,6 @@ class LocalizationUtility
                                                        $labelFields[] = $labelField;
                                                }
                                        }
-                                       
                                }
                        }
                }
@@ -295,7 +294,7 @@ class LocalizationUtility
                        self::$languageKey = 'EN';
                }
        }
-       
+
        /**
         * Set the collating locale
         *
@@ -327,7 +326,7 @@ class LocalizationUtility
      *
      * @return \TYPO3\CMS\Core\Site\Entity\SiteLanguage|null
      */
-    protected static function getCurrentSiteLanguage(): ?\TYPO3\CMS\Core\Site\Entity\SiteLanguage
+    protected static function getCurrentSiteLanguage()
     {
         if ($GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface) {
             return $GLOBALS['TYPO3_REQUEST']->getAttribute('language', null);
index e6f4c17..594be16 100644 (file)
     }
   ],
   "keywords": [
-         "TYPO3"
+    "TYPO3"
   ],
   "homepage": "https://forge.typo3.org/projects/extension-static_info_tables",
   "support": {
-       "issues": "https://forge.typo3.org/projects/extension-static_info_tables/issues"
+    "issues": "https://forge.typo3.org/projects/extension-static_info_tables/issues"
   },
   "replace": {
     "static_info_tables": "self.version",
     "typo3-ter/static-info-tables": "self.version"
   },
   "require": {
-         "typo3/cms-core": ">=8.7,<10.0"
+    "php": ">= 7.0, <7.3",
+    "typo3/cms-core": ">=8.7, <10.0"
   },
   "autoload": {
     "psr-4": {