Skip to content

Commit 45aa1d9

Browse files
4.8.1 (#971)
1 parent b9bf0ce commit 45aa1d9

7 files changed

Lines changed: 23 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.8.1](https://github.com/sonata-project/SonataClassificationBundle/compare/4.8.0...4.8.1) - 2024-08-26
6+
### Fixed
7+
- [[#968](https://github.com/sonata-project/SonataClassificationBundle/pull/968)] Symfony 7.1 deprecation about `Symfony\Component\HttpKernel\DependencyInjection\Extension` usage ([@VincentLanglet](https://github.com/VincentLanglet))
8+
59
## [4.8.0](https://github.com/sonata-project/SonataClassificationBundle/compare/4.7.2...4.8.0) - 2023-12-14
610
### Added
711
- [[#952](https://github.com/sonata-project/SonataClassificationBundle/pull/952)] Support for packages from `symfony/*` 7.x ([@phansys](https://github.com/phansys))

src/Admin/Filter/CategoryFilter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function filter(ProxyQueryInterface $query, string $alias, string $field,
3535

3636
$query
3737
->getQueryBuilder()
38-
->andWhere(sprintf('%s.%s = :category', $alias, $field))
38+
->andWhere(\sprintf('%s.%s = :category', $alias, $field))
3939
->setParameter('category', $data->getValue());
4040

4141
$this->setActive(true);
@@ -101,7 +101,7 @@ private function getChoices(): array
101101

102102
\assert(null !== $catContext);
103103

104-
$choices[sprintf('%s (%s)', $category->getName() ?? '', $catContext->getId() ?? '')] = $category->getId();
104+
$choices[\sprintf('%s (%s)', $category->getName() ?? '', $catContext->getId() ?? '')] = $category->getId();
105105

106106
$this->visitChild($category, $choices);
107107
}
@@ -119,7 +119,7 @@ private function visitChild(CategoryInterface $category, array &$choices, int $l
119119
}
120120

121121
foreach ($category->getChildren() as $child) {
122-
$choices[sprintf('%s %s', str_repeat('-', 1 * $level), $child->__toString())] = $child->getId();
122+
$choices[\sprintf('%s %s', str_repeat('-', 1 * $level), $child->__toString())] = $child->getId();
123123

124124
$this->visitChild($child, $choices, $level + 1);
125125
}

src/Admin/Filter/CollectionFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function filter(ProxyQueryInterface $query, string $alias, string $field,
3434

3535
$query
3636
->getQueryBuilder()
37-
->andWhere(sprintf('%s.%s = :collection', $alias, $field))
37+
->andWhere(\sprintf('%s.%s = :collection', $alias, $field))
3838
->setParameter('collection', $data->getValue());
3939

4040
$this->setActive(true);

src/Command/FixContextCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
6565
$tagId = $tag->getId();
6666
\assert(null !== $tagId);
6767

68-
$output->writeln(sprintf(' > attach default context to tag: %s (%s)', $tag->getSlug() ?? '', $tagId));
68+
$output->writeln(\sprintf(' > attach default context to tag: %s (%s)', $tag->getSlug() ?? '', $tagId));
6969
$tag->setContext($defaultContext);
7070

7171
$this->tagManager->save($tag);
@@ -81,7 +81,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
8181
$collectionId = $collection->getId();
8282
\assert(null !== $collectionId);
8383

84-
$output->writeln(sprintf(' > attach default context to collection: %s (%s)', $collection->getSlug() ?? '', $collectionId));
84+
$output->writeln(\sprintf(' > attach default context to collection: %s (%s)', $collection->getSlug() ?? '', $collectionId));
8585
$collection->setContext($defaultContext);
8686

8787
$this->collectionManager->save($collection);
@@ -97,7 +97,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
9797
$categoryId = $category->getId();
9898
\assert(null !== $categoryId);
9999

100-
$output->writeln(sprintf(' > attach default context to collection: %s (%s)', $category->getSlug() ?? '', $categoryId));
100+
$output->writeln(\sprintf(' > attach default context to collection: %s (%s)', $category->getSlug() ?? '', $categoryId));
101101
$category->setContext($defaultContext);
102102

103103
$this->categoryManager->save($category);

src/Document/CategoryManager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public function getRootCategoryWithChildren(CategoryInterface $category): Catego
4646
{
4747
$context = $category->getContext();
4848
if (null === $context) {
49-
throw new \InvalidArgumentException(sprintf(
49+
throw new \InvalidArgumentException(\sprintf(
5050
'Context of category "%s" cannot be null.',
5151
$category->getId() ?? ''
5252
));
5353
}
5454

5555
$contextId = $context->getId();
5656
if (null === $contextId) {
57-
throw new \InvalidArgumentException(sprintf(
57+
throw new \InvalidArgumentException(\sprintf(
5858
'Context of category "%s" must have an not null identifier.',
5959
$category->getId() ?? ''
6060
));
@@ -72,7 +72,7 @@ public function getRootCategoryWithChildren(CategoryInterface $category): Catego
7272
}
7373
}
7474

75-
throw new \InvalidArgumentException(sprintf('Category "%s" does not exist.', $category->getId() ?? ''));
75+
throw new \InvalidArgumentException(\sprintf('Category "%s" does not exist.', $category->getId() ?? ''));
7676
}
7777

7878
public function getRootCategoriesForContext(?ContextInterface $context = null): array
@@ -81,7 +81,7 @@ public function getRootCategoriesForContext(?ContextInterface $context = null):
8181

8282
$contextId = $context->getId();
8383
if (null === $contextId) {
84-
throw new \InvalidArgumentException(sprintf(
84+
throw new \InvalidArgumentException(\sprintf(
8585
'Context "%s" must have an not null identifier.',
8686
$context->getName() ?? ''
8787
));
@@ -110,7 +110,7 @@ public function getAllRootCategories(bool $loadChildren = true): array
110110

111111
foreach ($rootCategories as $category) {
112112
if (null === $category->getContext()) {
113-
throw new \LogicException(sprintf(
113+
throw new \LogicException(\sprintf(
114114
'Context of category "%s" cannot be null.',
115115
$category->getId() ?? ''
116116
));

src/Entity/CategoryManager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public function getRootCategoryWithChildren(CategoryInterface $category): Catego
4646
{
4747
$context = $category->getContext();
4848
if (null === $context) {
49-
throw new \InvalidArgumentException(sprintf(
49+
throw new \InvalidArgumentException(\sprintf(
5050
'Context of category "%s" cannot be null.',
5151
$category->getId() ?? ''
5252
));
5353
}
5454

5555
$contextId = $context->getId();
5656
if (null === $contextId) {
57-
throw new \InvalidArgumentException(sprintf(
57+
throw new \InvalidArgumentException(\sprintf(
5858
'Context of category "%s" must have an not null identifier.',
5959
$category->getId() ?? ''
6060
));
@@ -72,7 +72,7 @@ public function getRootCategoryWithChildren(CategoryInterface $category): Catego
7272
}
7373
}
7474

75-
throw new \InvalidArgumentException(sprintf('Category "%s" does not exist.', $category->getId() ?? ''));
75+
throw new \InvalidArgumentException(\sprintf('Category "%s" does not exist.', $category->getId() ?? ''));
7676
}
7777

7878
public function getRootCategoriesForContext(?ContextInterface $context = null): array
@@ -83,7 +83,7 @@ public function getRootCategoriesForContext(?ContextInterface $context = null):
8383

8484
$contextId = $context->getId();
8585
if (null === $contextId) {
86-
throw new \InvalidArgumentException(sprintf(
86+
throw new \InvalidArgumentException(\sprintf(
8787
'Context "%s" must have an not null identifier.',
8888
$context->getName() ?? ''
8989
));
@@ -111,7 +111,7 @@ public function getAllRootCategories(bool $loadChildren = true): array
111111

112112
foreach ($rootCategories as $category) {
113113
if (null === $category->getContext()) {
114-
throw new \LogicException(sprintf(
114+
throw new \LogicException(\sprintf(
115115
'Context of category "%s" cannot be null.',
116116
$category->getId() ?? ''
117117
));

src/Form/Type/CategorySelectorType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getChoices(Options $options): array
7575
$rootCategoryId = $rootCategory->getId();
7676
\assert(null !== $context && null !== $rootCategoryId);
7777

78-
$choices[$rootCategoryId] = sprintf('%s (%s)', $rootCategory->getName() ?? '', $context->getId() ?? '');
78+
$choices[$rootCategoryId] = \sprintf('%s (%s)', $rootCategory->getName() ?? '', $context->getId() ?? '');
7979

8080
$this->childWalker($rootCategory, $category, $choices);
8181
}
@@ -110,7 +110,7 @@ private function childWalker(CategoryInterface $rootCategory, CategoryInterface
110110
continue;
111111
}
112112

113-
$choices[$childCategoryId] = sprintf('%s %s', str_repeat('-', 1 * $level), $childCategory->getName() ?? '');
113+
$choices[$childCategoryId] = \sprintf('%s %s', str_repeat('-', 1 * $level), $childCategory->getName() ?? '');
114114

115115
$this->childWalker($childCategory, $category, $choices, $level + 1);
116116
}

0 commit comments

Comments
 (0)