From 43b314bcff8197b0f4961c8ed1f6e96dc01a90e7 Mon Sep 17 00:00:00 2001 From: AmooAti Date: Sun, 12 Dec 2021 01:34:56 +0330 Subject: [PATCH] update minimum php requirement and return type added to Requirment class --- README.md | 2 +- public/installer/Classes/Requirement.php | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 217fa37bd..3923af5eb 100755 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Take advantage of two of the hottest frameworks used in this project -- Laravel * **SERVER**: Apache 2 or NGINX. * **RAM**: 3 GB or higher. -* **PHP**: 7.3 or higher. +* **PHP**: 7.4 or higher. * **For MySQL users**: 5.7.23 or higher. * **For MariaDB users**: 10.2.7 or Higher. * **Node**: 8.11.3 LTS or higher. diff --git a/public/installer/Classes/Requirement.php b/public/installer/Classes/Requirement.php index 8919934ff..656513689 100755 --- a/public/installer/Classes/Requirement.php +++ b/public/installer/Classes/Requirement.php @@ -5,10 +5,9 @@ class Requirement { /** * Check for the server requirements. * - * @param array $requirements * @return array */ - public function checkRequirements() + public function checkRequirements(): array { // Server Requirements $requirements = [ @@ -73,14 +72,14 @@ class Requirement { * * @return array */ - public function checkPHPversion() + public function checkPHPVersion(): array { /** * Minimum PHP Version Supported (Override is in installer.php config file). * - * @var _minPhpVersion + * @var string _minPhpVersion */ - $_minPhpVersion = '7.3.0'; + $_minPhpVersion = '7.4.0'; $currentPhpVersion = $this->getPhpVersionInfo(); $supported = false; @@ -89,14 +88,12 @@ class Requirement { $supported = true; } - $phpStatus = [ + return [ 'full' => $currentPhpVersion['full'], 'current' => $currentPhpVersion['version'], 'minimum' => $_minPhpVersion, 'supported' => $supported ]; - - return $phpStatus; } /** @@ -104,7 +101,7 @@ class Requirement { * * @return array */ - private static function getPhpVersionInfo() + private static function getPhpVersionInfo(): array { $currentVersionFull = PHP_VERSION; preg_match("#^\d+(\.\d+)*#", $currentVersionFull, $filtered); @@ -121,7 +118,7 @@ class Requirement { * * @return array */ - public function composerInstall() + public function composerInstall(): array { $location = str_replace('\\', '/', getcwd()); $currentLocation = explode("/", $location);