PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / trunk
Kubio AI Page Builder vtrunk
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / symfony / var-dumper / Caster / DsCaster.php
kubio / vendor / symfony / var-dumper / Caster Last commit date
AmqpCaster.php 1 year ago ArgsStub.php 1 year ago Caster.php 1 year ago ClassStub.php 1 year ago ConstStub.php 4 years ago CutArrayStub.php 4 years ago CutStub.php 4 years ago DOMCaster.php 1 year ago DateCaster.php 1 year ago DoctrineCaster.php 1 year ago DsCaster.php 1 year ago DsPairStub.php 4 years ago EnumStub.php 4 years ago ExceptionCaster.php 1 year ago FiberCaster.php 1 year ago FrameStub.php 4 years ago GmpCaster.php 1 year ago ImagineCaster.php 4 years ago ImgStub.php 1 year ago IntlCaster.php 1 year ago LinkStub.php 1 year ago MemcachedCaster.php 1 year ago MysqliCaster.php 1 year ago PdoCaster.php 1 year ago PgSqlCaster.php 1 year ago ProxyManagerCaster.php 1 year ago RdKafkaCaster.php 1 year ago RedisCaster.php 1 year ago ReflectionCaster.php 1 year ago ResourceCaster.php 1 year ago SplCaster.php 1 year ago StubCaster.php 1 year ago SymfonyCaster.php 1 year ago TraceStub.php 1 year ago UuidCaster.php 4 years ago XmlReaderCaster.php 1 year ago XmlResourceCaster.php 1 year ago
DsCaster.php
71 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\VarDumper\Caster;
13
14 use Ds\Collection;
15 use Ds\Map;
16 use Ds\Pair;
17 use Symfony\Component\VarDumper\Cloner\Stub;
18
19 /**
20 * Casts Ds extension classes to array representation.
21 *
22 * @author Jáchym Toušek <enumag@gmail.com>
23 *
24 * @final
25 */
26 class DsCaster
27 {
28 public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array
29 {
30 $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count();
31 $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity();
32
33 if (!$c instanceof Map) {
34 $a += $c->toArray();
35 }
36
37 return $a;
38 }
39
40 public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array
41 {
42 foreach ($c as $k => $v) {
43 $a[] = new DsPairStub($k, $v);
44 }
45
46 return $a;
47 }
48
49 public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array
50 {
51 foreach ($c->toArray() as $k => $v) {
52 $a[Caster::PREFIX_VIRTUAL.$k] = $v;
53 }
54
55 return $a;
56 }
57
58 public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array
59 {
60 if ($isNested) {
61 $stub->class = Pair::class;
62 $stub->value = null;
63 $stub->handle = 0;
64
65 $a = $c->value;
66 }
67
68 return $a;
69 }
70 }
71