Navigation Menu

Skip to content

Commit

Permalink
Add expiremental annotation where needed, add final to class that sho…
Browse files Browse the repository at this point in the history
…uld not be extended
  • Loading branch information
joelwurtz committed Mar 25, 2019
1 parent 380e56c commit 595b67f
Show file tree
Hide file tree
Showing 35 changed files with 114 additions and 62 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Component/AutoMapper/AutoMapper.php
Expand Up @@ -40,6 +40,8 @@
/**
* Maps a source data structure (object or array) to a target one.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class AutoMapper implements AutoMapperInterface, AutoMapperRegistryInterface, MapperGeneratorMetadataRegistryInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/AutoMapper/AutoMapperInterface.php
Expand Up @@ -14,6 +14,8 @@
/**
* An auto mapper has the role of mapping a source to a target.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
interface AutoMapperInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/AutoMapper/AutoMapperNormalizer.php
Expand Up @@ -18,6 +18,8 @@
/**
* Bridge for symfony/serializer.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class AutoMapperNormalizer implements NormalizerInterface, DenormalizerInterface
Expand Down
Expand Up @@ -11,6 +11,11 @@

namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class CircularReferenceException extends \RuntimeException
{
}
Expand Up @@ -11,6 +11,11 @@

namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class CompileException extends \RuntimeException
{
}
Expand Up @@ -11,6 +11,11 @@

namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class InvalidMappingException extends \RuntimeException
{
}
Expand Up @@ -11,6 +11,11 @@

namespace Symfony\Component\AutoMapper\Exception;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class NoMappingFoundException extends \RuntimeException
{
}
Expand Up @@ -24,6 +24,8 @@
*
* Can use a NameConverter to use specific properties name in the target
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class FromSourceMappingExtractor extends MappingExtractor
Expand Down
Expand Up @@ -24,6 +24,8 @@
*
* Can use a NameConverter to use specific properties name in the source
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class FromTargetMappingExtractor extends MappingExtractor
Expand Down
Expand Up @@ -16,6 +16,8 @@
/**
* Property mapping.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class PropertyMapping
Expand Down
Expand Up @@ -16,6 +16,8 @@
/**
* Extracts mapping between two objects, only gives properties that have the same name.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class SourceTargetMappingExtractor extends MappingExtractor
Expand Down
6 changes: 5 additions & 1 deletion src/Symfony/Component/AutoMapper/Generator/Generator.php
Expand Up @@ -30,8 +30,12 @@

/**
* Generate code for a mapping class.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class Generator
final class Generator
{
private $parser;

Expand Down
21 changes: 14 additions & 7 deletions src/Symfony/Component/AutoMapper/Loader/EvalLoader.php
@@ -1,9 +1,12 @@
<?php
/**
* Created by IntelliJ IDEA.
* User: joelwurtz
* Date: 2/14/19
* Time: 2:07 PM.

/*
* 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\Loader;
Expand All @@ -13,9 +16,13 @@
use Symfony\Component\AutoMapper\MapperGeneratorMetadataInterface;

/**
* Uses a generator and eval to requiring mapping of a class.
* Use eval to load mappers
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class EvalLoader implements ClassLoaderInterface
final class EvalLoader implements ClassLoaderInterface
{
private $generator;

Expand Down
9 changes: 8 additions & 1 deletion src/Symfony/Component/AutoMapper/Loader/FileLoader.php
Expand Up @@ -15,7 +15,14 @@
use Symfony\Component\AutoMapper\Generator\Generator;
use Symfony\Component\AutoMapper\MapperGeneratorMetadataInterface;

class FileLoader implements ClassLoaderInterface
/**
* Use file system to load mapper, and persist them using a registry
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class FileLoader implements ClassLoaderInterface
{
private $generator;

Expand Down
Expand Up @@ -18,6 +18,8 @@
/**
* Metadata factory, used to autoregistering new mapping without creating them.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
final class MapperGeneratorMetadataFactory
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/AutoMapper/MapperMetadata.php
Expand Up @@ -20,6 +20,8 @@
/**
* Mapper metadata.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class MapperMetadata implements MapperGeneratorMetadataInterface
Expand Down

This file was deleted.

18 changes: 0 additions & 18 deletions src/Symfony/Component/AutoMapper/Tests/ContextTest.php

This file was deleted.

Expand Up @@ -19,9 +19,11 @@
/**
* Transformer array decorator.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class ArrayTransformer implements TransformerInterface
final class ArrayTransformer implements TransformerInterface
{
private $itemTransformer;

Expand Down
Expand Up @@ -17,9 +17,11 @@
/**
* Create a decorated transformer to handle array type.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class ArrayTransformerFactory extends AbstractUniqueTypeTransformerFactory
final class ArrayTransformerFactory extends AbstractUniqueTypeTransformerFactory
{
private $chainTransformerFactory;

Expand Down
Expand Up @@ -22,9 +22,11 @@
/**
* Built in transformer to handle PHP scalar types.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class BuiltinTransformer implements TransformerInterface
final class BuiltinTransformer implements TransformerInterface
{
private const CAST_MAPPING = [
Type::BUILTIN_TYPE_BOOL => [
Expand Down
Expand Up @@ -15,9 +15,11 @@
use Symfony\Component\PropertyInfo\Type;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class BuiltinTransformerFactory implements TransformerFactoryInterface
final class BuiltinTransformerFactory implements TransformerFactoryInterface
{
private const BUILTIN = [
Type::BUILTIN_TYPE_BOOL,
Expand Down
Expand Up @@ -20,9 +20,11 @@
/**
* Handle custom callback transformation.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class CallbackTransformer implements TransformerInterface
final class CallbackTransformer implements TransformerInterface
{
private $callbackName;

Expand Down
Expand Up @@ -14,9 +14,11 @@
use Symfony\Component\AutoMapper\MapperMetadataInterface;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class ChainTransformerFactory implements TransformerFactoryInterface
final class ChainTransformerFactory implements TransformerFactoryInterface
{
/** @var TransformerFactoryInterface[] */
private $factories = [];
Expand Down
Expand Up @@ -18,9 +18,11 @@
/**
* Does not do any transformation, output = input.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class CopyTransformer implements TransformerInterface
final class CopyTransformer implements TransformerInterface
{
/**
* {@inheritdoc}
Expand Down
Expand Up @@ -20,9 +20,11 @@
/**
* Transform a \DateTimeInterface object to a string.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class DateTimeToStringTansformer implements TransformerInterface
final class DateTimeToStringTansformer implements TransformerInterface
{
private $format;

Expand Down
Expand Up @@ -15,9 +15,11 @@
use Symfony\Component\PropertyInfo\Type;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class DateTimeTransformerFactory extends AbstractUniqueTypeTransformerFactory
final class DateTimeTransformerFactory extends AbstractUniqueTypeTransformerFactory
{
/**
* {@inheritdoc}
Expand Down
Expand Up @@ -25,9 +25,11 @@
* Decorate transformers with condition to handle property with multiples source types
* It will always use the first target type possible for transformation
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class MultipleTransformer implements TransformerInterface
final class MultipleTransformer implements TransformerInterface
{
private const CONDITION_MAPPING = [
Type::BUILTIN_TYPE_BOOL => 'is_bool',
Expand Down
Expand Up @@ -14,9 +14,11 @@
use Symfony\Component\AutoMapper\MapperMetadataInterface;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class MultipleTransformerFactory implements TransformerFactoryInterface
final class MultipleTransformerFactory implements TransformerFactoryInterface
{
private $chainTransformerFactory;

Expand Down
Expand Up @@ -20,9 +20,11 @@
/**
* Tansformer decorator to handle null values.
*
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class NullableTransformer implements TransformerInterface
final class NullableTransformer implements TransformerInterface
{
private $itemTransformer;
private $isTargetNullable;
Expand Down
Expand Up @@ -15,9 +15,11 @@
use Symfony\Component\PropertyInfo\Type;

/**
* @expiremental
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class NullableTransformerFactory implements TransformerFactoryInterface
final class NullableTransformerFactory implements TransformerFactoryInterface
{
private $chainTransformerFactory;

Expand Down

0 comments on commit 595b67f

Please sign in to comment.