Skip to content

Conversation

@alongosz
Copy link
Member

@alongosz alongosz commented Jul 1, 2025

Caution

Needs to be merged together with ibexa/core#569

  • Drop TMP commit before merging
🎫 Issue IBX-9727

Related PRs:

Description:

Adjusted code after ibexa/core#569 changes with some improvements in the vicinity of changed code.
See the notes in diff comments for reasoning behind the changes.

For QA:

No QA required.

Comment on lines +38 to +43
if (isset($value->name)) {
$data->setName($value->name);
}
if (isset($value->languageCode)) {
$data->setLanguageCode($value->languageCode);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Both properties not accept null.

Comment on lines +37 to +44
return new SectionUpdateData(
new Section(
[
'identifier' => $value->identifier ?? '',
'name' => $value->name ?? '',
]
)
);
Copy link
Member Author

@alongosz alongosz Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

While SectionUpdateData accepts nulls, core Section VO doesn't anymore. There's Assert NotBlank constraint there attached on full stack, so the outcome is the same for an empty string - no need to test against nulls.

Comment on lines +123 to 125
private function generateLocation(int $parentLocationId = self::DEFAULT_PARENT_LOCATION_ID): API\Location
{
return new Core\Location(['id' => 3, 'parentLocationId' => $parentLocationId]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Parent location ID cannot be null anymore

Comment on lines -185 to 175

self::assertNull(
$this->viewParametersListener->setContentEditViewTemplateParameters(
new PreContentViewEvent($contentView)
)
$this->viewParametersListener->setContentEditViewTemplateParameters(
new PreContentViewEvent($contentView)
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Returns void

Comment on lines -199 to +186
self::assertNull(
$this->viewParametersListener->setUserUpdateViewTemplateParameters(
new PreContentViewEvent($view)
)
$this->viewParametersListener->setUserUpdateViewTemplateParameters(
new PreContentViewEvent($view)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Returns void

Comment on lines +78 to 79
/** @phpstan-ignore argument.type */
$this->mapper->reverseMap(new LanguageCreateData());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

The error reported here is the essence of this test, so moved this ignore from the baseline to here.

Comment on lines +87 to +90
yield 'simple' => [['identifier' => 'hash', 'name' => 'Lorem']];
yield 'without_name' => [['identifier' => 'hash', 'name' => '']];
yield 'without_identifier' => [['identifier' => '', 'name' => 'Lorem']];
yield 'with_null' => [['identifier' => '', 'name' => '']];
Copy link
Member Author

@alongosz alongosz Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Main reason for touching this test class - changed null to ''.

{
$query = new Query();
$query->query = $this->createMock(CriterionInterface::class);
$query->sortClauses = [$this->createMock(SortClause::class)];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Erroneous assignment - originally was SortClause instead of an array of SortClauses

@alongosz alongosz force-pushed the ibx-9727-add-missing-type-hints-to-content-vo branch from a4b768e to 96d2bea Compare July 7, 2025 09:52
@alongosz alongosz force-pushed the ibx-9727-add-missing-type-hints-to-content-vo branch from 96d2bea to f76205b Compare July 7, 2025 13:22
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
10.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@alongosz alongosz merged commit 29d9997 into main Jul 7, 2025
22 of 23 checks passed
@alongosz alongosz deleted the ibx-9727-add-missing-type-hints-to-content-vo branch July 7, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants