
| Current Path : /var/www/html/sirius-pallets/vendor/drush/drush/src/Formatters/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/vendor/drush/drush/src/Formatters/EntityToArraySimplifier.php |
<?php
declare(strict_types=1);
namespace Drush\Formatters;
use Consolidation\OutputFormatters\Options\FormatterOptions;
use Consolidation\OutputFormatters\Transformations\SimplifyToArrayInterface;
/**
* Simplify a EntityInterface to an array.
*/
class EntityToArraySimplifier implements SimplifyToArrayInterface
{
public function __construct()
{
}
public function canSimplify(\ReflectionClass $dataType): bool
{
return interface_exists('Drupal\Core\Entity\EntityInterface', false) && $dataType->implementsInterface('\Drupal\Core\Entity\EntityInterface');
}
public function simplifyToArray($structuredData, FormatterOptions $options): array
{
return $structuredData->toArray();
}
}