Skip to content

Commit ab0a0dc

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 422d31b + 039bb24 commit ab0a0dc

38 files changed

+119
-46
lines changed

.php_cs.dist

+12-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@ return PhpCsFixer\Config::create()
77
->setRules(array(
88
'@Symfony' => true,
99
'@Symfony:risky' => true,
10-
'array_syntax' => array('syntax' => 'short'),
10+
'array_syntax' => ['syntax' => 'short'],
1111
'protected_to_private' => false,
1212
'semicolon_after_instruction' => false,
13+
'header_comment' => [
14+
'header' => <<<EOF
15+
This file is part of the Symfony MakerBundle package.
16+
17+
(c) Fabien Potencier <[email protected]>
18+
19+
For the full copyright and license information, please view the LICENSE
20+
file that was distributed with this source code.
21+
EOF
22+
]
1323
))
1424
->setRiskyAllowed(true)
1525
->setFinder(
1626
PhpCsFixer\Finder::create()
1727
->in(__DIR__.'/src')
1828
)
19-
;
29+
;

src/ApplicationAwareMakerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Command/MakerCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/ConsoleStyle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/DependencyBuilder.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*
@@ -53,4 +53,21 @@ public function getMissingDependencies(): array
5353

5454
return array_merge($missingPackages, $missingOptionalPackages);
5555
}
56+
57+
/**
58+
* @internal
59+
*/
60+
public function getAllRequiredDependencies(): array
61+
{
62+
$dependencies = [];
63+
foreach ($this->dependencies as $class => $package) {
64+
if (!$package['required']) {
65+
continue;
66+
}
67+
68+
$dependencies[] = $package['name'];
69+
}
70+
71+
return $dependencies;
72+
}
5673
}

src/DependencyInjection/CompilerPass/MakeCommandRegistrationPass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony MakerBundle package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass;
413

514
use Symfony\Bundle\MakerBundle\Command\MakerCommand;

src/DependencyInjection/MakerExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Event/ConsoleErrorSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/EventRegistry.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Exception/RuntimeCommandException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/ExtraGenerationMakerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/FileManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Generator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/InputConfiguration.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony MakerBundle package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Bundle\MakerBundle;
413

514
final class InputConfiguration

src/Maker/AbstractMaker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeController.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Maker;
1313

14-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
14+
use Doctrine\Common\Annotations\Annotation;
1515
use Symfony\Bundle\MakerBundle\ConsoleStyle;
1616
use Symfony\Bundle\MakerBundle\DependencyBuilder;
1717
use Symfony\Bundle\MakerBundle\InputConfiguration;
@@ -86,7 +86,9 @@ public function writeSuccessMessage(array $params, ConsoleStyle $io)
8686
public function configureDependencies(DependencyBuilder $dependencies)
8787
{
8888
$dependencies->addClassDependency(
89-
Route::class,
89+
// we only need doctrine/annotations, which contains
90+
// the recipe that loads annotation routes
91+
Annotation::class,
9092
'annotations'
9193
);
9294
}

src/Maker/MakeEntity.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeFunctionalTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeMigration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeSerializerEncoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeTwigExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeUnitTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Maker/MakeVoter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/MakerBundle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/MakerInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
4+
* This file is part of the Symfony MakerBundle package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

src/Resources/skeleton/controller/Controller.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Controller;
44

5-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
5+
use Symfony\Component\Routing\Annotation\Route;
66
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
77
use Symfony\Component\HttpFoundation\Response;
88

src/Resources/skeleton/controller/ControllerWithTwig.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Controller;
44

5-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
5+
use Symfony\Component\Routing\Annotation\Route;
66
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
77
use Symfony\Component\HttpFoundation\Response;
88

src/Resources/skeleton/doctrine/Repository.tpl.php

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
<?= "<?php\n" ?>
1+
<?= "<?php\n"; ?>
22

33
namespace App\Repository;
44

5-
use App\Entity\<?= $entity_class_name ?>;
5+
use App\Entity\<?= $entity_class_name; ?>;
66
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
77
use Symfony\Bridge\Doctrine\RegistryInterface;
88

9-
class <?= $repository_class_name ?> extends ServiceEntityRepository
9+
/**
10+
* @method <?= $entity_class_name; ?>|null find($id, $lockMode = null, $lockVersion = null)
11+
* @method <?= $entity_class_name; ?>|null findOneBy(array $criteria, array $orderBy = null)
12+
* @method <?= $entity_class_name; ?>[] findAll()
13+
* @method <?= $entity_class_name; ?>[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
14+
*/
15+
class <?= $repository_class_name; ?> extends ServiceEntityRepository
1016
{
1117
public function __construct(RegistryInterface $registry)
1218
{
13-
parent::__construct($registry, <?= $entity_class_name ?>::class);
19+
parent::__construct($registry, <?= $entity_class_name; ?>::class);
1420
}
1521

1622
/*
1723
public function findBySomething($value)
1824
{
19-
return $this->createQueryBuilder('<?= $entity_alias ?>')
20-
->where('<?= $entity_alias ?>.something = :value')->setParameter('value', $value)
21-
->orderBy('<?= $entity_alias ?>.id', 'ASC')
25+
return $this->createQueryBuilder('<?= $entity_alias; ?>')
26+
->where('<?= $entity_alias; ?>.something = :value')->setParameter('value', $value)
27+
->orderBy('<?= $entity_alias; ?>.id', 'ASC')
2228
->setMaxResults(10)
2329
->getQuery()
2430
->getResult()

0 commit comments

Comments
 (0)