From ffdecfadf641b32475455fce545bcca815da217f Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Tue, 13 Sep 2022 12:32:43 +0100 Subject: [PATCH] Issue #3274474 by mondrake, longwave, andypost, Spokje, catch, alexpott: Fix 'Access to an undefined property' PHPStan L0 errors --- .../Cache/Context/CacheContextsManager.php | 5 + core/lib/Drupal/Core/Cache/PhpBackend.php | 8 +- .../Core/Config/Entity/Query/QueryFactory.php | 10 + .../Drupal/Core/Database/Query/Truncate.php | 14 - .../Entity/Controller/EntityController.php | 5 + .../Core/Entity/EntityResolverManager.php | 7 + .../Drupal/Core/Entity/Query/QueryBase.php | 5 + .../FinishResponseSubscriber.php | 4 +- .../RedirectResponseSubscriber.php | 5 + .../Field/FieldWidget/OptionsWidgetBase.php | 20 ++ .../Drupal/Core/Language/LanguageManager.php | 5 + .../Drupal/Core/Template/TwigNodeVisitor.php | 5 + .../Core/Test/PerformanceTestRecorder.php | 4 +- .../RecursiveContextualValidator.php | 5 + core/lib/Drupal/Core/Updater/Updater.php | 10 + .../Validation/ConstraintValidatorFactory.php | 5 + .../src/Plugin/migrate/process/BlockTheme.php | 5 + .../src/Plugin/Block/TestAccessBlock.php | 5 + .../views/field/StatisticsLastCommentName.php | 10 + .../views/field/StatisticsLastUpdated.php | 5 + .../views/filter/StatisticsLastUpdated.php | 5 + .../views/sort/StatisticsLastCommentName.php | 10 + .../views/sort/StatisticsLastUpdated.php | 10 + .../Plugin/Derivative/FieldUiLocalAction.php | 5 + .../Plugin/Field/FieldWidget/FileWidget.php | 5 + .../Plugin/migrate/process/d6/FieldFile.php | 5 + .../process/d6/FilterFormatPermission.php | 5 + .../Plugin/HelpSection/HelpTopicSection.php | 4 +- .../src/Functional/RestJsonApiUnsupported.php | 4 - .../src/LanguageNegotiationMethodManager.php | 5 + core/modules/locale/src/LocaleEvent.php | 2 +- .../src/Plugin/migrate/destination/Entity.php | 6 + .../migrate/destination/EntityContentBase.php | 7 - .../src/Plugin/migrate/process/Route.php | 5 + .../src/AcceptHeaderMiddleware.php | 5 + .../src/Controller/LonelyMonkeyController.php | 5 + .../src/LonelyMonkeyClass.php | 5 + .../src/MonkeysInTheControlRoom.php | 5 + core/modules/update/src/UpdateProcessor.php | 5 + .../user/src/Plugin/views/filter/Name.php | 5 + .../views/src/Plugin/views/PluginBase.php | 1 + .../Plugin/views/query/QueryPluginBase.php | 7 + .../views/src/Plugin/views/query/Sql.php | 10 +- .../src/Plugin/views/sort/GroupByNumeric.php | 6 + core/modules/views_ui/src/ViewUI.php | 6 +- core/phpstan-baseline.neon | 340 ------------------ .../demo_umami_content/src/InstallHelper.php | 5 + .../Bootstrap/UncaughtExceptionTest.php | 2 +- .../Drupal/KernelTests/RouteProvider.php | 6 + .../Commands/TestSiteInstallCommand.php | 30 ++ .../MTimeProtectedFastFileStorageTest.php | 2 +- .../MTimeProtectedFileStorageBase.php | 5 + .../MTimeProtectedFileStorageTest.php | 2 +- 53 files changed, 285 insertions(+), 387 deletions(-) diff --git a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php index cd88b24bf729..5df8a51c6ea8 100644 --- a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php @@ -36,6 +36,11 @@ class CacheContextsManager { */ protected $contexts; + /** + * The set of valid context tokens. + */ + protected array $validContextTokens; + /** * Constructs a CacheContextsManager object. * diff --git a/core/lib/Drupal/Core/Cache/PhpBackend.php b/core/lib/Drupal/Core/Cache/PhpBackend.php index 85935b0b618a..a6b69acface3 100644 --- a/core/lib/Drupal/Core/Cache/PhpBackend.php +++ b/core/lib/Drupal/Core/Cache/PhpBackend.php @@ -3,8 +3,9 @@ namespace Drupal\Core\Cache; use Drupal\Component\Assertion\Inspector; -use Drupal\Core\PhpStorage\PhpStorageFactory; +use Drupal\Component\PhpStorage\PhpStorageInterface; use Drupal\Component\Utility\Crypt; +use Drupal\Core\PhpStorage\PhpStorageFactory; /** * Defines a PHP cache implementation. @@ -26,6 +27,11 @@ class PhpBackend implements CacheBackendInterface { */ protected $bin; + /** + * The PHP storage. + */ + protected PhpStorageInterface $storage; + /** * Array to store cache objects. */ diff --git a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php index 889a535a1280..3322287c6e28 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php @@ -39,6 +39,16 @@ class QueryFactory implements QueryFactoryInterface, EventSubscriberInterface { */ protected $namespaces; + /** + * The key value factory. + */ + protected KeyValueFactoryInterface $keyValueFactory; + + /** + * The configuration manager. + */ + protected ConfigManagerInterface $configManager; + /** * Constructs a QueryFactory object. * diff --git a/core/lib/Drupal/Core/Database/Query/Truncate.php b/core/lib/Drupal/Core/Database/Query/Truncate.php index 66b39644b502..7cfce9cd7d3c 100644 --- a/core/lib/Drupal/Core/Database/Query/Truncate.php +++ b/core/lib/Drupal/Core/Database/Query/Truncate.php @@ -35,20 +35,6 @@ public function __construct(Connection $connection, $table, array $options = []) $this->table = $table; } - /** - * {@inheritdoc} - */ - public function compile(Connection $connection, PlaceholderInterface $queryPlaceholder) { - return $this->condition->compile($connection, $queryPlaceholder); - } - - /** - * {@inheritdoc} - */ - public function compiled() { - return $this->condition->compiled(); - } - /** * Executes the TRUNCATE query. * diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityController.php b/core/lib/Drupal/Core/Entity/Controller/EntityController.php index 4dd93475fb72..dc70185670c0 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityController.php @@ -62,6 +62,11 @@ class EntityController implements ContainerInjectionInterface { */ protected $renderer; + /** + * The url generator. + */ + protected UrlGeneratorInterface $urlGenerator; + /** * Constructs a new EntityController. * diff --git a/core/lib/Drupal/Core/Entity/EntityResolverManager.php b/core/lib/Drupal/Core/Entity/EntityResolverManager.php index 23fcebdf80e0..88baec68bd4c 100644 --- a/core/lib/Drupal/Core/Entity/EntityResolverManager.php +++ b/core/lib/Drupal/Core/Entity/EntityResolverManager.php @@ -28,6 +28,13 @@ class EntityResolverManager { */ protected $classResolver; + /** + * The list of all entity types. + * + * @var \Drupal\Core\Entity\EntityTypeInterface[] + */ + protected ?array $entityTypes; + /** * Constructs a new EntityRouteAlterSubscriber. * diff --git a/core/lib/Drupal/Core/Entity/Query/QueryBase.php b/core/lib/Drupal/Core/Entity/Query/QueryBase.php index 85878aa75cbc..e07ff552ecd0 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryBase.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php @@ -131,6 +131,11 @@ abstract class QueryBase implements QueryInterface { */ protected $namespaces = []; + /** + * Defines how the conditions on the query need to match. + */ + protected string $conjunction; + /** * Constructs this object. * diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php index 4aeeada30988..2879ae9eabbb 100644 --- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php @@ -51,10 +51,8 @@ class FinishResponseSubscriber implements EventSubscriberInterface { /** * The cache contexts manager service. - * - * @var \Drupal\Core\Cache\Context\CacheContextsManager */ - protected $cacheContexts; + protected CacheContextsManager $cacheContextsManager; /** * Whether to send cacheability headers for debugging purposes. diff --git a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php index 6add632887cc..0ee35bec1887 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php @@ -25,6 +25,11 @@ class RedirectResponseSubscriber implements EventSubscriberInterface { */ protected $unroutedUrlAssembler; + /** + * The request context. + */ + protected RequestContext $requestContext; + /** * Constructs a RedirectResponseSubscriber object. * diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php index 0a588017340b..ffbfeb2f710c 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php @@ -30,6 +30,26 @@ abstract class OptionsWidgetBase extends WidgetBase { */ protected $column; + /** + * Tracks whether the field is required. + */ + protected bool $required; + + /** + * Tracks whether the data is multi-valued. + */ + protected bool $multiple; + + /** + * Tracks whether the field has a value. + */ + protected bool $has_value; + + /** + * The array of options for the widget. + */ + protected array $options; + /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php index 915dac19f6be..63cb059f9417 100644 --- a/core/lib/Drupal/Core/Language/LanguageManager.php +++ b/core/lib/Drupal/Core/Language/LanguageManager.php @@ -32,6 +32,11 @@ class LanguageManager implements LanguageManagerInterface { */ protected $defaultLanguage; + /** + * Information about all defined language types. + */ + protected array $definedLanguageTypesInfo; + /** * Constructs the language manager. * diff --git a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php index 0429b6a31d4d..e73afdce240c 100644 --- a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php +++ b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php @@ -20,6 +20,11 @@ */ class TwigNodeVisitor extends AbstractNodeVisitor { + /** + * Tracks whether there is a render array aware filter active already. + */ + protected ?bool $skipRenderVarFunction; + /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Test/PerformanceTestRecorder.php b/core/lib/Drupal/Core/Test/PerformanceTestRecorder.php index e896df473749..2c7b62e98685 100644 --- a/core/lib/Drupal/Core/Test/PerformanceTestRecorder.php +++ b/core/lib/Drupal/Core/Test/PerformanceTestRecorder.php @@ -16,10 +16,8 @@ class PerformanceTestRecorder implements EventSubscriberInterface { /** * The state service for persistent storage if necessary. - * - * @var \Drupal\Core\State\StateInterface */ - protected $service; + protected ?StateInterface $state; /** * @var array diff --git a/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php b/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php index f0b885a10cf1..29efd63f7e47 100644 --- a/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php +++ b/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php @@ -52,6 +52,11 @@ class RecursiveContextualValidator implements ContextualValidatorInterface { */ protected $constraintValidatorFactory; + /** + * The typed data manager. + */ + protected TypedDataManagerInterface $typedDataManager; + /** * Creates a validator for the given context. * diff --git a/core/lib/Drupal/Core/Updater/Updater.php b/core/lib/Drupal/Core/Updater/Updater.php index 65c7409bbc62..402047fc9845 100644 --- a/core/lib/Drupal/Core/Updater/Updater.php +++ b/core/lib/Drupal/Core/Updater/Updater.php @@ -24,6 +24,16 @@ class Updater { */ protected $root; + /** + * The name of the project directory (basename). + */ + protected string $name; + + /** + * The title of the project. + */ + protected string $title; + /** * Constructs a new updater. * diff --git a/core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php b/core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php index 218033e58046..8960dd573d43 100644 --- a/core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php +++ b/core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php @@ -15,6 +15,11 @@ */ class ConstraintValidatorFactory extends BaseConstraintValidatorFactory { + /** + * The class resolver. + */ + protected ClassResolverInterface $classResolver; + /** * Constructs a new ConstraintValidatorFactory. * diff --git a/core/modules/block/src/Plugin/migrate/process/BlockTheme.php b/core/modules/block/src/Plugin/migrate/process/BlockTheme.php index 408f83be67e5..a1e935698ec5 100644 --- a/core/modules/block/src/Plugin/migrate/process/BlockTheme.php +++ b/core/modules/block/src/Plugin/migrate/process/BlockTheme.php @@ -31,6 +31,11 @@ class BlockTheme extends ProcessPluginBase implements ContainerFactoryPluginInte */ protected $themeConfig; + /** + * List of themes available on the destination. + */ + protected array $themes; + /** * Constructs a BlockTheme object. * diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestAccessBlock.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestAccessBlock.php index e558bcb90edb..4bb9f24cc0fd 100644 --- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestAccessBlock.php +++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestAccessBlock.php @@ -20,6 +20,11 @@ */ class TestAccessBlock extends BlockBase implements ContainerFactoryPluginInterface { + /** + * The state service. + */ + protected StateInterface $state; + /** * Tests the test access block. * diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php index f5e1835af512..58c3e16a6813 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php @@ -15,6 +15,16 @@ */ class StatisticsLastCommentName extends FieldPluginBase { + /** + * The users table. + */ + protected ?string $user_table; + + /** + * The user name field. + */ + protected string $user_field; + /** * The user id. */ diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php index a3788e0b53b8..95b6cb733f2b 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php @@ -13,6 +13,11 @@ */ class StatisticsLastUpdated extends Date { + /** + * The node table. + */ + protected ?string $node_table; + public function query() { $this->ensureMyTable(); $this->node_table = $this->query->ensureTable('node_field_data', $this->relationship); diff --git a/core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php index 046edf4c3fbe..194430567cbf 100644 --- a/core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php @@ -13,6 +13,11 @@ */ class StatisticsLastUpdated extends Date { + /** + * The node table. + */ + protected ?string $node_table; + public function query() { $this->ensureMyTable(); $this->node_table = $this->query->ensureTable('node', $this->relationship); diff --git a/core/modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php index 48f556e68ac7..1c8733898348 100644 --- a/core/modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php +++ b/core/modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php @@ -14,6 +14,16 @@ */ class StatisticsLastCommentName extends SortPluginBase { + /** + * The users table. + */ + protected ?string $user_table; + + /** + * The user name field. + */ + protected string $user_field; + public function query() { $this->ensureMyTable(); $definition = [ diff --git a/core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php index 0f9c055ec969..076cc0c744da 100644 --- a/core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php @@ -13,6 +13,16 @@ */ class StatisticsLastUpdated extends Date { + /** + * The node table. + */ + protected ?string $node_table; + + /** + * The field alias. + */ + protected string $field_alias; + public function query() { $this->ensureMyTable(); $this->node_table = $this->query->ensureTable('node', $this->relationship); diff --git a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalAction.php b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalAction.php index 533a911acf75..c572216c8559 100644 --- a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalAction.php +++ b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalAction.php @@ -16,6 +16,11 @@ class FieldUiLocalAction extends DeriverBase implements ContainerDeriverInterfac use StringTranslationTrait; + /** + * The route provider to load routes by name. + */ + protected RouteProviderInterface $routeProvider; + /** * The entity type manager. * diff --git a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php index bf6ceb061255..354fed1cf7ef 100644 --- a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php +++ b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php @@ -28,6 +28,11 @@ */ class FileWidget extends WidgetBase { + /** + * The element info manager. + */ + protected ElementInfoManagerInterface $elementInfo; + /** * {@inheritdoc} */ diff --git a/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php b/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php index 86987453de7e..eb378a09699a 100644 --- a/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php +++ b/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php @@ -17,6 +17,11 @@ */ class FieldFile extends ProcessPluginBase implements ContainerFactoryPluginInterface { + /** + * The current migration. + */ + protected MigrationInterface $migration; + /** * The migrate lookup service. * diff --git a/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php b/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php index 2e688aa71f3b..357d3562034f 100644 --- a/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php +++ b/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php @@ -20,6 +20,11 @@ */ class FilterFormatPermission extends ProcessPluginBase implements ContainerFactoryPluginInterface { + /** + * The current migration. + */ + protected MigrationInterface $migration; + /** * The migrate lookup service. * diff --git a/core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php b/core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php index 566aa1e3c964..b69782b7edbc 100644 --- a/core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php +++ b/core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php @@ -78,10 +78,8 @@ class HelpTopicSection extends HelpSectionPluginBase implements ContainerFactory /** * The string translation service. - * - * @var \Drupal\Core\StringTranslation\TranslationManager */ - protected $stringTranslation; + protected TranslationManager $translationManager; /** * Constructs a HelpTopicSection object. diff --git a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php index 77a2dcbab9c6..ec379ab881ad 100644 --- a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php +++ b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php @@ -65,10 +65,6 @@ protected function setUpAuthorization($method) { protected function setUp(): void { parent::setUp(); - // Set up a HTTP client that accepts relative URLs. - $this->httpClient = $this->container->get('http_client_factory') - ->fromOptions(['base_uri' => $this->baseUrl]); - // Create a "Camelids" node type. NodeType::create([ 'name' => 'Camelids', diff --git a/core/modules/language/src/LanguageNegotiationMethodManager.php b/core/modules/language/src/LanguageNegotiationMethodManager.php index 53b59ed724a2..3839c01b8a49 100644 --- a/core/modules/language/src/LanguageNegotiationMethodManager.php +++ b/core/modules/language/src/LanguageNegotiationMethodManager.php @@ -11,6 +11,11 @@ */ class LanguageNegotiationMethodManager extends DefaultPluginManager { + /** + * The cache key prefix. + */ + protected string $cacheKeyPrefix; + /** * Constructs a new LanguageNegotiationMethodManager object. * diff --git a/core/modules/locale/src/LocaleEvent.php b/core/modules/locale/src/LocaleEvent.php index 8851dddc4622..150b9f1744be 100644 --- a/core/modules/locale/src/LocaleEvent.php +++ b/core/modules/locale/src/LocaleEvent.php @@ -21,7 +21,7 @@ class LocaleEvent extends Event { * * @var string[] */ - protected $original; + protected array $lids; /** * Constructs a new LocaleEvent. diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php index 0e9668b54f27..3a2f93be4daa 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php @@ -4,6 +4,7 @@ use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Core\Entity\DependencyTrait; +use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\migrate\EntityFieldDefinitionTrait; @@ -70,6 +71,11 @@ abstract class Entity extends DestinationBase implements ContainerFactoryPluginI */ protected $storage; + /** + * The entity field manager. + */ + protected EntityFieldManagerInterface $entityFieldManager; + /** * The list of the bundles of this entity type. * diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php index 9d5e231c3f9e..da987d52231c 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php @@ -93,13 +93,6 @@ */ class EntityContentBase extends Entity implements HighestIdInterface, MigrateValidatableEntityInterface { - /** - * Entity field manager. - * - * @var \Drupal\Core\Entity\EntityFieldManagerInterface - */ - protected $entityFieldManager; - /** * Field type plugin manager. * diff --git a/core/modules/migrate/src/Plugin/migrate/process/Route.php b/core/modules/migrate/src/Plugin/migrate/process/Route.php index 63c10200727f..90f5d96ef5ea 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Route.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Route.php @@ -57,6 +57,11 @@ */ class Route extends ProcessPluginBase implements ContainerFactoryPluginInterface { + /** + * The current migration. + */ + protected MigrationInterface $migration; + /** * The path validator service. * diff --git a/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderMiddleware.php b/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderMiddleware.php index 112b61017998..3d01aa22efa8 100644 --- a/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderMiddleware.php +++ b/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderMiddleware.php @@ -11,6 +11,11 @@ */ class AcceptHeaderMiddleware implements HttpKernelInterface { + /** + * The app kernel. + */ + protected HttpKernelInterface $app; + /** * Constructs a new AcceptHeaderMiddleware instance. * diff --git a/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php b/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php index 4946417a4582..5a47af52b047 100644 --- a/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php +++ b/core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php @@ -12,6 +12,11 @@ */ class LonelyMonkeyController extends ControllerBase implements ContainerInjectionInterface { + /** + * The lonely monkey class. + */ + protected LonelyMonkeyClass $class; + public function __construct(LonelyMonkeyClass $class) { $this->class = $class; } diff --git a/core/modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php b/core/modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php index bbe1d6a191af..f033899306cb 100644 --- a/core/modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php +++ b/core/modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php @@ -9,6 +9,11 @@ */ class LonelyMonkeyClass { + /** + * The database connection. + */ + protected Connection $connection; + public function __construct(Connection $connection) { $this->connection = $connection; } diff --git a/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php b/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php index 7df8d810f927..2d08efc6fc9e 100644 --- a/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php +++ b/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php @@ -21,6 +21,11 @@ class MonkeysInTheControlRoom implements HttpKernelInterface { */ protected $app; + /** + * The settings. + */ + protected Settings $settings; + /** * MonkeysInTheControlRoom constructor. * diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php index 3f6b24ffba4d..a07a47c8f51b 100644 --- a/core/modules/update/src/UpdateProcessor.php +++ b/core/modules/update/src/UpdateProcessor.php @@ -78,6 +78,11 @@ class UpdateProcessor implements UpdateProcessorInterface { */ protected $privateKey; + /** + * The queue for fetching release history data. + */ + protected array $fetchTasks; + /** * Constructs an UpdateProcessor. * diff --git a/core/modules/user/src/Plugin/views/filter/Name.php b/core/modules/user/src/Plugin/views/filter/Name.php index 3ad018fa559c..9b4158bea1a7 100644 --- a/core/modules/user/src/Plugin/views/filter/Name.php +++ b/core/modules/user/src/Plugin/views/filter/Name.php @@ -18,6 +18,11 @@ class Name extends InOperator { protected $alwaysMultiple = TRUE; + /** + * The validated exposed input. + */ + protected array $validated_exposed_input; + protected function valueForm(&$form, FormStateInterface $form_state) { $users = $this->value ? User::loadMultiple($this->value) : []; $default_value = EntityAutocomplete::getEntityLabels($users); diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php index dca963397381..a935b8d5d702 100644 --- a/core/modules/views/src/Plugin/views/PluginBase.php +++ b/core/modules/views/src/Plugin/views/PluginBase.php @@ -135,6 +135,7 @@ public static function create(ContainerInterface $container, array $configuratio */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { $this->view = $view; + $this->options = $this->options ?? []; $this->setOptionDefaults($this->options, $this->defineOptions()); $this->displayHandler = $display; diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php index 75d5d66b642f..639a249e6109 100644 --- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php @@ -52,6 +52,13 @@ abstract class QueryPluginBase extends PluginBase implements CacheableDependency */ public int $offset; + /** + * Controls how the WHERE and HAVING groups are put together. + * + * @var string + */ + protected $groupOperator; + /** * Generate a query and a countquery from all of the information supplied * to the object. diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php index 4cd99a8671f0..28571aecfe89 100644 --- a/core/modules/views/src/Plugin/views/query/Sql.php +++ b/core/modules/views/src/Plugin/views/query/Sql.php @@ -58,13 +58,6 @@ class Sql extends QueryPluginBase { * or OR. */ public $having = []; - /** - * The default operator to use when connecting the WHERE groups. May be - * AND or OR. - * - * @var string - */ - protected $groupOperator = 'AND'; /** * A simple array of order by clauses. @@ -159,6 +152,9 @@ class Sql extends QueryPluginBase { * The messenger. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, DateSqlInterface $date_sql, MessengerInterface $messenger) { + // By default, use AND operator to connect WHERE groups. + $this->groupOperator = 'AND'; + parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityTypeManager = $entity_type_manager; diff --git a/core/modules/views/src/Plugin/views/sort/GroupByNumeric.php b/core/modules/views/src/Plugin/views/sort/GroupByNumeric.php index 5308439e66ce..bbfaa63c0382 100644 --- a/core/modules/views/src/Plugin/views/sort/GroupByNumeric.php +++ b/core/modules/views/src/Plugin/views/sort/GroupByNumeric.php @@ -3,6 +3,7 @@ namespace Drupal\views\Plugin\views\sort; use Drupal\views\Plugin\views\display\DisplayPluginBase; +use Drupal\views\Plugin\views\HandlerBase; use Drupal\views\ViewExecutable; use Drupal\views\Views; @@ -13,6 +14,11 @@ */ class GroupByNumeric extends SortPluginBase { + /** + * The original handler. + */ + protected HandlerBase $handler; + /** * {@inheritdoc} */ diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php index e2fed68ebdd9..f7646231a204 100644 --- a/core/modules/views_ui/src/ViewUI.php +++ b/core/modules/views_ui/src/ViewUI.php @@ -135,6 +135,11 @@ class ViewUI implements ViewEntityInterface { */ private $isUninstalling = FALSE; + /** + * The entity type. + */ + protected string $entityType; + /** * Constructs a View UI object. * @@ -536,7 +541,6 @@ public function renderPreview($display_id, $args = []) { $errors = $executable->validate(); $executable->destroy(); if (empty($errors)) { - $this->ajax = TRUE; $executable->live_preview = TRUE; // AJAX happens via HTTP POST but everything expects exposed data to diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 87187cfdee2d..832940ec7e5d 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -120,11 +120,6 @@ parameters: count: 3 path: lib/Drupal/Core/Cache/ApcuBackend.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Cache\\\\Context\\\\CacheContextsManager\\:\\:\\$validContextTokens\\.$#" - count: 1 - path: lib/Drupal/Core/Cache/Context/CacheContextsManager.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 4 @@ -135,11 +130,6 @@ parameters: count: 1 path: lib/Drupal/Core/Cache/MemoryBackend.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Cache\\\\PhpBackend\\:\\:\\$storage\\.$#" - count: 1 - path: lib/Drupal/Core/Cache/PhpBackend.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 2 @@ -155,16 +145,6 @@ parameters: count: 1 path: lib/Drupal/Core/Condition/ConditionManager.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Config\\\\Entity\\\\Query\\\\QueryFactory\\:\\:\\$configManager\\.$#" - count: 5 - path: lib/Drupal/Core/Config/Entity/Query/QueryFactory.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Config\\\\Entity\\\\Query\\\\QueryFactory\\:\\:\\$keyValueFactory\\.$#" - count: 3 - path: lib/Drupal/Core/Config/Entity/Query/QueryFactory.php - - message: "#^Method Drupal\\\\Core\\\\Config\\\\TypedConfigManager\\:\\:replaceVariable\\(\\) should return string but return statement is missing\\.$#" count: 1 @@ -180,11 +160,6 @@ parameters: count: 1 path: lib/Drupal/Core/Database/Query/Merge.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Database\\\\Query\\\\Truncate\\:\\:\\$condition\\.$#" - count: 2 - path: lib/Drupal/Core/Database/Query/Truncate.php - - message: "#^Call to an undefined method Drupal\\\\Core\\\\Database\\\\Schema\\:\\:createTableSql\\(\\)\\.$#" count: 1 @@ -220,11 +195,6 @@ parameters: count: 1 path: lib/Drupal/Core/Entity/ContentEntityNullStorage.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Entity\\\\Controller\\\\EntityController\\:\\:\\$urlGenerator\\.$#" - count: 1 - path: lib/Drupal/Core/Entity/Controller/EntityController.php - - message: "#^Method Drupal\\\\Core\\\\Entity\\\\Controller\\\\EntityController\\:\\:deleteTitle\\(\\) should return string but return statement is missing\\.$#" count: 1 @@ -245,11 +215,6 @@ parameters: count: 2 path: lib/Drupal/Core/Entity/EntityDisplayBase.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Entity\\\\EntityResolverManager\\:\\:\\$entityTypes\\.$#" - count: 1 - path: lib/Drupal/Core/Entity/EntityResolverManager.php - - message: "#^Method Drupal\\\\Core\\\\Entity\\\\KeyValueStore\\\\KeyValueContentEntityStorage\\:\\:createTranslation\\(\\) should return Drupal\\\\Core\\\\Entity\\\\ContentEntityInterface but return statement is missing\\.$#" count: 1 @@ -265,21 +230,11 @@ parameters: count: 1 path: lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryBase\\:\\:\\$conjunction\\.$#" - count: 1 - path: lib/Drupal/Core/Entity/Query/QueryBase.php - - message: "#^Method Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryBase\\:\\:getClass\\(\\) should return string but return statement is missing\\.$#" count: 1 path: lib/Drupal/Core/Entity/Query/QueryBase.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Entity\\\\Query\\\\Sql\\\\Query\\:\\:\\$conjunction\\.$#" - count: 1 - path: lib/Drupal/Core/Entity/Query/Sql/Query.php - - message: "#^Method Drupal\\\\Core\\\\Entity\\\\Sql\\\\SqlContentEntityStorageSchema\\:\\:processDataTable\\(\\) should return array but return statement is missing\\.$#" count: 1 @@ -290,21 +245,11 @@ parameters: count: 1 path: lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\EventSubscriber\\\\FinishResponseSubscriber\\:\\:\\$cacheContextsManager\\.$#" - count: 2 - path: lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 2 path: lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\EventSubscriber\\\\RedirectResponseSubscriber\\:\\:\\$requestContext\\.$#" - count: 2 - path: lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php - - message: "#^Call to an undefined method Drupal\\\\Core\\\\Extension\\\\Discovery\\\\RecursiveExtensionFilterIterator\\:\\:isDir\\(\\)\\.$#" count: 1 @@ -360,56 +305,6 @@ parameters: count: 1 path: lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsButtonsWidget\\:\\:\\$multiple\\.$#" - count: 2 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsButtonsWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsButtonsWidget\\:\\:\\$required\\.$#" - count: 2 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsButtonsWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsSelectWidget\\:\\:\\$has_value\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsSelectWidget\\:\\:\\$multiple\\.$#" - count: 2 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsSelectWidget\\:\\:\\$options\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsSelectWidget\\:\\:\\$required\\.$#" - count: 2 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsWidgetBase\\:\\:\\$has_value\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsWidgetBase\\:\\:\\$multiple\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsWidgetBase\\:\\:\\$options\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\Plugin\\\\Field\\\\FieldWidget\\\\OptionsWidgetBase\\:\\:\\$required\\.$#" - count: 1 - path: lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php - - message: "#^Method Drupal\\\\Core\\\\FileTransfer\\\\FileTransfer\\:\\:__get\\(\\) should return bool\\|string but return statement is missing\\.$#" count: 1 @@ -450,11 +345,6 @@ parameters: count: 1 path: lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Language\\\\LanguageManager\\:\\:\\$definedLanguageTypesInfo\\.$#" - count: 1 - path: lib/Drupal/Core/Language/LanguageManager.php - - message: "#^Method Drupal\\\\Core\\\\Lock\\\\NullLockBackend\\:\\:wait\\(\\) should return bool but return statement is missing\\.$#" count: 1 @@ -490,21 +380,11 @@ parameters: count: 1 path: lib/Drupal/Core/Template/AttributeValueBase.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Template\\\\TwigNodeVisitor\\:\\:\\$skipRenderVarFunction\\.$#" - count: 1 - path: lib/Drupal/Core/Template/TwigNodeVisitor.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 1 path: lib/Drupal/Core/Template/TwigPhpStorageCache.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Test\\\\PerformanceTestRecorder\\:\\:\\$state\\.$#" - count: 3 - path: lib/Drupal/Core/Test/PerformanceTestRecorder.php - - message: "#^Method Drupal\\\\Core\\\\Test\\\\TestRunnerKernel\\:\\:boot\\(\\) should return \\$this\\(Drupal\\\\Core\\\\Test\\\\TestRunnerKernel\\) but return statement is missing\\.$#" count: 1 @@ -535,51 +415,21 @@ parameters: count: 2 path: lib/Drupal/Core/TypedData/TypedData.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\TypedData\\\\Validation\\\\RecursiveContextualValidator\\:\\:\\$typedDataManager\\.$#" - count: 2 - path: lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php - - message: "#^Method Drupal\\\\Core\\\\Update\\\\UpdateKernel\\:\\:discoverServiceProviders\\(\\) should return array but return statement is missing\\.$#" count: 1 path: lib/Drupal/Core/Update/UpdateKernel.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Updater\\\\Module\\:\\:\\$name\\.$#" - count: 6 - path: lib/Drupal/Core/Updater/Module.php - - message: "#^Method Drupal\\\\Core\\\\Updater\\\\Module\\:\\:postUpdateTasks\\(\\) should return array but return statement is missing\\.$#" count: 1 path: lib/Drupal/Core/Updater/Module.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Updater\\\\Theme\\:\\:\\$name\\.$#" - count: 2 - path: lib/Drupal/Core/Updater/Theme.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Updater\\\\Updater\\:\\:\\$name\\.$#" - count: 3 - path: lib/Drupal/Core/Updater/Updater.php - - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Updater\\\\Updater\\:\\:\\$title\\.$#" - count: 1 - path: lib/Drupal/Core/Updater/Updater.php - - message: "#^Call to an undefined method Drupal\\\\Core\\\\Updater\\\\Updater\\:\\:getInstallDirectory\\(\\)\\.$#" count: 1 path: lib/Drupal/Core/Updater/Updater.php - - - message: "#^Access to an undefined property Drupal\\\\Core\\\\Validation\\\\ConstraintValidatorFactory\\:\\:\\$classResolver\\.$#" - count: 2 - path: lib/Drupal/Core/Validation/ConstraintValidatorFactory.php - - message: "#^Method Drupal\\\\action\\\\Form\\\\ActionFormBase\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 @@ -600,16 +450,6 @@ parameters: count: 1 path: modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php - - - message: "#^Access to an undefined property Drupal\\\\block\\\\Plugin\\\\migrate\\\\process\\\\BlockTheme\\:\\:\\$themes\\.$#" - count: 1 - path: modules/block/src/Plugin/migrate/process/BlockTheme.php - - - - message: "#^Access to an undefined property Drupal\\\\block_test\\\\Plugin\\\\Block\\\\TestAccessBlock\\:\\:\\$state\\.$#" - count: 2 - path: modules/block/tests/modules/block_test/src/Plugin/Block/TestAccessBlock.php - - message: "#^Method Drupal\\\\block_content\\\\BlockContentForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 @@ -695,46 +535,6 @@ parameters: count: 1 path: modules/comment/src/Plugin/views/field/NodeNewComments.php - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\field\\\\StatisticsLastCommentName\\:\\:\\$user_field\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\field\\\\StatisticsLastCommentName\\:\\:\\$user_table\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\field\\\\StatisticsLastUpdated\\:\\:\\$node_table\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\filter\\\\StatisticsLastUpdated\\:\\:\\$node_table\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/filter/StatisticsLastUpdated.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\sort\\\\StatisticsLastCommentName\\:\\:\\$user_field\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\sort\\\\StatisticsLastCommentName\\:\\:\\$user_table\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/sort/StatisticsLastCommentName.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\sort\\\\StatisticsLastUpdated\\:\\:\\$field_alias\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php - - - - message: "#^Access to an undefined property Drupal\\\\comment\\\\Plugin\\\\views\\\\sort\\\\StatisticsLastUpdated\\:\\:\\$node_table\\.$#" - count: 1 - path: modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 1 @@ -875,11 +675,6 @@ parameters: count: 1 path: modules/field_ui/src/Form/FieldStorageConfigEditForm.php - - - message: "#^Access to an undefined property Drupal\\\\field_ui\\\\Plugin\\\\Derivative\\\\FieldUiLocalAction\\:\\:\\$routeProvider\\.$#" - count: 1 - path: modules/field_ui/src/Plugin/Derivative/FieldUiLocalAction.php - - message: "#^Method Drupal\\\\file\\\\Plugin\\\\Field\\\\FieldType\\\\FileFieldItemList\\:\\:defaultValuesForm\\(\\) should return array but return statement is missing\\.$#" count: 1 @@ -890,16 +685,6 @@ parameters: count: 1 path: modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php - - - message: "#^Access to an undefined property Drupal\\\\file\\\\Plugin\\\\Field\\\\FieldWidget\\\\FileWidget\\:\\:\\$elementInfo\\.$#" - count: 2 - path: modules/file/src/Plugin/Field/FieldWidget/FileWidget.php - - - - message: "#^Access to an undefined property Drupal\\\\file\\\\Plugin\\\\migrate\\\\process\\\\d6\\\\FieldFile\\:\\:\\$migration\\.$#" - count: 1 - path: modules/file/src/Plugin/migrate/process/d6/FieldFile.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 2 @@ -930,21 +715,11 @@ parameters: count: 2 path: modules/file/tests/src/Kernel/UsageTest.php - - - message: "#^Access to an undefined property Drupal\\\\filter\\\\Plugin\\\\migrate\\\\process\\\\d6\\\\FilterFormatPermission\\:\\:\\$migration\\.$#" - count: 1 - path: modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php - - message: "#^Method Drupal\\\\forum\\\\ForumManager\\:\\:getTopicOrder\\(\\) should return array but return statement is missing\\.$#" count: 1 path: modules/forum/src/ForumManager.php - - - message: "#^Access to an undefined property Drupal\\\\help_topics\\\\Plugin\\\\HelpSection\\\\HelpTopicSection\\:\\:\\$translationManager\\.$#" - count: 3 - path: modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php - - message: "#^Method Drupal\\\\history\\\\Plugin\\\\views\\\\field\\\\HistoryUserTimestamp\\:\\:render\\(\\) should return Drupal\\\\Component\\\\Render\\\\MarkupInterface\\|string but return statement is missing\\.$#" count: 1 @@ -980,11 +755,6 @@ parameters: count: 1 path: modules/jsonapi/src/Revisions/VersionNegotiator.php - - - message: "#^Access to an undefined property Drupal\\\\Tests\\\\jsonapi\\\\Functional\\\\RestJsonApiUnsupported\\:\\:\\$httpClient\\.$#" - count: 1 - path: modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php - - message: "#^Method Drupal\\\\language\\\\Form\\\\LanguageAddForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 @@ -995,11 +765,6 @@ parameters: count: 1 path: modules/language/src/Form/LanguageEditForm.php - - - message: "#^Access to an undefined property Drupal\\\\language\\\\LanguageNegotiationMethodManager\\:\\:\\$cacheKeyPrefix\\.$#" - count: 1 - path: modules/language/src/LanguageNegotiationMethodManager.php - - message: "#^Call to an undefined method Drupal\\\\Tests\\\\layout_builder\\\\Unit\\\\DefaultsSectionStorageTest\\:\\:getThirdPartySetting\\(\\)\\.$#" count: 1 @@ -1025,11 +790,6 @@ parameters: count: 1 path: modules/locale/src/LocaleDefaultConfigStorage.php - - - message: "#^Access to an undefined property Drupal\\\\locale\\\\LocaleEvent\\:\\:\\$lids\\.$#" - count: 2 - path: modules/locale/src/LocaleEvent.php - - message: "#^Method Drupal\\\\locale\\\\LocaleProjectStorage\\:\\:deleteAll\\(\\) should return array but return statement is missing\\.$#" count: 1 @@ -1100,11 +860,6 @@ parameters: count: 1 path: modules/migrate/src/Plugin/migrate/destination/Config.php - - - message: "#^Access to an undefined property Drupal\\\\migrate\\\\Plugin\\\\migrate\\\\destination\\\\Entity\\:\\:\\$entityFieldManager\\.$#" - count: 1 - path: modules/migrate/src/Plugin/migrate/destination/Entity.php - - message: "#^Call to an undefined method Drupal\\\\migrate\\\\Plugin\\\\migrate\\\\destination\\\\Entity\\:\\:processStubRow\\(\\)\\.$#" count: 1 @@ -1125,11 +880,6 @@ parameters: count: 1 path: modules/migrate/src/Plugin/migrate/destination/NullDestination.php - - - message: "#^Access to an undefined property Drupal\\\\migrate\\\\Plugin\\\\migrate\\\\process\\\\Route\\:\\:\\$migration\\.$#" - count: 1 - path: modules/migrate/src/Plugin/migrate/process/Route.php - - message: "#^Call to an undefined static method static\\(Drupal\\\\Tests\\\\migrate\\\\Kernel\\\\MigrateTestBase\\)\\:\\:migrateDumpAlter\\(\\)\\.$#" count: 1 @@ -1405,11 +1155,6 @@ parameters: count: 1 path: modules/system/src/Form/ModulesListNonStableConfirmForm.php - - - message: "#^Access to an undefined property Drupal\\\\accept_header_routing_test\\\\AcceptHeaderMiddleware\\:\\:\\$app\\.$#" - count: 2 - path: modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderMiddleware.php - - message: "#^Class Drupal\\\\advisory_feed_test\\\\AdvisoriesTestHttpClient extends @final class GuzzleHttp\\\\Client\\.$#" count: 1 @@ -1435,21 +1180,6 @@ parameters: count: 1 path: modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php - - - message: "#^Access to an undefined property Drupal\\\\error_service_test\\\\Controller\\\\LonelyMonkeyController\\:\\:\\$class\\.$#" - count: 1 - path: modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php - - - - message: "#^Access to an undefined property Drupal\\\\error_service_test\\\\LonelyMonkeyClass\\:\\:\\$connection\\.$#" - count: 1 - path: modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php - - - - message: "#^Access to an undefined property Drupal\\\\error_service_test\\\\MonkeysInTheControlRoom\\:\\:\\$settings\\.$#" - count: 2 - path: modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php - - message: "#^Result of function usleep \\(void\\) is used\\.$#" count: 1 @@ -1560,11 +1290,6 @@ parameters: count: 1 path: modules/tour/src/TipPluginBase.php - - - message: "#^Access to an undefined property Drupal\\\\update\\\\UpdateProcessor\\:\\:\\$fetchTasks\\.$#" - count: 2 - path: modules/update/src/UpdateProcessor.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 4 @@ -1585,11 +1310,6 @@ parameters: count: 1 path: modules/user/src/Plugin/views/field/UserData.php - - - message: "#^Access to an undefined property Drupal\\\\user\\\\Plugin\\\\views\\\\filter\\\\Name\\:\\:\\$validated_exposed_input\\.$#" - count: 1 - path: modules/user/src/Plugin/views/filter/Name.php - - message: "#^Method Drupal\\\\user\\\\ProfileForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 @@ -1725,21 +1445,11 @@ parameters: count: 2 path: modules/views/src/Plugin/views/filter/FilterPluginBase.php - - - message: "#^Access to an undefined property Drupal\\\\views\\\\Plugin\\\\views\\\\query\\\\QueryPluginBase\\:\\:\\$groupOperator\\.$#" - count: 1 - path: modules/views/src/Plugin/views/query/QueryPluginBase.php - - message: "#^Undefined variable\\: \\$def$#" count: 2 path: modules/views/src/Plugin/views/relationship/EntityReverse.php - - - message: "#^Access to an undefined property Drupal\\\\views\\\\Plugin\\\\views\\\\sort\\\\GroupByNumeric\\:\\:\\$handler\\.$#" - count: 1 - path: modules/views/src/Plugin/views/sort/GroupByNumeric.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 1 @@ -1835,16 +1545,6 @@ parameters: count: 1 path: modules/views_ui/src/ViewEditForm.php - - - message: "#^Access to an undefined property Drupal\\\\views_ui\\\\ViewUI\\:\\:\\$ajax\\.$#" - count: 1 - path: modules/views_ui/src/ViewUI.php - - - - message: "#^Access to an undefined property Drupal\\\\views_ui\\\\ViewUI\\:\\:\\$entityType\\.$#" - count: 1 - path: modules/views_ui/src/ViewUI.php - - message: "#^Method Drupal\\\\views_ui\\\\ViewUI\\:\\:getTypedData\\(\\) should return Drupal\\\\Core\\\\TypedData\\\\ComplexDataInterface but return statement is missing\\.$#" count: 1 @@ -1905,11 +1605,6 @@ parameters: count: 1 path: modules/workspaces/src/WorkspacePublisher.php - - - message: "#^Access to an undefined property Drupal\\\\demo_umami_content\\\\InstallHelper\\:\\:\\$module_path\\.$#" - count: 5 - path: profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 12 @@ -1985,36 +1680,6 @@ parameters: count: 1 path: tests/Drupal/KernelTests/KernelTestBaseTest.php - - - message: "#^Access to an undefined property Drupal\\\\KernelTests\\\\RouteProvider\\:\\:\\$service\\.$#" - count: 1 - path: tests/Drupal/KernelTests/RouteProvider.php - - - - message: "#^Access to an undefined property Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:\\$baseUrl\\.$#" - count: 1 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - - message: "#^Access to an undefined property Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:\\$configImporter\\.$#" - count: 1 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - - message: "#^Access to an undefined property Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:\\$defaultTheme\\.$#" - count: 2 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - - message: "#^Access to an undefined property Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:\\$originalShutdownCallbacks\\.$#" - count: 1 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - - message: "#^Access to an undefined property Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:\\$translationFilesDirectory\\.$#" - count: 1 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - message: "#^Call to an undefined method Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:assertTrue\\(\\)\\.$#" count: 1 @@ -2055,11 +1720,6 @@ parameters: count: 1 path: tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php - - - message: "#^Access to an undefined property Drupal\\\\Tests\\\\Component\\\\PhpStorage\\\\MTimeProtectedFileStorageBase\\:\\:\\$expected\\.$#" - count: 3 - path: tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php - - message: "#^Cannot unset offset int on array\\<string, mixed\\>\\.$#" count: 1 diff --git a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php index f1d17a6cb42f..8a26d7ba4eeb 100644 --- a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php @@ -88,6 +88,11 @@ class InstallHelper implements ContainerInjectionInterface { */ protected $nodeIdMap; + /** + * The module's path. + */ + protected string $module_path; + /** * Constructs a new InstallHelper object. * diff --git a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php index 7da9192556dd..b03e000b48cf 100644 --- a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php +++ b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php @@ -261,7 +261,7 @@ public function testLoggerException() { $this->assertStringContainsString('Failed to log error', $errors[0], 'The error handling logs when an error could not be logged to the logger.'); $expected_path = \Drupal::root() . '/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php'; - $expected_line = 62; + $expected_line = 67; $expected_entry = "Failed to log error: Exception: Deforestation in Drupal\\error_service_test\\MonkeysInTheControlRoom->handle() (line {$expected_line} of {$expected_path})"; $this->assertStringContainsString($expected_entry, $errors[0], 'Original error logged to the PHP error log when an exception is thrown by a logger'); diff --git a/core/tests/Drupal/KernelTests/RouteProvider.php b/core/tests/Drupal/KernelTests/RouteProvider.php index 27065fd1eb98..82799357c817 100644 --- a/core/tests/Drupal/KernelTests/RouteProvider.php +++ b/core/tests/Drupal/KernelTests/RouteProvider.php @@ -3,6 +3,7 @@ namespace Drupal\KernelTests; use Drupal\Core\Routing\PreloadableRouteProviderInterface; +use Drupal\Core\Routing\RouteProvider as RouteProviderBase; use Symfony\Component\HttpFoundation\Request; /** @@ -12,6 +13,11 @@ class RouteProvider implements PreloadableRouteProviderInterface { use \Drupal\Core\DependencyInjection\DependencySerializationTrait; + /** + * The route provider service. + */ + protected RouteProviderBase $service; + /** * Loads the real route provider from the container and rebuilds the router. * diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php index d678f6be0f1c..cb98a2fadf01 100644 --- a/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php +++ b/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php @@ -2,6 +2,7 @@ namespace Drupal\TestSite\Commands; +use Drupal\Core\Config\ConfigImporter; use Drupal\Core\Database\Database; use Drupal\Core\Test\FunctionalTestSetupTrait; use Drupal\Core\Test\TestDatabase; @@ -30,6 +31,35 @@ class TestSiteInstallCommand extends Command { changeDatabasePrefix as protected changeDatabasePrefixTrait; } + /** + * The theme to install as the default for testing. + * + * Defaults to the install profile's default theme, if it specifies any. + */ + protected string $defaultTheme; + + /** + * The base URL. + */ + protected string $baseUrl; + + /** + * The original array of shutdown function callbacks. + */ + protected array $originalShutdownCallbacks = []; + + /** + * The translation file directory for the test environment. + * + * This is set in BrowserTestBase::prepareEnvironment(). + */ + protected string $translationFilesDirectory; + + /** + * The config importer that can be used in a test. + */ + protected ?ConfigImporter $configImporter; + /** * The install profile to use. * diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php index 577241d472ac..66ea316fdfe9 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php @@ -19,7 +19,7 @@ class MTimeProtectedFastFileStorageTest extends MTimeProtectedFileStorageBase { * include the hacked file on the first try but the second test will change * the directory mtime and so on the second try the file will not be included. */ - protected $expected = [TRUE, FALSE]; + protected array $expected = [TRUE, FALSE]; /** * The PHP storage class to test. diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php index 86e8109737b0..e5e597d0c698 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php @@ -34,6 +34,11 @@ abstract class MTimeProtectedFileStorageBase extends PhpStorageTestBase { */ protected $settings; + /** + * The expected test results for the security test. + */ + protected array $expected; + /** * {@inheritdoc} */ diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php index bc88c3345904..775a43ff2887 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php @@ -18,7 +18,7 @@ class MTimeProtectedFileStorageTest extends MTimeProtectedFileStorageBase { * The default implementation protects against even the filemtime change so * both iterations will return FALSE. */ - protected $expected = [FALSE, FALSE]; + protected array $expected = [FALSE, FALSE]; /** * The PHP storage class to test. -- GitLab