Skip to content

Commit

Permalink
remove SensioGeneratorBundle dependency for symfony4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmucklo committed Dec 9, 2017
1 parent b6b8587 commit 1b44362
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Command/GenerateGridSourceCommand.php
Expand Up @@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -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.*"
},
Expand Down

0 comments on commit 1b44362

Please sign in to comment.