From acaf95c71c562b93dadfcf94b32595c5173c9325 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Thu, 16 Jan 2025 10:32:42 +0100 Subject: [PATCH] Fix PHPStan missing contant warning --- gfexcel.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gfexcel.php b/gfexcel.php index bbdfe7f..0127099 100644 --- a/gfexcel.php +++ b/gfexcel.php @@ -35,6 +35,12 @@ define( 'GFEXCEL_MIN_PHP_VERSION', '7.2' ); } +$src_folder = __DIR__ . '/build/vendor_prefixed/gravitykit/gravityexport-lite-src'; +if ( ! is_readable( $src_folder ) ) { + $src_folder = __DIR__ . '/src'; +} +define( 'GFEXCEL_SRC_FOLDER', $src_folder ); + if ( version_compare( phpversion(), GFEXCEL_MIN_PHP_VERSION, '<' ) ) { $show_minimum_php_version_message = function () { $message = wpautop( sprintf( esc_html__( 'GravityExport Lite requires PHP %s or newer.', 'gk-gravityexport-lite' ), GFEXCEL_MIN_PHP_VERSION ) ); @@ -63,7 +69,6 @@ } $autoload_file = __DIR__ . '/build/vendor/autoload.php'; - $src_folder = __DIR__ . '/build/vendor_prefixed/gravitykit/gravityexport-lite-src'; $is_build = true; if ( ! file_exists( $autoload_file ) ) { @@ -71,11 +76,6 @@ $is_build = false; } - if ( ! $is_build || ! is_readable( $src_folder ) ) { - $src_folder = __DIR__ . '/src'; - } - define( 'GFEXCEL_SRC_FOLDER', $src_folder ); - require_once $autoload_file; if ( $is_build ) {