Skip to content

Commit 95233c7

Browse files
committed
Shorten boolean logic in static-deploy.php
1 parent 2ec09c3 commit 95233c7

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

static-deploy.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,21 @@
2121
define( 'STATIC_DEPLOY_PATH', plugin_dir_path( __FILE__ ) );
2222

2323
if ( ! defined( 'STATIC_DEPLOY_DEBUG' ) ) {
24-
if (
25-
WP_DEBUG
26-
|| ( defined( 'WP_CLI' ) && WP_CLI::get_config( 'debug' ) )
27-
) {
28-
$enabled = true;
29-
} else {
30-
$enabled = false;
31-
}
24+
$enabled = WP_DEBUG || ( defined( 'WP_CLI' ) && WP_CLI::get_config( 'debug' ) );
3225
define( 'STATIC_DEPLOY_DEBUG', $enabled );
3326
}
3427

3528
if ( file_exists( STATIC_DEPLOY_PATH . 'vendor/autoload.php' ) ) {
3629
require_once STATIC_DEPLOY_PATH . 'vendor/autoload.php';
3730
}
3831

39-
if ( ! class_exists( \StaticDeploy\Controller::class ) ) {
40-
if ( file_exists( STATIC_DEPLOY_PATH . 'src/StaticDeployException.php' ) ) {
41-
require_once STATIC_DEPLOY_PATH . 'src/StaticDeployException.php';
42-
43-
throw new StaticDeploy\StaticDeployException(
44-
'Looks like you\'re trying to activate Static Deploy from source code' .
45-
', without compiling it first.'
46-
);
47-
}
32+
if ( ! class_exists( \StaticDeploy\Controller::class )
33+
&& file_exists( STATIC_DEPLOY_PATH . 'src/StaticDeployException.php' ) ) {
34+
require_once STATIC_DEPLOY_PATH . 'src/StaticDeployException.php';
35+
throw new StaticDeploy\StaticDeployException(
36+
'Looks like you\'re trying to activate Static Deploy from source code' .
37+
', without compiling it first.'
38+
);
4839
}
4940

5041
StaticDeploy\Controller::init();

0 commit comments

Comments
 (0)