Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
"ibexa/core": "~5.0.x-dev",
"ibexa/http-cache": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"symfony/asset": "^6.4",
"symfony/cache": "^6.4",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/form": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/options-resolver": "^6.4",
"symfony/security-core": "^6.4",
"symfony/asset": "^7.2",
"symfony/cache": "^7.2",
"symfony/config": "^7.2",
"symfony/dependency-injection": "^7.2",
"symfony/form": "^7.2",
"symfony/http-kernel": "^7.2",
"symfony/options-resolver": "^7.2",
"symfony/security-core": "^7.2",
"symfony/templating": "^6.4",
"symfony/translation": "^6.4",
"symfony/translation": "^7.2",
"symfony/translation-contracts": "^3.0",
"symfony/validator": "^6.4",
"symfony/yaml": "^6.4",
"symfony/validator": "^7.2",
"symfony/yaml": "^7.2",
"twig/twig": "^3.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.7.5",
"dama/doctrine-test-bundle": "^8.2",
"ibexa/admin-ui": "~5.0.x-dev",
"ibexa/code-style": "~2.0.0",
"ibexa/design-engine": "~5.0.x-dev",
Expand All @@ -42,15 +42,14 @@
"ibexa/solr": "~5.0.x-dev",
"ibexa/test-core": "~5.0.x-dev",
"ibexa/user": "~5.0.x-dev",
"matthiasnoback/symfony-config-test": "^4.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"matthiasnoback/symfony-config-test": "^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^5.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^9.5",
"symfony/finder": "^6.4",
"symfony/notifier": "^6.4",
"symfony/proxy-manager-bridge": "^6.4"
"symfony/finder": "^7.2",
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 0 additions & 18 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1314,18 +1314,6 @@ parameters:
count: 1
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php

-
message: '#^Cannot call method fetchAll\(\) on Doctrine\\DBAL\\ForwardCompatibility\\Result\|int\|string\.$#'
identifier: method.nonObject
count: 1
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php

-
message: '#^Cannot call method fetchOne\(\) on Doctrine\\DBAL\\ForwardCompatibility\\Result\|int\|string\.$#'
identifier: method.nonObject
count: 1
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php

-
message: '#^Method Ibexa\\Tests\\Integration\\FieldTypeRichText\\Repository\\RichTextFieldTypeIntegrationTest\:\:__construct\(\) has parameter \$data with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -1452,12 +1440,6 @@ parameters:
count: 1
path: tests/integration/Repository/RichTextFieldTypeIntegrationTest.php

-
message: '#^Method Ibexa\\Tests\\Integration\\FieldTypeRichText\\Repository\\SetupFactory\\LegacySetupFactory\:\:externalBuildContainer\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/integration/Repository/SetupFactory/LegacySetupFactory.php

-
message: '#^Method Ibexa\\Tests\\Integration\\FieldTypeRichText\\Repository\\SetupFactory\\LegacySetupFactory\:\:loadRichTextSettings\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down
9 changes: 0 additions & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,3 @@ parameters:
- src
- tests
treatPhpDocTypesAsCertain: false
ignoreErrors:
-
message: "#^Cannot call method (fetchOne|fetchAll|fetchAllAssociative|fetchAssociative|fetchAllKeyValue)\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#"
paths:
- src/*
-
message: "#Cannot cast Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string to int.#"
paths:
- src/*
2 changes: 1 addition & 1 deletion src/bundle/IbexaFieldTypeRichTextBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ public function getContainerExtension(): ?ExtensionInterface
$this->extension = new IbexaFieldTypeRichTextExtension();
}

return $this->extension;
return $this->extension ?: null;
}
}
3 changes: 2 additions & 1 deletion src/lib/FieldType/RichText/RichTextStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use DOMXPath;
use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage;
use Ibexa\Contracts\Core\FieldType\StorageGateway;
use Ibexa\Contracts\Core\FieldType\StorageGatewayInterface;
use Ibexa\Contracts\Core\Persistence\Content\Field;
use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
use Ibexa\Core\Base\Exceptions\NotFoundException;
Expand All @@ -24,7 +25,7 @@ class RichTextStorage extends GatewayBasedStorage
/**
* @var \Ibexa\FieldTypeRichText\FieldType\RichText\RichTextStorage\Gateway
*/
protected $gateway;
protected StorageGatewayInterface $gateway;

/**
* @param \Ibexa\Contracts\Core\FieldType\StorageGateway $gateway
Expand Down
6 changes: 4 additions & 2 deletions src/lib/FieldType/RichText/RichTextStorage/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ abstract public function getContentIds(array $remoteIds);
*/
public function getIdUrlMap(array $ids)
{
$ids = array_map(intval(...), $ids);

return $this->urlGateway->getIdUrlMap($ids);
}

Expand Down Expand Up @@ -84,7 +86,7 @@ public function insertUrl($url)
*/
public function linkUrl($urlId, $fieldId, $versionNo): void
{
$this->urlGateway->linkUrl($urlId, $fieldId, $versionNo);
$this->urlGateway->linkUrl((int)$urlId, (int)$fieldId, $versionNo);
}

/**
Expand All @@ -96,6 +98,6 @@ public function linkUrl($urlId, $fieldId, $versionNo): void
*/
public function unlinkUrl($fieldId, $versionNo, array $excludeUrlIds = []): void
{
$this->urlGateway->unlinkUrl($fieldId, $versionNo, $excludeUrlIds);
$this->urlGateway->unlinkUrl((int)$fieldId, $versionNo, $excludeUrlIds);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function getContentIds(array $remoteIds): array
)
->from('ezcontentobject')
->where($query->expr()->in('remote_id', ':remoteIds'))
->setParameter(':remoteIds', $remoteIds, Connection::PARAM_STR_ARRAY)
->setParameter('remoteIds', $remoteIds, Connection::PARAM_STR_ARRAY)
;

$statement = $query->execute();
foreach ($statement->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$statement = $query->executeQuery();
foreach ($statement->fetchAllAssociative() as $row) {
$objectRemoteIdMap[$row['remote_id']] = $row['id'];
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/DataTransformer/RichTextValueTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(FieldType $fieldType, Converter $docbookToXhtml5Edit
*
* @return string
*/
public function transform($value)
public function transform(mixed $value): string
{
if (!$value instanceof Value) {
return '';
Expand All @@ -50,7 +50,7 @@ public function transform($value)
*
* @return \Ibexa\FieldTypeRichText\FieldType\RichText\Value|null
*/
public function reverseTransform($value)
public function reverseTransform(mixed $value): ?Value
{
if ($value === null || empty($value)) {
return $this->fieldType->getEmptyValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function migrate(array $values): int
)
);

return (int)$queryBuilder->execute();
return $queryBuilder->executeStatement();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace Ibexa\Tests\Integration\FieldTypeRichText\Repository;

use DirectoryIterator;
use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType;
use DOMDocument;
use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException;
Expand Down Expand Up @@ -694,10 +693,10 @@ private function getUrlIdForLink(string $link): int
)
->from(DoctrineDatabase::URL_TABLE)
->where('url = :url')
->setParameter(':url', $link, ParameterType::STRING)
->setParameter('url', $link, ParameterType::STRING)
;

$id = $query->execute()->fetchOne();
$id = $query->executeQuery()->fetchOne();

if ($id === false) {
throw new NotFoundException('ezurl', $link);
Expand Down Expand Up @@ -760,18 +759,18 @@ private function getUrlIdsForContentObjectAttributeIdAndVersionNo(
->from('ezurl_object_link')
->where('contentobject_attribute_id = :contentobject_attribute_id')
->andWhere('contentobject_attribute_version = :contentobject_attribute_version')
->setParameter(':contentobject_attribute_version', $versionNo, ParameterType::INTEGER)
->setParameter('contentobject_attribute_version', $versionNo, ParameterType::INTEGER)
->setParameter(
':contentobject_attribute_id',
'contentobject_attribute_id',
$contentObjectAttributeId,
ParameterType::INTEGER
);

$statement = $query->execute();
$statement = $query->executeQuery();

return array_map(
'intval',
array_column($statement->fetchAll(FetchMode::ASSOCIATIVE), 'url_id')
array_column($statement->fetchAllAssociative(), 'url_id')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LegacySetupFactory extends CoreLegacySetupFactory
{
use RichTextSetupFactoryTrait;

protected function externalBuildContainer(ContainerBuilder $containerBuilder)
protected function externalBuildContainer(ContainerBuilder $containerBuilder): void
{
parent::externalBuildContainer($containerBuilder);

Expand Down
Loading