Skip to content

Commit a3d45a2

Browse files
fix: rendering of enums on PHP < 8.2.0 (#26)
Fix rendering of enums on PHP < 8.2.0
1 parent e740af7 commit a3d45a2

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
matrix:
1313
php-version:
1414
- "8.0"
15+
- "8.1"
1516
- "8.2"
1617
steps:
1718
- name: Checkout

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ test-container80:
4040
@-docker-compose run --rm app80 bash
4141
@docker-compose down -v
4242

43+
.PHONY: test-container81
44+
test-container81:
45+
@-docker-compose run --rm app81 bash
46+
@docker-compose down -v
47+
4348
.PHONY: test-container82
4449
test-container82:
4550
@-docker-compose run --rm app82 bash

docker-compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ services:
1212
- .:/app:delegated
1313
- ~/.composer:/root/.composer:delegated
1414
working_dir: /app
15+
app81:
16+
build:
17+
context: .
18+
args:
19+
PHP_VERSION: '8.1'
20+
environment:
21+
PHP_IDE_CONFIG: 'serverName=olvlvl/attribute-collector'
22+
volumes:
23+
- .:/app:delegated
24+
- ~/.composer:/root/.composer:delegated
25+
working_dir: /app
1526
app82:
1627
build:
1728
context: .

src/TransientCollectionRenderer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ public static function render(TransientCollection $collector): string
2222
2323
// attributes.php @generated by https://github.com/olvlvl/composer-attribute-collector
2424
25-
namespace olvlvl\ComposerAttributeCollector;
26-
27-
Attributes::with(fn () => new Collection(
25+
\olvlvl\ComposerAttributeCollector\Attributes::with(fn () => new \olvlvl\ComposerAttributeCollector\Collection(
2826
targetClasses: $targetClassesCode,
2927
targetMethods: $targetMethodsCode,
3028
targetProperties: $targetPropertiesCode,

0 commit comments

Comments
 (0)