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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.1] - 2026-09-29

### Fixed

- Fix installation alongside `symfony/polyfill-deepclone`, the DeepClone extension version is now checked at runtime
instead of through a Composer conflict by @Brajk19 in https://github.com/sofascore/purgatory-bundle/pull/172

## [2.0.0] - 2026-09-29

### Added
Expand Down Expand Up @@ -148,6 +155,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release

[2.0.1]: https://github.com/sofascore/purgatory-bundle/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.6.0...v2.0.0
[1.6.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.5.0...v1.6.0
[1.5.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.4.0...v1.5.0
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"symfony/yaml": "To configure purge subscriptions using YAML files"
},
"conflict": {
"ext-deepclone": "<0.7.1",
"symfony/cache": "<6.4",
"symfony/expression-language": "<6.4",
"symfony/http-client": "<6.4",
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ composer require symfony/polyfill-deepclone
```

For better performance, you can instead install the [PHP extension](https://github.com/symfony/php-ext-deepclone)
with [PIE](https://github.com/php/pie):
(version 0.7.1 or higher) with [PIE](https://github.com/php/pie):

```sh
pie install symfony/deepclone
Expand Down
10 changes: 8 additions & 2 deletions src/Attribute/PurgeOn.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ public function __construct(
string|array|null $route = null,
string|array|Action|null $actions = null,
) {
if ($if instanceof \Closure && !\function_exists('deepclone_to_array')) {
throw new LogicException('You cannot use a closure for the "if" attribute because DeepClone is not installed. Try running "composer require symfony/polyfill-deepclone" or "pie install symfony/deepclone".');
if ($if instanceof \Closure) {
if (!\function_exists('deepclone_to_array')) {
throw new LogicException('You cannot use a closure for the "if" attribute because DeepClone is not installed. Try running "composer require symfony/polyfill-deepclone" or "pie install symfony/deepclone".');
}

if (false !== ($version = phpversion('deepclone')) && version_compare($version, '0.7.1', '<')) {
throw new LogicException('You cannot use a closure for the "if" attribute because the DeepClone extension is too old. Upgrade it to 0.7.1 or higher.');
}
}

$this->target = \is_array($target) || \is_string($target) ? new ForProperties($target) : $target;
Expand Down
4 changes: 4 additions & 0 deletions src/Attribute/RouteParamValue/DynamicValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ private static function normalizeProvider(string|array|\Closure $provider): stri
throw new LogicException('You cannot use a closure as a "DynamicValues" provider because DeepClone is not installed. Try running "composer require symfony/polyfill-deepclone" or "pie install symfony/deepclone".');
}

if (false !== ($version = phpversion('deepclone')) && version_compare($version, '0.7.1', '<')) {
throw new LogicException('You cannot use a closure as a "DynamicValues" provider because the DeepClone extension is too old. Upgrade it to 0.7.1 or higher.');
}

return $provider;
}

Expand Down
Loading