Skip to content

Commit

Permalink
Fix last modified by check the interface correctly (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlagler authored Feb 18, 2025
1 parent 88f666c commit 214ed11
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'phpdoc_to_comment' => [
'ignored_tags' => ['todo', 'var', 'see', 'phpstan-ignore-next-line'],
],
'trailing_comma_in_multiline' => false,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match']],
])
->setFinder($finder);

Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/SuluArticleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
use Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument;
use Sulu\Bundle\ArticleBundle\Document\Form\ArticleDocumentType;
use Sulu\Bundle\ArticleBundle\Document\Form\ArticlePageDocumentType;
use Sulu\Bundle\ArticleBundle\Document\LocalizedLastModifiedBehavior;
use Sulu\Bundle\ArticleBundle\Document\Structure\ArticleBridge;
use Sulu\Bundle\ArticleBundle\Document\Structure\ArticlePageBridge;
use Sulu\Bundle\ArticleBundle\Exception\ArticlePageNotFoundException;
use Sulu\Bundle\ArticleBundle\Exception\ParameterNotAllowedException;
use Sulu\Component\Content\Document\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
Expand Down Expand Up @@ -189,7 +189,7 @@ public function prepend(ContainerBuilder $container)
],
'forms' => [
'directories' => [
\class_exists(LocalizedLastModifiedBehavior::class)
\interface_exists(SuluLocalizedLastModifiedBehavior::class)
? __DIR__ . '/../Resources/config/forms'
: __DIR__ . '/../Resources/config/forms_sulu_25_or_lower',
],
Expand Down
4 changes: 2 additions & 2 deletions Document/LocalizedLastModifiedBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace Sulu\Bundle\ArticleBundle\Document;

use Sulu\Component\DocumentManager\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;
use Sulu\Component\Content\Document\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;

if (\interface_exists(SuluLocalizedLastModifiedBehavior::class)) {
/**
* @internal BC Layer for Sulu <2.6
* @internal BC Layer for Sulu >=2.6
*/
interface LocalizedLastModifiedBehavior extends SuluLocalizedLastModifiedBehavior
{
Expand Down
65 changes: 0 additions & 65 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ parameters:
count: 1
path: Admin/ArticleAdmin.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Admin\\\\ArticleAdmin\\:\\:getSecurityContexts\\(\\) should return array\\<string, array\\<string, array\\<string, array\\<string\\>\\>\\>\\> but returns array\\<string, array\\<string, array\\<int\\|string, array\\<int, string\\>\\>\\>\\>\\.$#"
count: 1
path: Admin/ArticleAdmin.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Admin\\\\ArticleAdmin\\:\\:getTypes\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -40,11 +35,6 @@ parameters:
count: 1
path: Admin/Helper/WebspaceSelect.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Builder\\\\ArticleIndexBuilder\\:\\:getDependencies\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: Builder/ArticleIndexBuilder.php

-
message: "#^Strict comparison using \\=\\=\\= between 0 and bool will always evaluate to false\\.$#"
count: 1
Expand Down Expand Up @@ -955,11 +945,6 @@ parameters:
count: 1
path: Document/Index/ArticleIndexer.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:getDocumentInspector\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Index/ArticleIndexer.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:getViewDocumentIds\\(\\) has parameter \\$uuids with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -1085,56 +1070,11 @@ parameters:
count: 1
path: Document/Index/DocumentFactory.php

-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Cannot access offset 'id' on mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Cannot access offset 'key' on mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Cannot access offset 'keyword' on mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Cannot access offset 'name' on mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\Factory\\\\CategoryCollectionFactory\\:\\:__construct\\(\\) has parameter \\$categoryRepository with generic class Doctrine\\\\ORM\\\\EntityRepository but does not specify its types\\: TEntityClass$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$key \\(string\\) does not accept mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$keywords \\(array\\<string\\>\\) does not accept array\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$name \\(string\\) does not accept mixed\\.$#"
count: 1
path: Document/Index/Factory/CategoryCollectionFactory.php

-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\Factory\\\\CategoryCollectionFactory\\:\\:\\$categoryRepository with generic class Doctrine\\\\ORM\\\\EntityRepository does not specify its types\\: TEntityClass$#"
count: 1
Expand Down Expand Up @@ -1735,11 +1675,6 @@ parameters:
count: 1
path: Document/Subscriber/RoutableSubscriber.php

-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\WebspaceSubscriber\\:\\:getDocumentInspector\\(\\) has no return type specified\\.$#"
count: 1
path: Document/Subscriber/WebspaceSubscriber.php

-
message: "#^Parameter \\#1 \\$additionalWebspaces of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Behavior\\\\WebspaceBehavior\\:\\:setAdditionalWebspaces\\(\\) expects array\\<string\\>\\|null, mixed given\\.$#"
count: 1
Expand Down

0 comments on commit 214ed11

Please sign in to comment.