[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <[email protected]> 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 Symfony\Component\VarDumper\Cloner\Stub; 15 16 /** 17 * Casts a caster's Stub. 18 * 19 * @author Nicolas Grekas <[email protected]> 20 * 21 * @final 22 */ 23 class StubCaster 24 { 25 public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) 26 { 27 if ($isNested) { 28 $stub->type = $c->type; 29 $stub->class = $c->class; 30 $stub->value = $c->value; 31 $stub->handle = $c->handle; 32 $stub->cut = $c->cut; 33 $stub->attr = $c->attr; 34 35 if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) { 36 $stub->type = Stub::TYPE_STRING; 37 $stub->class = Stub::STRING_BINARY; 38 } 39 40 $a = []; 41 } 42 43 return $a; 44 } 45 46 public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) 47 { 48 return $isNested ? $c->preservedSubset : $a; 49 } 50 51 public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) 52 { 53 if ($isNested) { 54 $stub->cut += \count($a); 55 56 return []; 57 } 58 59 return $a; 60 } 61 62 public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) 63 { 64 if ($isNested) { 65 $stub->class = $c->dumpKeys ? '' : null; 66 $stub->handle = 0; 67 $stub->value = null; 68 $stub->cut = $c->cut; 69 $stub->attr = $c->attr; 70 71 $a = []; 72 73 if ($c->value) { 74 foreach (array_keys($c->value) as $k) { 75 $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; 76 } 77 // Preserve references with array_combine() 78 $a = array_combine($keys, $c->value); 79 } 80 } 81 82 return $a; 83 } 84 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |