DrupalCaster.php in VarDumper 8
File
src/Caster/DrupalCaster.php
View source
<?php
namespace Drupal\vardumper\Caster;
use Symfony\Component\VarDumper\Caster\Caster;
use Symfony\Component\VarDumper\Cloner\Stub;
class DrupalCaster extends DrupalCasterBase {
public static function castUser($object, array $array, Stub $stub, $isNested) {
foreach ($object
->getRoles() as $key => $role) {
$array[Caster::PREFIX_PROTECTED . 'roles'][$key] = static::generateLink('/admin/people/permissions/' . $role, $role);
}
return $array;
}
}