Skip to content

Commit 17f0b62

Browse files
authored
Migrate sf 8 / type info (#297)
This update to symfony 8, but it will deprecate a few things : * TypesMatching is removed * Use the new `TypeInfo` component * Add a type property in source / target metadata which, which type to use * Every package updated to use sf 7.4 / 8.0 * PHP version upgrade requirement to 8.4
2 parents 542c7e9 + 757bddb commit 17f0b62

File tree

140 files changed

+1392
-2007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1392
-2007
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: setup
2727
uses: shivammathur/[email protected]
2828
with:
29-
php-version: 8.3
29+
php-version: 8.4
3030
coverage: none
3131
- name: composer install
3232
run: composer update --prefer-stable
@@ -41,9 +41,8 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
php-versions:
44-
- 8.2
45-
- 8.3
4644
- 8.4
45+
- 8.5
4746
steps:
4847
- name: checkout
4948
uses: actions/checkout@master
@@ -76,7 +75,7 @@ jobs:
7675
- name: setup
7776
uses: shivammathur/[email protected]
7877
with:
79-
php-version: 8.2
78+
php-version: 8.4
8079
coverage: none
8180
extensions: mbstring, fileinfo, json, intl, dom
8281
- name: composer install

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
->in(__DIR__ . '/src')
55
->in(__DIR__ . '/tests')
66
->append([__DIR__ . '/castor.php'])
7-
->exclude(['cache', 'Bundle/Resources/var', 'Bundles/Resources/config'])
7+
->exclude(['cache', 'Bundle/Resources/var', 'Bundle/Resources/config'])
88
;
99

1010
return (new PhpCsFixer\Config())

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
- [GH#297](https://github.com/jolicode/automapper/pull/297) : Support PHP 8.5 and Symfony 8, this library now use the `TypeInfo` Component for types instead of PropertyInfo directly.
11+
- [BC Break] `PropertyTransformerSupportInterface` does not use a `TypesMatching` anymore, you can get the type directly from `SourcePropertyMetadata` or `TargetPropertyMetadata`.
12+
- Debug command now show the type of each property mapped, transformers will also display more information.
13+
- Profiler now show the type of each property mapped, transformers will also display more information.
14+
- Add a castor task to serve the symfony app in tests for debugging purpose.
15+
816
## [9.5.0] - 2025-09-18
917
### Added
1018
- [GH#260](https://github.com/jolicode/automapper/pull/260) Add support for identifiers detection and comparison of objects, this allow mappers to detect if objects are equals based on some properties, which allow better deep merge / update of collections.

bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
\Symfony\Bridge\PhpUnit\DeprecationErrorHandler::register("max[direct]=0&verbose=1");

castor.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,11 @@ function doc_build_github_pages()
154154

155155
run('git reset --hard gh-pages', context: $context);
156156
}
157+
158+
#[AsTask('serve', namespace: 'test', description: 'Serve the symfony app in tests')]
159+
function test_serve($prod = false): void
160+
{
161+
$file = $prod ? 'index.php' : 'dev.php';
162+
163+
run('php -S localhost:8000 tests/Bundle/Resources/public/' . $file, context: context()->withAllowFailure());
164+
}

composer.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,44 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.2",
19+
"php": "^8.4",
2020
"composer-runtime-api": "^2.1 || ^3.0",
21-
"nikic/php-parser": "^5.0",
22-
"symfony/deprecation-contracts": "^3.0",
23-
"symfony/event-dispatcher": "^6.4 || ^7.0",
24-
"symfony/expression-language": "^6.4 || ^7.0",
25-
"symfony/lock": "^6.4 || ^7.0",
26-
"symfony/property-info": "^6.4 || ^7.0",
27-
"symfony/property-access": "^6.4 || ^7.0",
28-
"phpdocumentor/type-resolver": "^1.7",
29-
"phpstan/phpdoc-parser": "^1.13 || ^2.0"
21+
"nikic/php-parser": "^5.6",
22+
"symfony/deprecation-contracts": "^3.6",
23+
"symfony/event-dispatcher": "^7.4 || ^8.0",
24+
"symfony/expression-language": "^7.4 || ^8.0",
25+
"symfony/lock": "^7.4 || ^8.0",
26+
"symfony/property-info": "^7.4 || ^8.0",
27+
"symfony/property-access": "^7.4 || ^8.0",
28+
"symfony/type-info": "^7.4 || ^8.0",
29+
"phpdocumentor/type-resolver": "^1.12",
30+
"phpstan/phpdoc-parser": "^2.3"
3031
},
3132
"require-dev": {
32-
"api-platform/core": "^3.0.4 || ^4",
33-
"doctrine/annotations": "^2.0",
34-
"doctrine/doctrine-bundle": "^2.15",
35-
"doctrine/collections": "^2.2",
36-
"doctrine/inflector": "^2.0",
37-
"doctrine/orm": "^2.0 || ^3.0",
38-
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
33+
"api-platform/core": "^4.2",
34+
"doctrine/collections": "^2.4",
35+
"doctrine/doctrine-bundle": "^3.0",
36+
"doctrine/inflector": "^2.1",
37+
"doctrine/orm": "^3.5",
38+
"matthiasnoback/symfony-dependency-injection-test": "^6.1",
3939
"moneyphp/money": "^3.3.2",
40-
"phpunit/phpunit": "^9.0",
41-
"symfony/browser-kit": "^6.4 || ^7.0",
42-
"symfony/console": "^6.4 || ^7.0",
43-
"symfony/finder": "^6.4 || ^7.2",
44-
"symfony/filesystem": "^6.4 || ^7.0",
45-
"symfony/framework-bundle": "^6.4 || ^7.0",
46-
"symfony/http-client": "^6.4 || ^7.0",
47-
"symfony/http-kernel": "^6.4 || ^7.0",
48-
"symfony/serializer": "^6.4 || ^7.0",
49-
"symfony/stopwatch": "^6.4 || ^7.0",
50-
"symfony/twig-bundle": "^6.4 || ^7.0",
51-
"symfony/uid": "^6.4 || ^7.0",
52-
"symfony/var-dumper": "^6.4 || ^7.2",
53-
"symfony/var-exporter": "^6.4 || ^7.0",
54-
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
55-
"symfony/yaml": "^6.4 || ^7.0",
56-
"willdurand/negotiation": "^3.0"
40+
"phpunit/phpunit": "^12.4",
41+
"symfony/browser-kit": "^7.4 || ^8.0",
42+
"symfony/console": "^7.4 || ^8.0",
43+
"symfony/filesystem": "^7.4 || ^8.0",
44+
"symfony/finder": "^7.4 || ^8.0",
45+
"symfony/framework-bundle": "^7.4 || ^8.0",
46+
"symfony/http-client": "^7.4 || ^8.0",
47+
"symfony/http-kernel": "^7.4 || ^8.0",
48+
"symfony/phpunit-bridge": "^8.0",
49+
"symfony/serializer": "^7.4 || ^8.0",
50+
"symfony/stopwatch": "^7.4 || ^8.0",
51+
"symfony/twig-bundle": "^7.4 || ^8.0",
52+
"symfony/uid": "^7.4 || ^8.0",
53+
"symfony/var-dumper": "^7.4 || ^8.0",
54+
"symfony/web-profiler-bundle": "^7.4 || ^8.0",
55+
"symfony/yaml": "^7.4 || ^8.0",
56+
"willdurand/negotiation": "^3.1"
5757
},
5858
"suggest": {
5959
"symfony/serializer": "Allow to use symfony serializer attributes in mapping"

docs/_nav.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
- [Api Platform](bundle/api-platform.md)
2626
- [Migrate existing application](bundle/migrate.md)
2727
- [Debugging](bundle/debugging.md)
28-
- [Upgrading to 9.0](upgrading-9.0.md)
28+
- [Upgrading](upgrading/upgrading-10.0.md)
29+
- [Upgrading to 9.0](upgrading/upgrading-9.0.md)
2930
- [Contributing](contributing.md)

0 commit comments

Comments
 (0)