Skip to content

Commit

Permalink
fixed issue with GenerateDataAttributesStringArrayHandling enum in ol…
Browse files Browse the repository at this point in the history
…der php versions
  • Loading branch information
koertho committed Jan 30, 2025
1 parent 7c906fc commit e16cdf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## [2.240.1] - 2025-01-30
- Fixed: php 8.1 only code executed in older versions

## [2.240.0] - 2025-01-07
- Changed: enhance entity finder with universal entity support fallback ([#87](https://github.com/heimrichhannot/contao-utils-bundle/pull/87))
- Changed: backport GenerateDataAttributesStringOptions as options attributes for HtmlUtil::generateDataAttributesString() from v3 ([#91](https://github.com/heimrichhannot/contao-utils-bundle/pull/91))
Expand Down
5 changes: 4 additions & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ services:

HeimrichHannot\UtilsBundle\:
resource: '../../{Command,EntityFinder,Util}/*'
exclude: '../../Util/{Utils.php,DatabaseUtil/CreateWhereForSerializedBlobResult.php,EntityFinder/Element.php}'
exclude:
- '../../Util/{Utils.php,EntityFinder/Element.php}'
- '../../Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php'
- '../../Util/HtmlUtil/*'
autowire: true
autoconfigure: true
bind:
Expand Down
12 changes: 7 additions & 5 deletions src/Util/HtmlUtil/GenerateDataAttributesStringArrayHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace HeimrichHannot\UtilsBundle\Util\HtmlUtil;

enum GenerateDataAttributesStringArrayHandling: string
{
case REDUCE = 'reduce';
case ENCODE = 'encode';
}
if (version_compare(phpversion(), '8.1','>=')) {
enum GenerateDataAttributesStringArrayHandling: string
{
case REDUCE = 'reduce';
case ENCODE = 'encode';
}
}

0 comments on commit e16cdf0

Please sign in to comment.