CCC CI pipelines failing across MRs from new phpstan rules
## Problem
Pipelines failing across MRs from:
```
Note: Using configuration file /builds/issue/ai_context-3586311/web/modules/custom/ai_context/phpstan.neon.dist.
------ -----------------------------------------------------------------------
Line modules/ai_context_document_loader/tests/src/Traits/DocumentLoaderTes
tTrait.php (in context of class
Drupal\Tests\ai_context_document_loader\Functional\AiContextDocumentL
oaderIntegrationFunctionalTest)
------ -----------------------------------------------------------------------
116 Avoid calling Symfony\Component\Yaml\Yaml::parse() directly. Use
\Drupal\Component\Serialization\Yaml::decode() instead, which handles
exceptions consistently and applies the correct parse flags.
🪪 drupal.symfonyYamlParse
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line modules/ai_context_document_loader/tests/src/Traits/DocumentLoaderTes
tTrait.php (in context of class
Drupal\Tests\ai_context_document_loader\Kernel\AiContextDocumentLoade
rIntegrationTest)
------ -----------------------------------------------------------------------
116 Avoid calling Symfony\Component\Yaml\Yaml::parse() directly. Use
\Drupal\Component\Serialization\Yaml::decode() instead, which handles
exceptions consistently and applies the correct parse flags.
🪪 drupal.symfonyYamlParse
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line modules/ai_context_document_loader/tests/src/Traits/DocumentLoaderTes
tTrait.php (in context of class
Drupal\Tests\ai_context_document_loader\Kernel\AiContextDocumentLoade
rModuleTest)
------ -----------------------------------------------------------------------
116 Avoid calling Symfony\Component\Yaml\Yaml::parse() directly. Use
\Drupal\Component\Serialization\Yaml::decode() instead, which handles
exceptions consistently and applies the correct parse flags.
🪪 drupal.symfonyYamlParse
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/AiContextItemListBuilder.php
------ -----------------------------------------------------------------------
427 Method
Drupal\ai_context\AiContextItemListBuilder::getDefaultOperations() is
missing the CacheableMetadata parameter added in Drupal 11.3. Update
the signature to:
getDefaultOperations(\Drupal\Core\Entity\EntityInterface $entity,
?\Drupal\Core\Cache\CacheableMetadata $cacheability = NULL).
🪪 drupal.entityListBuilderMissingCacheabilityParameter
💡 See https://www.drupal.org/node/3533080
------ -----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line src/AiContextUsageListBuilder.php
------ ---------------------------------------------------------------------
60 Direct injection of entity storage via $storage is not recommended.
Inject Drupal\Core\Entity\EntityTypeManagerInterface and call
getStorage() at the call-site instead.
🪪 drupal.entityStorageDirectInjection
💡 See
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal
130 Method
Drupal\ai_context\AiContextUsageListBuilder::getDefaultOperations()
is missing the CacheableMetadata parameter added in Drupal 11.3.
Update the signature to:
getDefaultOperations(\Drupal\Core\Entity\EntityInterface $entity,
?\Drupal\Core\Cache\CacheableMetadata $cacheability = NULL).
🪪 drupal.entityListBuilderMissingCacheabilityParameter
💡 See https://www.drupal.org/node/3533080
------ ---------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Form/AiContextAgentForm.php
------ -----------------------------------------------------------------------
60 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
60 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
61 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
61 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
62 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
62 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
63 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
63 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
64 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
64 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
65 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
65 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
66 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
66 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Form/AiContextAgentsForm.php
------ -----------------------------------------------------------------------
44 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
44 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
45 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
45 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
46 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
46 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
------ -----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line src/Form/AiContextItemRevisionDeleteForm.php
------ ---------------------------------------------------------------------
49 Direct injection of entity storage via $storage is not recommended.
Inject Drupal\Core\Entity\EntityTypeManagerInterface and call
getStorage() at the call-site instead.
🪪 drupal.entityStorageDirectInjection
💡 See
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal
50 Storing entity storage as a class property is not recommended. Call
Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() at the
call-site instead.
🪪 drupal.entityStoragePropertyAssignment
💡 See
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal
------ ---------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/MapFormatter.php
------ -----------------------------------------------------------------------
55 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
55 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/MarkdownFormatter.php
------ -----------------------------------------------------------------------
30 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Plugin/views/field/TargetEntityLinkField.php
------ -----------------------------------------------------------------------
39 Drupal\Core\DependencyInjection\DependencySerializationTrait does not
support private properties.
🪪 dependencySerializationTraitProperty.unsupportedPrivateProperty
💡 See https://www.drupal.org/node/3110266
39 Read-only properties are incompatible with
Drupal\Core\DependencyInjection\DependencySerializationTrait.
🪪 dependencySerializationTraitProperty.unsupportedReadOnlyProperty
💡 See https://www.drupal.org/node/3110266
------ -----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line src/Service/AiContextItemValidator.php
------ ---------------------------------------------------------------------
52 Storing entity storage as a class property is not recommended. Call
Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() at the
call-site instead.
🪪 drupal.entityStoragePropertyAssignment
💡 See
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal
------ ---------------------------------------------------------------------
[ERROR] Found 34 errors
## Solution
Fix and merge back into outstanding MRs.
issue