8000 [PropertyInfo] Import the component by dunglas · Pull Request #15858 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyInfo] Import the component #15858

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 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by ex 8000 tension

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
[PropertyInfo] Rename classes and interfaces
  • Loading branch information
dunglas committed Sep 25, 2015
commit e75d1f1f7e31c72627f61983dd93b2fa97d442f1
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
use Doctrine\Common\Persistence\Mapping\MappingException;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;
use Symfony\Component\PropertyInfo\PropertyTypeInfoInterface;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;

/**
* Extracts data using Doctrine ORM and ODM metadata.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class DoctrineExtractor implements PropertyListRetrieverInterface, PropertyTypeInfoInterface
class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface
{
/**
* @var ClassMetadataFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
use phpDocumentor\Reflection\ClassReflector;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\FileReflector;
use Symfony\Component\PropertyInfo\PropertyDescriptionInfoInterface;
use Symfony\Component\PropertyInfo\PropertyTypeInfoInterface;
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;

/**
* Extracts data using a PHPDoc parser.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class PhpDocExtractor implements PropertyDescriptionInfoInterface, PropertyTypeInfoInterface
class PhpDocExtractor implements PropertyDescriptionExtractorInterface, PropertyTypeExtractorInterface
{
const PROPERTY = 0;
const ACCESSOR = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

namespace Symfony\Component\PropertyInfo\Extractor;

use Symfony\Component\PropertyInfo\PropertyAccessInfoInterface;
use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;
use Symfony\Component\PropertyInfo\PropertyTypeInfoInterface;
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;

/**
* Extracts PHP informations using the reflection API.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class ReflectionExtractor implements PropertyListRetrieverInterface, PropertyTypeInfoInterface, PropertyAccessInfoInterface
class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface, PropertyAccessExtractorInterface
{
/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

namespace Symfony\Component\PropertyInfo\Extractor;

use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;

/**
* Lists available properties using Symfony Serializer Component metadata.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class SerializerExtractor implements PropertyListRetrieverInterface
class SerializerExtractor implements PropertyListExtractorInterface
{
/**
* @var ClassMetadataFactoryInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface PropertyAccessInfoInterface
interface PropertyAccessExtractorInterface
{
/**
* Is the property readable?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface PropertyDescriptionInfoInterface
interface PropertyDescriptionExtractorInterface
{
/**
* Gets the short description of the property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
namespace Symfony\Component\PropertyInfo;

/**
* Default {@see PropertyInfoInterface} implementation.
* Default {@see PropertyInfoExtractorInterface} implementation.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class PropertyInfo implements PropertyInfoInterface
class PropertyInfoExtractor implements PropertyInfoExtractorInterface
{
/**
* @var PropertyListRetrieverInterface[]
* @var PropertyListExtractorInterface[]
*/
private $listExtractors;

/**
* @var PropertyTypeInfoInterface[]
* @var PropertyTypeExtractorInterface[]
*/
private $typeExtractors;

/**
* @var PropertyDescriptionInfoInterface[]
* @var PropertyDescriptionExtractorInterface[]
*/
private $descriptionExtractors;

/**
* @var PropertyAccessInfoInterface[]
* @var PropertyAccessExtractorInterface[]
*/
private $accessExtractors;

/**
* @param PropertyListRetrieverInterface[] $listExtractors
* @param PropertyTypeInfoInterface[] $typeExtractors
* @param PropertyDescriptionInfoInterface[] $descriptionExtractors
* @param PropertyAccessInfoInterface[] $accessExtractors
* @param PropertyListExtractorInterface[] $listExtractors
* @param PropertyTypeExtractorInterface[] $typeExtractors
* @param PropertyDescriptionExtractorInterface[] $descriptionExtractors
* @param PropertyAccessExtractorInterface[] $accessExtractors
*/
public function __construct(array $listExtractors = array(), array $typeExtractors = array(), array $descriptionExtractors = array(), array $accessExtractors = array())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface PropertyInfoInterface extends PropertyTypeInfoInterface, PropertyDescriptionInfoInterface, PropertyAccessInfoInterface, PropertyListRetrieverInterface
interface PropertyInfoExtractorInterface extends PropertyTypeExtractorInterface, PropertyDescriptionExtractorInterface, PropertyAccessExtractorInterface, PropertyListExtractorInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface PropertyListRetrieverInterface
interface PropertyListExtractorInterface
{
/**
* Gets the list of properties available for the given class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
interface PropertyTypeInfoInterface
interface PropertyTypeExtractorInterface
{
/**
* Gets types of a property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

namespace Symfony\Component\PropertyInfo\Tests\Fixtures;

use Symfony\Component\PropertyInfo\PropertyAccessInfoInterface;
use Symfony\Component\PropertyInfo\PropertyDescriptionInfoInterface;
use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;
use Symfony\Component\PropertyInfo\PropertyTypeInfoInterface;
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;

/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class DummyExtractor implements PropertyListRetrieverInterface, PropertyDescriptionInfoInterface, PropertyTypeInfoInterface, PropertyAccessInfoInterface
class DummyExtractor implements PropertyListExtractorInterface, PropertyDescriptionExtractorInterface, PropertyTypeExtractorInterface, PropertyAccessExtractorInterface
{
/**
* {@inheritdoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@

namespace Symfony\Component\PropertyInfo\PropertyInfo\Tests;

use Symfony\Component\PropertyInfo\PropertyInfo;
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
use Symfony\Component\PropertyInfo\Tests\Fixtures\DummyExtractor;
use Symfony\Component\PropertyInfo\Type;

/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class PropertyInfoTest extends \PHPUnit_Framework_TestCase
class PropertyInfoExtractorTest extends \PHPUnit_Framework_TestCase
{
/**
* @var PropertyInfo
* @var PropertyInfoExtractor
*/
private $propertyInfo;

public function setUp()
{
$extractors = array(new DummyExtractor());
$this->propertyInfo = new PropertyInfo($extractors, $extractors, $extractors, $extractors);
$this->propertyInfo = new PropertyInfoExtractor($extractors, $extractors, $extractors, $extractors);
}

public function testInstanceOf()
{
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyInfoInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyTypeInfoInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyDescriptionInfoInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyAccessInfoInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface', $this->propertyInfo);
$this->assertInstanceOf('Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface', $this->propertyInfo);
}

public function testGetShortDescription()
Expand Down
0