Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[AutoMapper] New component to automatically map a source object to a target object #30248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b5592ee
Initial commit and implementation of symfony/automapper
joelwurtz Feb 14, 2019
936bc2f
Add normalizer bridge
joelwurtz Feb 14, 2019
2ea1951
Add missing licence
joelwurtz Feb 14, 2019
d272d9c
Fix typo in interface
joelwurtz Feb 14, 2019
beb0f49
Add attribute checking option
joelwurtz Feb 15, 2019
e4c1385
Allow attribute checking to be set in factory
joelwurtz Feb 15, 2019
cf1fdf2
Add empty test classes
joelwurtz Feb 15, 2019
fc1d87d
Add automapper tests
joelwurtz Feb 19, 2019
bd387f5
Apply suggestions from @dunglas code review
dunglas Mar 25, 2019
20b7735
Add expiremental annotation where needed, add final to class that sho…
joelwurtz Mar 25, 2019
12e5d1f
Fix cs and typo
joelwurtz Mar 25, 2019
26e0c8a
Avoid too many function calls
joelwurtz Mar 25, 2019
678537a
Add interface for generator metadatas
joelwurtz Mar 25, 2019
ceeeaf1
Use array for context and provide helper class
joelwurtz Mar 26, 2019
ec97f74
Use new context construction in normalizer bridge
joelwurtz Mar 26, 2019
92784b1
Fix test case class test
joelwurtz Mar 26, 2019
eb6f638
Remove useless class
joelwurtz Mar 26, 2019
fab7135
expiremental > expiremental in 4.3
joelwurtz Mar 26, 2019
5154440
Fixing tests
Korbeil Dec 31, 2019
c688855
Added AutoMapperNormalizerTest
Korbeil Jan 3, 2020
9f16b43
Context tests
Korbeil Jan 5, 2020
ed00ec3
Add MapperGeneratorMetadataFactory tests
Korbeil Jan 5, 2020
ab82b9f
Add FromSourceMappingExtractor tests
Korbeil Jan 5, 2020
ee908a6
Add FromTargetMappingExtractor tests
Korbeil Jan 5, 2020
cd2d414
WIP PrivateReflectionExtractor tests
Korbeil Jan 6, 2020
cd85e2d
Remove internal for generated mapper
joelwurtz Jan 31, 2020
f74e22e
Fix context rebase
joelwurtz Jan 31, 2020
ee671dd
Add missing deps in dev
joelwurtz Jan 31, 2020
78ef805
Use property read / write info extractor
joelwurtz Jan 31, 2020
1e4bd5e
Fix cs
joelwurtz Jan 31, 2020
20a37df
Add tests and date time mutable / immutable transformations
joelwurtz Feb 2, 2020
af1fdf2
Fix header, expiremental in 5.1
joelwurtz Feb 2, 2020
c07edd2
Fix php version
joelwurtz Feb 2, 2020
ad190a2
Fix createFromImmutable not available in php 7.2
joelwurtz Feb 2, 2020
9c3cb23
Fix test
joelwurtz Feb 2, 2020
fecf949
Better conditions on automapper
joelwurtz Feb 3, 2020
ad0f487
Remove bad deps on rebase
joelwurtz Feb 3, 2020
5ba8171
Fix class exists
joelwurtz Feb 3, 2020
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
Prev Previous commit
Next Next commit
Fix header, expiremental in 5.1
  • Loading branch information
joelwurtz committed Jun 20, 2020
commit af1fdf25b4c03fb1c9a5847ed0af43f906f3fc01
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/AutoMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Maps a source data structure (object or array) to a target one.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/AutoMapperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* An auto mapper has the role of mapping a source to a target.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/AutoMapperNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Bridge for symfony/serializer.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Can use a NameConverter to use specific properties name in the target
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Can use a NameConverter to use specific properties name in the source
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Property mapping.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/AutoMapper/Extractor/ReadAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
/**
* Read accessor tell how to read from a property.
*
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class ReadAccessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Extracts mapping between two objects, only gives properties that have the same name.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/AutoMapper/Extractor/WriteMutator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
/**
* Writes mutator tell how to write to a property.
*
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class WriteMutator
Expand Down
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/AutoMapper/GeneratedMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* Class derived for each generated mapper.
*
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
abstract class GeneratedMapper implements MapperInterface
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/Generator/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* Generates code for a mapping class.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* Loads (require) a mapping given metadata.
*
* @expiremental in 5.1
*/
interface ClassLoaderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/Loader/EvalLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Use eval to load mappers.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/Loader/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Use file system to load mapper, and persist them using a registry.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/AutoMapper/MapperContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*
* Allows to customize how is done the mapping
*
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class MapperContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Metadata factory, used to autoregistering new mapping without creating them.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Metadata factory, used to autoregistering new mapping without creating them.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/AutoMapper/MapperMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Mapper metadata.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Fixtures;


class CircularBar
{
/** @var CircularBaz */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Fixtures;


class CircularBaz
{
/** @var CircularFoo */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Fixtures;


class CircularFoo
{
/** @var CircularBar */
Expand Down
9 changes: 9 additions & 0 deletions 9 src/Symfony/Component/AutoMapper/Tests/Fixtures/CityFoo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Fixtures;

class CityFoo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Fixtures;

class FooNoProperties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Tests\Transformer;

use PhpParser\Node\Expr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\AutoMapper\Tests\Transformer;

use PHPUnit\Framework\TestCase;
use Symfony\Component\AutoMapper\Transformer\DateTimeToStringTansformer;
use Symfony\Component\AutoMapper\Transformer\StringToDateTimeTransformer;

class StringToDateTimeTransformerTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Transformer array decorator.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* Create a decorated transformer to handle array type.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Built in transformer to handle PHP scalar types.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\PropertyInfo\Type;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Handle custom callback transformation.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\AutoMapper\MapperMetadataInterface;

/**
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Does not do any transformation, output = input.
*
* @expiremental in 4.3
* @expiremental in 5.1
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\AutoMapper\Transformer;

use PhpParser\Node\Arg;
Expand All @@ -8,6 +17,13 @@
use Symfony\Component\AutoMapper\Extractor\PropertyMapping;
use Symfony\Component\AutoMapper\Generator\UniqueVariableScope;

/**
* @expiremental in 5.1
*
* Transform DateTimeImmutable to DateTime.
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class DateTimeImmutableToMutableTransformer implements TransformerInterface
{
/**
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.