Skip to content

Commit

Permalink
Fix PHPStan missing contant warning
Browse files Browse the repository at this point in the history
  • Loading branch information
doekenorg committed Jan 16, 2025
1 parent e06f329 commit acaf95c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gfexcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down Expand Up @@ -63,19 +69,13 @@
}

$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 ) ) {
$autoload_file = __DIR__ . '/vendor/autoload.php';
$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 ) {
Expand Down

0 comments on commit acaf95c

Please sign in to comment.