diff --git a/index.php b/index.php index bf4102e0..1837a623 100755 --- a/index.php +++ b/index.php @@ -16,19 +16,10 @@ declare(strict_types=1); namespace Flextype; -use function define; use function getcwd; use function is_file; use function sprintf; use function str_replace; -use function version_compare; -use const DIRECTORY_SEPARATOR; -use const PHP_VERSION; - -/** - * Define the application minimum supported PHP version. - */ -define('FLEXTYPE_MINIMUM_PHP', '7.4.0'); /** * Define the PATH to the root directory (without trailing slash). @@ -43,11 +34,6 @@ define('PATH', [ 'tmp' => ROOT_DIR . '/var/tmp', ]); -/** - * Check PHP Version - */ -version_compare($ver = PHP_VERSION, $req = FLEXTYPE_MINIMUM_PHP, '<') and exit(sprintf('You are running PHP %s, but Flextype needs at least PHP %s to run.', $ver, $req)); - /** * Ensure vendor libraries exist */ diff --git a/src/flextype/flextype.php b/src/flextype/flextype.php index 0b761365..14c6ea23 100644 --- a/src/flextype/flextype.php +++ b/src/flextype/flextype.php @@ -55,6 +55,7 @@ use function container; use function count; use function date; use function date_default_timezone_set; +use function define; use function emitter; use function extension_loaded; use function file_exists; @@ -77,9 +78,18 @@ use function strings; use function sys_get_temp_dir; use function trim; use function var_export; +use function version_compare; +use const DIRECTORY_SEPARATOR; +use const PHP_VERSION; + +// Define the Flextype Application minimum supported PHP version. +define('FLEXTYPE_MINIMUM_PHP', '7.4.0'); + +// Check PHP Version +version_compare($ver = PHP_VERSION, $req = FLEXTYPE_MINIMUM_PHP, '<') and exit(sprintf('You are running PHP %s, but Flextype needs at least PHP %s to run.', $ver, $req)); // Init Flextype Instance. -// Creates $app Flextype Application and $container Flextype Application Container objects. +// Creates Flextype Application and Flextype Application Container objects. flextype(); // Create Flextype CLI Application