Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4575736

Browse files
author
Michael Moravec
committed
Remove direct dependencies on doctrine/common
1 parent b560883 commit 4575736

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
21-
"doctrine/common": "~2.4",
21+
"doctrine/annotations": "~1.0",
22+
"doctrine/cache": "~1.6",
23+
"doctrine/collections": "~1.0",
24+
"doctrine/event-manager": "~1.0",
25+
"doctrine/persistence": "~1.0",
2226
"fig/link-util": "^1.0",
2327
"twig/twig": "^1.35|^2.4.4",
2428
"psr/cache": "~1.0",
@@ -86,11 +90,10 @@
8690
},
8791
"require-dev": {
8892
"cache/integration-tests": "dev-master",
89-
"doctrine/annotations": "~1.0",
90-
"doctrine/cache": "~1.6",
9193
"doctrine/data-fixtures": "1.0.*",
9294
"doctrine/dbal": "~2.4",
9395
"doctrine/orm": "~2.4,>=2.4.5",
96+
"doctrine/reflection": "~1.0",
9497
"doctrine/doctrine-bundle": "~1.4",
9598
"monolog/monolog": "~1.11",
9699
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
use Doctrine\Common\Persistence\ManagerRegistry;
1515
use Doctrine\Common\Persistence\Mapping\MappingException;
16+
use Doctrine\Common\Persistence\Proxy;
1617
use Doctrine\DBAL\Types\Type;
1718
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1819
use Doctrine\ORM\Mapping\MappingException as LegacyMappingException;
1920
use Symfony\Component\Form\FormTypeGuesserInterface;
2021
use Symfony\Component\Form\Guess\Guess;
2122
use Symfony\Component\Form\Guess\TypeGuess;
2223
use Symfony\Component\Form\Guess\ValueGuess;
23-
use Doctrine\Common\Util\ClassUtils;
2424

2525
class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
2626
{
@@ -162,7 +162,7 @@ public function guessPattern($class, $property)
162162
protected function getMetadata($class)
163163
{
164164
// normalize class name
165-
$class = ClassUtils::getRealClass(ltrim($class, '\\'));
165+
$class = self::getRealClass(ltrim($class, '\\'));
166166

167167
if (array_key_exists($class, $this->cache)) {
168168
return $this->cache[$class];
@@ -179,4 +179,13 @@ protected function getMetadata($class)
179179
}
180180
}
181181
}
182+
183+
private static function getRealClass(string $class) : string
184+
{
185+
if (false === $pos = strrpos($class, '\\' . Proxy::MARKER . '\\')) {
186+
return $class;
187+
}
188+
189+
return substr($class, $pos + Proxy::MARKER_LENGTH + 2);
190+
}
182191
}

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
],
1818
"require": {
1919
"php": "^7.1.3",
20-
"doctrine/common": "~2.4",
2120
"symfony/polyfill-ctype": "~1.8",
22-
"symfony/polyfill-mbstring": "~1.0"
21+
"symfony/polyfill-mbstring": "~1.0",
22+
"doctrine/annotations": "~1.0",
23+
"doctrine/cache": "~1.6",
24+
"doctrine/collections": "~1.0",
25+
"doctrine/event-manager": "~1.0",
26+
"doctrine/persistence": "~1.0"
2327
},
2428
"require-dev": {
2529
"symfony/stopwatch": "~3.4|~4.0",
@@ -35,7 +39,8 @@
3539
"symfony/translation": "~3.4|~4.0",
3640
"doctrine/data-fixtures": "1.0.*",
3741
"doctrine/dbal": "~2.4",
38-
"doctrine/orm": "^2.4.5"
42+
"doctrine/orm": "^2.4.5",
43+
"doctrine/reflection": "~1.0"
3944
},
4045
"conflict": {
4146
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",

src/Symfony/Component/Routing/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"symfony/expression-language": "~3.4|~4.0",
2626
"symfony/dependency-injection": "~3.4|~4.0",
2727
"doctrine/annotations": "~1.0",
28-
"doctrine/common": "~2.2",
2928
"psr/log": "~1.0"
3029
},
3130
"conflict": {

0 commit comments

Comments
 (0)