fix: resolve pre-existing PHPCS violations (Yoda conditions + short ternaries)
Fixes non-auto-fixable PHPCS errors surfaced by the estate reusable CI: - scripts/check-constants.php: Yoda conditions at lines 140, 201 - templates/admin/ideas-browser.php: Elvis (?:) → explicit ternary (line 75) - templates/admin/review-queue.php: Elvis (?:) → explicit ternaries (lines 144, 161-163) - templates/admin/metabox-generation-info.php: Elvis (?:) → explicit ternaries (7 lines) - .github/mu-plugins/prautoblogger-deploy-receiver.php: phpcs:ignore for ZipArchive->numFiles (native PHP property, can't be snake_cased); Elvis (?:) fix All violations were pre-existing; none introduced by this PR. Agent-Session: claude/adopt-ci-20260616
This commit is contained in:
@@ -137,7 +137,7 @@ $errors = array();
|
||||
|
||||
foreach ( $php_files as $php_path ) {
|
||||
$raw = file_get_contents( $php_path );
|
||||
if ( $raw === false ) {
|
||||
if ( false === $raw ) {
|
||||
fwrite( STDERR, "WARNING: cannot read {$php_path} -- skipping\n" );
|
||||
continue;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ foreach ( $php_files as $php_path ) {
|
||||
// 4. Report results.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
if ( $errors !== array() ) {
|
||||
if ( array() !== $errors ) {
|
||||
fwrite( STDERR, "\nFAIL -- Unguarded undefined PRAUTOBLOGGER_* constants:\n\n" );
|
||||
foreach ( $errors as [ $php_path, $lineno, $name, $line_text ] ) {
|
||||
fwrite( STDERR, " {$php_path}:{$lineno}: {$name}\n" );
|
||||
|
||||
Reference in New Issue
Block a user