Skip to content

Commit cd81290

Browse files
committed
Merged branch '4.6'
2 parents 66b86de + 00554a9 commit cd81290

File tree

9 files changed

+60
-42
lines changed

9 files changed

+60
-42
lines changed

.github/workflows/browser-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ jobs:
1616
test-suite: '--profile=browser --suite=admin-ui --tags=@richtext'
1717
secrets:
1818
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
19+
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
20+
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
21+
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}

.github/workflows/ci.yaml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
php:
1717
- '8.3'
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Setup PHP Action
2222
uses: shivammathur/setup-php@v2
@@ -31,31 +31,6 @@ jobs:
3131
- name: Run code style check
3232
run: composer run-script check-cs -- --format=checkstyle | cs2pr
3333

34-
rector:
35-
name: Run rector
36-
runs-on: "ubuntu-22.04"
37-
strategy:
38-
matrix:
39-
php:
40-
- '8.3'
41-
steps:
42-
- uses: actions/checkout@v4
43-
44-
- name: Setup PHP Action
45-
uses: shivammathur/setup-php@v2
46-
with:
47-
php-version: ${{ matrix.php }}
48-
coverage: none
49-
extensions: 'pdo_sqlite, gd'
50-
tools: cs2pr
51-
52-
- uses: ramsey/composer-install@v3
53-
with:
54-
dependency-versions: highest
55-
56-
- name: Run rector
57-
run: vendor/bin/rector process --dry-run --ansi
58-
5934
tests:
6035
name: Tests
6136
runs-on: ubuntu-22.04
@@ -68,7 +43,7 @@ jobs:
6843
- '8.3'
6944

7045
steps:
71-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
7247

7348
- name: Setup PHP Action
7449
uses: shivammathur/setup-php@v2
@@ -116,7 +91,7 @@ jobs:
11691
- '8.3'
11792

11893
steps:
119-
- uses: actions/checkout@v4
94+
- uses: actions/checkout@v5
12095

12196
- name: Setup PHP Action
12297
uses: shivammathur/setup-php@v2
@@ -165,7 +140,7 @@ jobs:
165140
- '8.3'
166141

167142
steps:
168-
- uses: actions/checkout@v4
143+
- uses: actions/checkout@v5
169144

170145
- name: Setup PHP Action
171146
uses: shivammathur/setup-php@v2
@@ -202,7 +177,7 @@ jobs:
202177
--health-timeout 5s
203178
--health-retries 10
204179
steps:
205-
- uses: actions/checkout@v4
180+
- uses: actions/checkout@v5
206181
with:
207182
fetch-depth: 0
208183

.github/workflows/frontend-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
timeout-minutes: 5
3131

3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434
- uses: actions/setup-node@v4
3535
with:
3636
node-version: '20'

.github/workflows/rector.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Rector PHP
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '[0-9]+.[0-9]+'
8+
pull_request: ~
9+
10+
jobs:
11+
rector:
12+
name: Run rector
13+
runs-on: "ubuntu-22.04"
14+
strategy:
15+
matrix:
16+
php:
17+
- '8.3'
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- uses: ibexa/gh-workflows/actions/composer-install@main
22+
with:
23+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
24+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
25+
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
26+
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}
27+
28+
- name: Run rector
29+
run: vendor/bin/rector process --dry-run --ansi

phpstan-baseline.neon

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ parameters:
168168
count: 1
169169
path: src/lib/Configuration/UI/Mapper/CustomStyle.php
170170

171+
-
172+
message: '#^Method Ibexa\\FieldTypeRichText\\Configuration\\UI\\Mapper\\CustomTag\:\:translateLabels\(\) should return array\<string, array\{label\: string, description\: string, isInline\: bool, icon\?\: string, attributes\?\: array\<string, array\{type\: string, required\: bool, defaultValue\: mixed, label\: string, choices\?\: array\<string\>, choicesLabel\?\: array\<string, string\>\}\>\}\> but returns array\<string, array\{label\: string, description\: string, isInline\: bool, icon\?\: string, attributes\?\: array\<string, array\{label\: string\}\|array\{type\: string, required\: bool, defaultValue\: mixed, label\: string, choices\?\: array\<string\>, choicesLabel\?\: array\<string, string\>\}\>\}\>\.$#'
173+
identifier: return.type
174+
count: 1
175+
path: src/lib/Configuration/UI/Mapper/CustomTag.php
176+
171177
-
172178
message: '#^Call to an undefined method DOMNode\:\:setAttribute\(\)\.$#'
173179
identifier: method.notFound
@@ -547,20 +553,20 @@ parameters:
547553
path: tests/bundle/DependencyInjection/IbexaFieldTypeRichTextExtensionTest.php
548554

549555
-
550-
message: '#^Cannot access property \$id on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Field\|null\.$#'
556+
message: '#^Cannot access property \$value on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Field\|null\.$#'
551557
identifier: property.nonObject
552558
count: 1
553559
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php
554560

555561
-
556-
message: '#^Cannot access property \$value on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Field\|null\.$#'
557-
identifier: property.nonObject
562+
message: '#^Cannot call method appendChild\(\) on DOMElement\|null\.$#'
563+
identifier: method.nonObject
558564
count: 1
559565
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php
560566

561567
-
562-
message: '#^Cannot call method appendChild\(\) on DOMElement\|null\.$#'
563-
identifier: method.nonObject
568+
message: '#^Parameter \#1 \$contentObjectAttributeId of method Ibexa\\Tests\\Integration\\FieldTypeRichText\\Repository\\RichTextFieldTypeIntegrationTest\:\:getUrlIdsForContentObjectAttributeIdAndVersionNo\(\) expects int, int\|null given\.$#'
569+
identifier: argument.type
564570
count: 1
565571
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php
566572

src/bundle/Templating/Twig/Extension/YoutubeIdExtractorExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
final class YoutubeIdExtractorExtension extends AbstractExtension
1818
{
1919
private const string YOUTUBE_ID_REGEX = '/(?:https?:)?(?:\/\/)?(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube(?:-nocookie)?\.com\S*?[^\w\s-])'
20-
. '(?P<id>[\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:[\'"][^<>]*>|<\/a>))[?=&+%\w.-]*/i';
20+
. '(?P<id>[\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:[\'"][^<>]*>|<\/a>))[?=&+%\w.-]*/i';
2121

2222
/**
2323
* @return \Twig\TwigFunction[]

src/lib/Configuration/UI/Mapper/CustomTag.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Ibexa\FieldTypeRichText\Configuration\UI\Mapper;
1010

1111
use Ibexa\FieldTypeRichText\Configuration\UI\Mapper\CustomTag\AttributeMapper;
12+
use JMS\TranslationBundle\Annotation\Ignore;
1213
use RuntimeException;
1314
use Symfony\Component\Asset\Packages;
1415
use Symfony\Component\Translation\TranslatorBagInterface;

src/lib/RichText/Validator/CustomTemplateValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function validateDocument(DOMDocument $xmlDocument): array
6565
}
6666

6767
// Custom Styles does not have any attributes, so we can skip validation for them
68-
if(isset($this->customStylesConfiguration[$tagName])) {
68+
if (isset($this->customStylesConfiguration[$tagName])) {
6969
continue;
7070
}
7171

tests/integration/Repository/RichTextFieldTypeIntegrationTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,17 @@ public function testExternalLinkStoringAfterUpdate(): void
655655
$contentUpdateStruct = $contentService->newContentUpdateStruct();
656656
$contentUpdateStruct->setField('description', $xmlDocument, 'eng-GB');
657657
$contentDraft = $contentService->updateContent(
658-
$contentService->createContentDraft($content->contentInfo)->versionInfo,
658+
$contentService->createContentDraft($content->getContentInfo())->getVersionInfo(),
659659
$contentUpdateStruct
660660
);
661-
$content = $contentService->publishVersion($contentDraft->versionInfo);
661+
$content = $contentService->publishVersion($contentDraft->getVersionInfo());
662+
$field = $content->getField('description');
663+
664+
self::assertNotNull($field);
665+
662666
$urlIdsAfterUpdate = $this->getUrlIdsForContentObjectAttributeIdAndVersionNo(
663-
$content->getField('description')->id,
664-
$content->contentInfo->currentVersionNo
667+
$field->getId(),
668+
$content->getContentInfo()->currentVersionNo
665669
);
666670

667671
$urlId = $this->getUrlIdForLink($testLink);

0 commit comments

Comments
 (0)