Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/wp-admin/includes/class-wp-filesystem-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ public function chgrp( $file, $group, $recursive = false ) {
* @param bool $recursive Optional. If set to true, changes file permissions recursively.
* Default false.
* @return bool True on success, false on failure.
*
* @phpstan-impure
*/
public function chmod( $file, $mode = false, $recursive = false ) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
* @param mixed ...$args Optional further parameters, typically starting with an object ID.
* @return bool Whether the current user has the given capability. If `$capability` is a meta cap and `$object_id` is
* passed, whether the current user has the given meta capability for the given object.
*
* @phpstan-impure
*/
function current_user_can( $capability, ...$args ) {
return user_can( wp_get_current_user(), $capability, ...$args );
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ public function next_tag( $query = null ): bool {
* @since 6.7.2 Refactored so subclasses may extend.
*
* @return bool Whether a token was parsed.
*
* @phpstan-impure
*/
public function next_token(): bool {
return $this->next_visitable_token();
Expand Down
5 changes: 0 additions & 5 deletions tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@

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
Expand Down
20 changes: 0 additions & 20 deletions tests/phpstan/baselines/booleanNot.alwaysFalse.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,6 @@

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
Expand Down
20 changes: 0 additions & 20 deletions tests/phpstan/baselines/booleanNot.alwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,11 @@ parameters:
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
Expand Down
5 changes: 0 additions & 5 deletions tests/phpstan/baselines/booleanOr.alwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,3 @@ parameters:
identifier: booleanOr.alwaysTrue
count: 1
path: ../../../src/wp-includes/block-supports/position.php
-
message: '#^Result of \|\| is always true\.$#'
identifier: booleanOr.alwaysTrue
count: 1
path: ../../../src/wp-includes/class-wp-block.php
5 changes: 0 additions & 5 deletions tests/phpstan/baselines/deadCode.unreachable.neon
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ parameters:
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-includes/capabilities.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: ../../../src/wp-includes/class-wp-block.php
-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
Expand Down
10 changes: 0 additions & 10 deletions tests/phpstan/baselines/if.alwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@

parameters:
ignoreErrors:
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 1
path: ../../../src/wp-admin/my-sites.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 2
path: ../../../src/wp-admin/upload.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
Expand Down
5 changes: 0 additions & 5 deletions tests/phpstan/baselines/ternary.alwaysTrue.neon
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,3 @@ parameters:
identifier: ternary.alwaysTrue
count: 1
path: ../../../src/wp-admin/menu-header.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
count: 1
path: ../../../src/wp-admin/theme-install.php
Loading