diff --git a/Command/GenerateGridSourceCommand.php b/Command/GenerateGridSourceCommand.php index df669a6..b8af87d 100755 --- a/Command/GenerateGridSourceCommand.php +++ b/Command/GenerateGridSourceCommand.php @@ -9,7 +9,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Sensio\Bundle\GeneratorBundle\Command\Validators; /** * @deprecated @@ -33,7 +32,11 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { - $entity = Validators::validateEntityName($input->getArgument('entity_or_document')); + // Taken from SensioGeneratorBundle: class Command\Validators (see LICENSE) + if (!preg_match('{^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*:[a-zA-Z0-9_\x7f-\xff\\\/]+$}', $entity = $input->getArgument('entity_or_document'))) { + throw new \InvalidArgumentException(sprintf('The entity name isn\'t valid ("%s" given, expecting something like AcmeBlogBundle:Blog/Post)', $entity)); + } + list($bundle, $entity) = $this->parseShortcutNotation($entity); $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle).'\\'.$entity; diff --git a/LICENSE b/LICENSE index 63d1d95..3cee9f1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Copyright (c) 2016-2017 Matthew J. Mucklo Copyright (c) 2012-2015 David Tee -Copyright (c) 2004-2013 Fabien Potencier (for code taken from symfony/symfony) +Copyright (c) 2004-2017 Fabien Potencier (for code taken from symfony/symfony and sensio/generator-bundle) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/composer.json b/composer.json index 01ed5b2..9d39ee9 100755 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ ], "require": { "php": ">=5.6.0", - "sensio/generator-bundle": "2.*|3.*|4.*", "symfony/framework-bundle": "2.*|3.*|4.*", "sensio/framework-extra-bundle": "2.*|3.*|4.*|5.*" },