Skip to content

Commit 3fc5195

Browse files
committed
[DoctrineBridge] Move Doctrine extractor from PropertyInfo
1 parent e16db41 commit 3fc5195

File tree

12 files changed

+34
-25
lines changed

12 files changed

+34
-25
lines changed

src/Symfony/Component/PropertyInfo/Extractors/DoctrineExtractor.php renamed to src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Extractors;
13+
namespace Symfony\Bridge\Doctrine\PropertyInfo;
1414

1515
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
1616
use Doctrine\Common\Persistence\Mapping\MappingException;
@@ -103,9 +103,10 @@ public function getTypes($class, $property, array $context = array())
103103
return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime'));
104104

105105
case 'array':
106-
// No break
106+
return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true));
107+
107108
case 'simple_array':
108-
return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, new Type(Type::BUILTIN_TYPE_INT)));
109+
return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING)));
109110

110111
case 'json_array':
111112
return array(new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true));

src/Symfony/Component/PropertyInfo/Tests/Extractors/DoctrineExtractorTest.php renamed to src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Tests\Extractors;
13+
namespace Symfony\Bridge\Doctrine\PropertyInfo\Tests;
1414

1515
use Doctrine\ORM\EntityManager;
1616
use Doctrine\ORM\Tools\Setup;
17-
use Symfony\Component\PropertyInfo\Extractors\DoctrineExtractor;
17+
use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor;
1818
use Symfony\Component\PropertyInfo\Type;
1919

2020
/**
@@ -43,12 +43,13 @@ public function testGetProperties()
4343
'guid',
4444
'time',
4545
'json',
46+
'simpleArray',
4647
'bool',
4748
'binary',
4849
'foo',
4950
'bar',
5051
),
51-
$this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\DoctrineDummy')
52+
$this->extractor->getProperties('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy')
5253
);
5354
}
5455

@@ -57,7 +58,7 @@ public function testGetProperties()
5758
*/
5859
public function testExtract($property, array $type = null)
5960
{
60-
$this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\DoctrineDummy', $property, array()));
61+
$this->assertEquals($type, $this->extractor->getTypes('Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy', $property, array()));
6162
}
6263

6364
public function typesProvider()
@@ -68,15 +69,16 @@ public function typesProvider()
6869
array('bool', array(new Type(Type::BUILTIN_TYPE_BOOL))),
6970
array('binary', array(new Type(Type::BUILTIN_TYPE_RESOURCE))),
7071
array('json', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true))),
71-
array('foo', array(new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\DoctrineRelation'))),
72+
array('foo', array(new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation'))),
7273
array('bar', array(new Type(
7374
Type::BUILTIN_TYPE_OBJECT,
7475
false,
7576
'Doctrine\Common\Collections\Collection',
7677
true,
7778
new Type(Type::BUILTIN_TYPE_INT),
78-
new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\DoctrineRelation')
79+
new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation')
7980
))),
81+
array('simpleArray', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING)))),
8082
array('notMapped', null),
8183
);
8284
}

src/Symfony/Component/PropertyInfo/Tests/Fixtures/DoctrineDummy.php renamed to src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
13+
namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures;
1414

1515
use Doctrine\ORM\Mapping\Column;
1616
use Doctrine\ORM\Mapping\Entity;
@@ -50,6 +50,10 @@ class DoctrineDummy
5050
* @Column(type="json_array")
5151
*/
5252
private $json;
53+
/**
54+
* @Column(type="simple_array")
55+
*/
56+
private $simpleArray;
5357
/**
5458
* @Column(type="boolean")
5559
*/

src/Symfony/Component/PropertyInfo/Tests/Fixtures/DoctrineRelation.php renamed to src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineRelation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
13+
namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures;
1414

1515
use Doctrine\ORM\Mapping\Column;
1616
use Doctrine\ORM\Mapping\Id;

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"symfony/form": "~2.8|~3.0.0",
2727
"symfony/http-kernel": "~2.2|~3.0.0",
2828
"symfony/property-access": "~2.3|~3.0.0",
29+
"symfony/property-info": "~2.8|3.0",
2930
"symfony/security": "~2.2|~3.0.0",
3031
"symfony/expression-language": "~2.2|~3.0.0",
3132
"symfony/validator": "~2.5,>=2.5.5|~3.0.0",
@@ -37,6 +38,7 @@
3738
"suggest": {
3839
"symfony/form": "",
3940
"symfony/validator": "",
41+
"symfony/property-info": "",
4042
"doctrine/data-fixtures": "",
4143
"doctrine/dbal": "",
4244
"doctrine/orm": ""

src/Symfony/Component/PropertyInfo/Extractors/PhpDocExtractor.php renamed to src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Extractors;
13+
namespace Symfony\Component\PropertyInfo\Extractor;
1414

1515
use phpDocumentor\Reflection\ClassReflector;
1616
use phpDocumentor\Reflection\DocBlock;
@@ -33,11 +33,11 @@ class PhpDocExtractor implements PropertyDescriptionInfoInterface, PropertyTypeI
3333
/**
3434
* @var FileReflector[]
3535
*/
36-
private static $fileReflectors = array();
36+
private $fileReflectors = array();
3737
/**
3838
* @var DocBlock[]
3939
*/
40-
private static $docBlocks = array();
40+
private $docBlocks = array();
4141

4242
/**
4343
* {@inheritdoc}

src/Symfony/Component/PropertyInfo/Extractors/ReflectionExtractor.php renamed to src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Extractors;
13+
namespace Symfony\Component\PropertyInfo\Extractor;
1414

1515
use Symfony\Component\PropertyInfo\PropertyAccessInfoInterface;
1616
use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;

src/Symfony/Component/PropertyInfo/Extractors/SerializerExtractor.php renamed to src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Extractors;
13+
namespace Symfony\Component\PropertyInfo\Extractor;
1414

1515
use Symfony\Component\PropertyInfo\PropertyListRetrieverInterface;
1616
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;

src/Symfony/Component/PropertyInfo/Tests/Extractors/PhpDocExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Symfony\Component\PropertyInfo\Tests\PhpDocExtractors;
1414

15-
use Symfony\Component\PropertyInfo\Extractors\PhpDocExtractor;
15+
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
1616
use Symfony\Component\PropertyInfo\Type;
1717

1818
/**

src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13-
namespace Symfony\Component\PropertyInfo\Tests\Extractors;
13+
namespace Symfony\Component\PropertyInfo\Tests\Extractor;
1414

15-
use Symfony\Component\PropertyInfo\Extractors\ReflectionExtractor;
15+
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
1616
use Symfony\Component\PropertyInfo\Type;
1717

1818
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy