Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/var-dumper/Caster/DoctrineCaster.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children | 12f9dff5fda9 |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
10 */ | 10 */ |
11 | 11 |
12 namespace Symfony\Component\VarDumper\Caster; | 12 namespace Symfony\Component\VarDumper\Caster; |
13 | 13 |
14 use Doctrine\Common\Proxy\Proxy as CommonProxy; | 14 use Doctrine\Common\Proxy\Proxy as CommonProxy; |
15 use Doctrine\ORM\PersistentCollection; | |
15 use Doctrine\ORM\Proxy\Proxy as OrmProxy; | 16 use Doctrine\ORM\Proxy\Proxy as OrmProxy; |
16 use Doctrine\ORM\PersistentCollection; | |
17 use Symfony\Component\VarDumper\Cloner\Stub; | 17 use Symfony\Component\VarDumper\Cloner\Stub; |
18 | 18 |
19 /** | 19 /** |
20 * Casts Doctrine related classes to array representation. | 20 * Casts Doctrine related classes to array representation. |
21 * | 21 * |
23 */ | 23 */ |
24 class DoctrineCaster | 24 class DoctrineCaster |
25 { | 25 { |
26 public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested) | 26 public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested) |
27 { | 27 { |
28 foreach (array('__cloner__', '__initializer__') as $k) { | 28 foreach (['__cloner__', '__initializer__'] as $k) { |
29 if (array_key_exists($k, $a)) { | 29 if (array_key_exists($k, $a)) { |
30 unset($a[$k]); | 30 unset($a[$k]); |
31 ++$stub->cut; | 31 ++$stub->cut; |
32 } | 32 } |
33 } | 33 } |
35 return $a; | 35 return $a; |
36 } | 36 } |
37 | 37 |
38 public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested) | 38 public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested) |
39 { | 39 { |
40 foreach (array('_entityPersister', '_identifier') as $k) { | 40 foreach (['_entityPersister', '_identifier'] as $k) { |
41 if (array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { | 41 if (array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { |
42 unset($a[$k]); | 42 unset($a[$k]); |
43 ++$stub->cut; | 43 ++$stub->cut; |
44 } | 44 } |
45 } | 45 } |
47 return $a; | 47 return $a; |
48 } | 48 } |
49 | 49 |
50 public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested) | 50 public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested) |
51 { | 51 { |
52 foreach (array('snapshot', 'association', 'typeClass') as $k) { | 52 foreach (['snapshot', 'association', 'typeClass'] as $k) { |
53 if (array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { | 53 if (array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { |
54 $a[$k] = new CutStub($a[$k]); | 54 $a[$k] = new CutStub($a[$k]); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |