Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 909ea54

Browse filesBrowse files
jwagefabpot
authored andcommitted
Fixing issue with filters.
1 parent 8417e69 commit 909ea54
Copy full SHA for 909ea54

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ protected function configure()
5656

5757
protected function execute(InputInterface $input, OutputInterface $output)
5858
{
59-
$filterBundle = str_replace('/', '\\', $input->getOption('bundle'));
60-
$filterEntity = $filterBundle . '\\Entities\\' . str_replace('/', '\\', $input->getOption('entity'));
59+
$filterBundle = $input->getOption('bundle') ? str_replace('/', '\\', $input->getOption('bundle')) : false;
60+
$filterEntity = $filterBundle ? $filterBundle . '\\Entities\\' . str_replace('/', '\\', $input->getOption('entity')) : false;
6161

6262
if (!isset($filterBundle) && isset($filterEntity)) {
6363
throw new \InvalidArgumentException(sprintf('Unable to specify an entity without also specifying a bundle.'));
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7070
$namespace = str_replace('/', '\\', dirname($tmp));
7171
$class = basename($tmp);
7272

73-
if (isset($filterBundle) && $filterBundle != $namespace . '\\' . $class) {
73+
if ($filterBundle && $filterBundle != $namespace . '\\' . $class) {
7474
continue;
7575
}
7676

@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8080
$output->writeln(sprintf('Generating entities for "<info>%s</info>"', $class));
8181

8282
foreach ($metadatas as $metadata) {
83-
if (isset($filterEntity) && strpos($metadata->name, $filterEntity) !== 0) {
83+
if ($filterEntity && strpos($metadata->name, $filterEntity) !== 0) {
8484
continue;
8585
}
8686

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.