Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,45 @@ includes:
- tests/phpstan/baselines/arguments.count.neon
- tests/phpstan/baselines/assign.propertyType.neon
- tests/phpstan/baselines/binaryOp.invalid.neon
- tests/phpstan/baselines/booleanAnd.alwaysFalse.neon
- tests/phpstan/baselines/booleanAnd.alwaysTrue.neon
- tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
- tests/phpstan/baselines/booleanAnd.rightAlwaysFalse.neon
- tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon
- tests/phpstan/baselines/booleanNot.alwaysFalse.neon
- tests/phpstan/baselines/booleanNot.alwaysTrue.neon
- tests/phpstan/baselines/booleanOr.alwaysFalse.neon
- tests/phpstan/baselines/booleanOr.alwaysTrue.neon
- tests/phpstan/baselines/booleanOr.rightAlwaysTrue.neon
- tests/phpstan/baselines/catch.neverThrown.neon
- tests/phpstan/baselines/class.nameCase.neon
- tests/phpstan/baselines/class.notFound.neon
- tests/phpstan/baselines/deadCode.unreachable.neon
- tests/phpstan/baselines/empty.offset.neon
- tests/phpstan/baselines/empty.property.neon
- tests/phpstan/baselines/empty.variable.neon
- tests/phpstan/baselines/encapsedStringPart.nonString.neon
- tests/phpstan/baselines/foreach.nonIterable.neon
- tests/phpstan/baselines/function.alreadyNarrowedType.neon
- tests/phpstan/baselines/function.impossibleType.neon
- tests/phpstan/baselines/function.resultUnused.neon
- tests/phpstan/baselines/greater.invalid.neon
- tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon
- tests/phpstan/baselines/identical.alwaysFalse.neon
- tests/phpstan/baselines/identical.alwaysTrue.neon
- tests/phpstan/baselines/if.alwaysFalse.neon
- tests/phpstan/baselines/if.alwaysTrue.neon
- tests/phpstan/baselines/instanceof.alwaysTrue.neon
- tests/phpstan/baselines/isset.offset.neon
- tests/phpstan/baselines/isset.property.neon
- tests/phpstan/baselines/isset.variable.neon
- tests/phpstan/baselines/method.childParameterType.neon
- tests/phpstan/baselines/method.nonObject.neon
- tests/phpstan/baselines/method.notFound.neon
- tests/phpstan/baselines/method.unused.neon
- tests/phpstan/baselines/notIdentical.alwaysTrue.neon
- tests/phpstan/baselines/nullCoalesce.offset.neon
- tests/phpstan/baselines/nullCoalesce.property.neon
- tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon
- tests/phpstan/baselines/offsetAccess.notFound.neon
- tests/phpstan/baselines/offsetAssign.valueType.neon
Expand All @@ -43,23 +72,32 @@ includes:
- tests/phpstan/baselines/parameter.phpDocType.neon
- tests/phpstan/baselines/parameter.unresolvableType.neon
- tests/phpstan/baselines/parameterByRef.type.neon
- tests/phpstan/baselines/parameterByRef.unusedType.neon
- tests/phpstan/baselines/property.defaultValue.neon
- tests/phpstan/baselines/property.nonObject.neon
- tests/phpstan/baselines/property.notFound.neon
- tests/phpstan/baselines/property.onlyWritten.neon
- tests/phpstan/baselines/property.phpDocType.neon
- tests/phpstan/baselines/property.private.neon
- tests/phpstan/baselines/property.protected.neon
- tests/phpstan/baselines/property.unusedType.neon
- tests/phpstan/baselines/return.empty.neon
- tests/phpstan/baselines/return.missing.neon
- tests/phpstan/baselines/return.type.neon
- tests/phpstan/baselines/return.unusedType.neon
- tests/phpstan/baselines/smallerOrEqual.alwaysTrue.neon
- tests/phpstan/baselines/staticClassAccess.privateMethod.neon
- tests/phpstan/baselines/ternary.alwaysFalse.neon
- tests/phpstan/baselines/ternary.alwaysTrue.neon
- tests/phpstan/baselines/varTag.noVariable.neon
- tests/phpstan/baselines/variable.undefined.neon
- tests/phpstan/baselines/while.alwaysFalse.neon
- tests/phpstan/baselines/while.alwaysTrue.neon
# phpstan:baselines end

parameters:
# https://phpstan.org/user-guide/rule-levels
level: 3
level: 4
reportUnmatchedIgnoredErrors: true

# The following ignored errors are not intended to be fixed, as distinct from the baselines
Expand Down
30 changes: 30 additions & 0 deletions tests/phpstan/baselines/booleanAnd.alwaysFalse.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# PHPStan baseline for the `booleanAnd.alwaysFalse` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanAnd.alwaysFalse
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanAnd.alwaysFalse
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: ../../../src/wp-admin/themes.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
25 changes: 25 additions & 0 deletions tests/phpstan/baselines/booleanAnd.alwaysTrue.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PHPStan baseline for the `booleanAnd.alwaysTrue` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanAnd.alwaysTrue
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanAnd.alwaysTrue
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Result of && is always true\.$#'
identifier: booleanAnd.alwaysTrue
count: 2
path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php
45 changes: 45 additions & 0 deletions tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# PHPStan baseline for the `booleanAnd.leftAlwaysTrue` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanAnd.leftAlwaysTrue
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanAnd.leftAlwaysTrue
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 1
path: ../../../src/wp-admin/network/users.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 1
path: ../../../src/wp-admin/themes.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 1
path: ../../../src/wp-includes/block-template-utils.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 1
path: ../../../src/wp-includes/canonical.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 1
path: ../../../src/wp-includes/html-api/class-wp-html-processor.php
25 changes: 25 additions & 0 deletions tests/phpstan/baselines/booleanAnd.rightAlwaysFalse.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PHPStan baseline for the `booleanAnd.rightAlwaysFalse` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanAnd.rightAlwaysFalse
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanAnd.rightAlwaysFalse
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Right side of && is always false\.$#'
identifier: booleanAnd.rightAlwaysFalse
count: 1
path: ../../../src/wp-includes/class-wpdb.php
65 changes: 65 additions & 0 deletions tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# PHPStan baseline for the `booleanAnd.rightAlwaysTrue` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanAnd.rightAlwaysTrue
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanAnd.rightAlwaysTrue
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 1
path: ../../../src/wp-admin/includes/class-wp-site-health.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 1
path: ../../../src/wp-admin/includes/schema.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 1
path: ../../../src/wp-content/themes/twentynineteen/header.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 1
path: ../../../src/wp-includes/block-supports/typography.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 1
path: ../../../src/wp-includes/class-wp-walker.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 2
path: ../../../src/wp-includes/functions.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 3
path: ../../../src/wp-includes/l10n.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 4
path: ../../../src/wp-includes/load.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 2
path: ../../../src/wp-includes/user.php
50 changes: 50 additions & 0 deletions tests/phpstan/baselines/booleanNot.alwaysFalse.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# PHPStan baseline for the `booleanNot.alwaysFalse` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanNot.alwaysFalse
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanNot.alwaysFalse
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../../src/wp-admin/includes/theme.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../../src/wp-admin/link-manager.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 2
path: ../../../src/wp-admin/network/users.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../../src/wp-admin/plugins.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../../src/wp-includes/class-wp-comment-query.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../../src/wp-includes/nav-menu.php
60 changes: 60 additions & 0 deletions tests/phpstan/baselines/booleanNot.alwaysTrue.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# PHPStan baseline for the `booleanNot.alwaysTrue` errors in WordPress core.
#
# https://phpstan.org/error-identifiers/booleanNot.alwaysTrue
#
# Each entry is scoped to a single file and carries an exact occurrence count,
# so that a new instance is reported as a new error rather than being absorbed
# silently. Fixing an occurrence therefore means decrementing or removing its
# entry here as part of the same change.
#
# The goal is to empty this file and delete it, along with the `includes` entry
# for it in phpstan.neon.dist.
#
# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with
#
# composer phpstan:baselines -- --identifier=booleanNot.alwaysTrue
#
# which reruns the analysis with this file suppressed so the errors surface again.

parameters:
ignoreErrors:
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-admin/includes/class-custom-image-header.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-admin/includes/class-language-pack-upgrader.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-admin/includes/class-wp-upgrader.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-admin/includes/file.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-includes/class-wp-block-templates-registry.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-includes/class-wp-block.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-includes/general-template.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../src/wp-includes/option.php
Loading