WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 214ed11

Browse files
authored
Fix last modified by check the interface correctly (#716)
1 parent 88f666c commit 214ed11

File tree

4 files changed

+5
-70
lines changed

4 files changed

+5
-70
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
'phpdoc_to_comment' => [
4646
'ignored_tags' => ['todo', 'var', 'see', 'phpstan-ignore-next-line'],
4747
],
48-
'trailing_comma_in_multiline' => false,
48+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match']],
4949
])
5050
->setFinder($finder);
5151

DependencyInjection/SuluArticleExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use Sulu\Bundle\ArticleBundle\Document\ArticlePageDocument;
1616
use Sulu\Bundle\ArticleBundle\Document\Form\ArticleDocumentType;
1717
use Sulu\Bundle\ArticleBundle\Document\Form\ArticlePageDocumentType;
18-
use Sulu\Bundle\ArticleBundle\Document\LocalizedLastModifiedBehavior;
1918
use Sulu\Bundle\ArticleBundle\Document\Structure\ArticleBridge;
2019
use Sulu\Bundle\ArticleBundle\Document\Structure\ArticlePageBridge;
2120
use Sulu\Bundle\ArticleBundle\Exception\ArticlePageNotFoundException;
2221
use Sulu\Bundle\ArticleBundle\Exception\ParameterNotAllowedException;
22+
use Sulu\Component\Content\Document\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;
2323
use Symfony\Component\Config\FileLocator;
2424
use Symfony\Component\DependencyInjection\ContainerBuilder;
2525
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
@@ -189,7 +189,7 @@ public function prepend(ContainerBuilder $container)
189189
],
190190
'forms' => [
191191
'directories' => [
192-
\class_exists(LocalizedLastModifiedBehavior::class)
192+
\interface_exists(SuluLocalizedLastModifiedBehavior::class)
193193
? __DIR__ . '/../Resources/config/forms'
194194
: __DIR__ . '/../Resources/config/forms_sulu_25_or_lower',
195195
],

Document/LocalizedLastModifiedBehavior.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
namespace Sulu\Bundle\ArticleBundle\Document;
1313

14-
use Sulu\Component\DocumentManager\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;
14+
use Sulu\Component\Content\Document\Behavior\LocalizedLastModifiedBehavior as SuluLocalizedLastModifiedBehavior;
1515

1616
if (\interface_exists(SuluLocalizedLastModifiedBehavior::class)) {
1717
/**
18-
* @internal BC Layer for Sulu <2.6
18+
* @internal BC Layer for Sulu >=2.6
1919
*/
2020
interface LocalizedLastModifiedBehavior extends SuluLocalizedLastModifiedBehavior
2121
{

phpstan-baseline.neon

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ parameters:
1010
count: 1
1111
path: Admin/ArticleAdmin.php
1212

13-
-
14-
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\\>\\>\\>\\>\\.$#"
15-
count: 1
16-
path: Admin/ArticleAdmin.php
17-
1813
-
1914
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Admin\\\\ArticleAdmin\\:\\:getTypes\\(\\) return type has no value type specified in iterable type array\\.$#"
2015
count: 1
@@ -40,11 +35,6 @@ parameters:
4035
count: 1
4136
path: Admin/Helper/WebspaceSelect.php
4237

43-
-
44-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Builder\\\\ArticleIndexBuilder\\:\\:getDependencies\\(\\) return type has no value type specified in iterable type array\\.$#"
45-
count: 1
46-
path: Builder/ArticleIndexBuilder.php
47-
4838
-
4939
message: "#^Strict comparison using \\=\\=\\= between 0 and bool will always evaluate to false\\.$#"
5040
count: 1
@@ -955,11 +945,6 @@ parameters:
955945
count: 1
956946
path: Document/Index/ArticleIndexer.php
957947

958-
-
959-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:getDocumentInspector\\(\\) has no return type specified\\.$#"
960-
count: 1
961-
path: Document/Index/ArticleIndexer.php
962-
963948
-
964949
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\ArticleIndexer\\:\\:getViewDocumentIds\\(\\) has parameter \\$uuids with no value type specified in iterable type array\\.$#"
965950
count: 1
@@ -1085,56 +1070,11 @@ parameters:
10851070
count: 1
10861071
path: Document/Index/DocumentFactory.php
10871072

1088-
-
1089-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
1090-
count: 1
1091-
path: Document/Index/Factory/CategoryCollectionFactory.php
1092-
1093-
-
1094-
message: "#^Cannot access offset 'id' on mixed\\.$#"
1095-
count: 1
1096-
path: Document/Index/Factory/CategoryCollectionFactory.php
1097-
1098-
-
1099-
message: "#^Cannot access offset 'key' on mixed\\.$#"
1100-
count: 1
1101-
path: Document/Index/Factory/CategoryCollectionFactory.php
1102-
1103-
-
1104-
message: "#^Cannot access offset 'keyword' on mixed\\.$#"
1105-
count: 1
1106-
path: Document/Index/Factory/CategoryCollectionFactory.php
1107-
1108-
-
1109-
message: "#^Cannot access offset 'name' on mixed\\.$#"
1110-
count: 1
1111-
path: Document/Index/Factory/CategoryCollectionFactory.php
1112-
1113-
-
1114-
message: "#^Cannot cast mixed to int\\.$#"
1115-
count: 1
1116-
path: Document/Index/Factory/CategoryCollectionFactory.php
1117-
11181073
-
11191074
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$#"
11201075
count: 1
11211076
path: Document/Index/Factory/CategoryCollectionFactory.php
11221077

1123-
-
1124-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$key \\(string\\) does not accept mixed\\.$#"
1125-
count: 1
1126-
path: Document/Index/Factory/CategoryCollectionFactory.php
1127-
1128-
-
1129-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$keywords \\(array\\<string\\>\\) does not accept array\\.$#"
1130-
count: 1
1131-
path: Document/Index/Factory/CategoryCollectionFactory.php
1132-
1133-
-
1134-
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\CategoryViewObject\\:\\:\\$name \\(string\\) does not accept mixed\\.$#"
1135-
count: 1
1136-
path: Document/Index/Factory/CategoryCollectionFactory.php
1137-
11381078
-
11391079
message: "#^Property Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Index\\\\Factory\\\\CategoryCollectionFactory\\:\\:\\$categoryRepository with generic class Doctrine\\\\ORM\\\\EntityRepository does not specify its types\\: TEntityClass$#"
11401080
count: 1
@@ -1735,11 +1675,6 @@ parameters:
17351675
count: 1
17361676
path: Document/Subscriber/RoutableSubscriber.php
17371677

1738-
-
1739-
message: "#^Method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Subscriber\\\\WebspaceSubscriber\\:\\:getDocumentInspector\\(\\) has no return type specified\\.$#"
1740-
count: 1
1741-
path: Document/Subscriber/WebspaceSubscriber.php
1742-
17431678
-
17441679
message: "#^Parameter \\#1 \\$additionalWebspaces of method Sulu\\\\Bundle\\\\ArticleBundle\\\\Document\\\\Behavior\\\\WebspaceBehavior\\:\\:setAdditionalWebspaces\\(\\) expects array\\<string\\>\\|null, mixed given\\.$#"
17451680
count: 1

0 commit comments

Comments
 (0)