Skip to content
Snippets Groups Projects
Commit 2795fb4c authored by Andrey Tymchuk's avatar Andrey Tymchuk Committed by A.Tymchuk
Browse files

Issue #3423280 by WalkingDexter: Fix PHPStan errors (level 4)

parent 2ff36105
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ class GarbageCollector extends QueueWorkerBase implements ContainerFactoryPlugin
*/
public function processItem($data) {
$view_id = $data['view_id'];
/** @var \Drupal\views\ViewEntityInterface $view_entity */
/** @var \Drupal\views\ViewEntityInterface|null $view_entity */
$view_entity = $this->viewStorage->load($view_id);
$display_ids = [];
......
......@@ -57,3 +57,8 @@ parameters:
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 2
path: src/SimpleSitemapListBuilder.php
-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertEmpty\\(\\) with non\\-empty\\-array\\<Behat\\\\Mink\\\\Element\\\\NodeElement\\> will always evaluate to false\\.$#"
count: 1
path: tests/src/Functional/SimplesitemapTest.php
includes:
- phpstan-baseline.neon
parameters:
level: 3
level: 4
paths:
- .
excludePaths:
......
......@@ -67,7 +67,7 @@ abstract class EntityFormHandlerBase implements EntityFormHandlerInterface {
/**
* The sitemap settings.
*
* @var array
* @var array|null
*/
protected $settings;
......
......@@ -153,7 +153,6 @@ class Generator implements SitemapGetterInterface {
public function getContent(?int $delta = NULL): ?string {
$sitemap = $this->getDefaultSitemap();
/** @var \Drupal\simple_sitemap\Entity\SimpleSitemapInterface $sitemap */
if ($sitemap
&& $sitemap->isEnabled()
&& ($sitemap_string = $sitemap->fromPublished()->toString($delta))) {
......
......@@ -247,6 +247,7 @@ class EntityUrlGenerator extends EntityUrlGeneratorBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\Core\Entity\EntityMalformedException
* @throws \Drupal\simple_sitemap\Exception\SkipElementException
*/
protected function processEntity(ContentEntityInterface $entity): array {
$entity_settings = $this->entitiesManager
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment