Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Sep 17, 2023
1 parent 184d545 commit 988b115
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
42 changes: 24 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
if ( defined( 'ABSPATH' ) ) {
if ( defined( 'VENDOR_PATH' ) ) {
/** @psalm-suppress UnresolvableInclude, MixedOperand */
require constant( 'VENDOR_PATH' ) . '/vendor/autoload.php'; // NOSONAR
require_once constant( 'VENDOR_PATH' ) . '/vendor/autoload.php'; // NOSONAR
} elseif ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';
} elseif ( file_exists( ABSPATH . 'vendor/autoload.php' ) ) {
/** @psalm-suppress UnresolvableInclude */
require ABSPATH . 'vendor/autoload.php';
require_once ABSPATH . 'vendor/autoload.php';
}

Plugin::instance();
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- CLI
throw new Exception( "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh?" ); // NOSONAR
}

Expand Down
4 changes: 2 additions & 2 deletions tests/class-constant-mocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function clear(): void {

public static function define( string $constant, $value ): void {
if ( isset( self::$constants[ $constant ] ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- tests/CLI
throw new InvalidArgumentException( sprintf( 'Constant "%s" is already defined', $constant ) );
}

Expand All @@ -33,7 +33,7 @@ public static function defined( string $constant ): bool {

public static function constant( string $constant ) {
if ( ! isset( self::$constants[ $constant ] ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- tests/CLI
throw new InvalidArgumentException( sprintf( 'Constant "%s" is not defined', $constant ) );
}

Expand Down

0 comments on commit 988b115

Please sign in to comment.