diff --git a/phpstan.neon.dist b/phpstan.neon.dist index fa1e3f209c322..b9b109b5d08fe 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -76,7 +76,6 @@ includes: - 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 diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php index dbdca575089fc..4dd5cb21c0cc5 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php @@ -15,14 +15,6 @@ * @see WP_REST_Autosaves_Controller */ class WP_REST_Template_Autosaves_Controller extends WP_REST_Autosaves_Controller { - /** - * Parent post type. - * - * @since 6.4.0 - * @var string - */ - private $parent_post_type; - /** * Parent post controller. * @@ -56,9 +48,8 @@ class WP_REST_Template_Autosaves_Controller extends WP_REST_Autosaves_Controller */ public function __construct( $parent_post_type ) { parent::__construct( $parent_post_type ); - $this->parent_post_type = $parent_post_type; - $post_type_object = get_post_type_object( $parent_post_type ); - $parent_controller = $post_type_object->get_rest_controller(); + $post_type_object = get_post_type_object( $parent_post_type ); + $parent_controller = $post_type_object->get_rest_controller(); if ( ! $parent_controller ) { $parent_controller = new WP_REST_Templates_Controller( $parent_post_type ); diff --git a/tests/phpstan/baselines/property.onlyWritten.neon b/tests/phpstan/baselines/property.onlyWritten.neon deleted file mode 100644 index f4b740e1bdf02..0000000000000 --- a/tests/phpstan/baselines/property.onlyWritten.neon +++ /dev/null @@ -1,25 +0,0 @@ -# PHPStan baseline for the `property.onlyWritten` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/property.onlyWritten -# -# 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=property.onlyWritten -# -# which reruns the analysis with this file suppressed so the errors surface again. - -parameters: - ignoreErrors: - - - message: '#^Property WP_REST_Template_Autosaves_Controller\:\:\$parent_post_type is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php