Skip to content

Instantly share code, notes, and snippets.

@chx
Last active July 23, 2023 03:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chx/a94ea6fed723d6f5352e4e8ff9eb1d41 to your computer and use it in GitHub Desktop.
Save chx/a94ea6fed723d6f5352e4e8ff9eb1d41 to your computer and use it in GitHub Desktop.
<?php
# put this file in ~/.config/psysh/
if (class_exists('Drupal')) {
foreach (\Drupal::entityTypeManager()->getDefinitions() as $definition) {
$class = $definition->getClass();
$parts = explode('\\', $class);
class_alias($class, end($parts));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment