Skip to content

Commit 60f738e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/custom-namespaces
2 parents 8046e73 + 09fc38c commit 60f738e

File tree

151 files changed

+1899
-715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1899
-715
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/vendor/
44
/tests/tmp/*
55
/.php_cs.cache
6+
/.phpunit.result.cache

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ return PhpCsFixer\Config::create()
1919
->setRules(array(
2020
'@Symfony' => true,
2121
'@Symfony:risky' => true,
22+
'@PHPUnit75Migration:risky' => true,
2223
'array_syntax' => ['syntax' => 'short'],
2324
'protected_to_private' => false,
2425
'semicolon_after_instruction' => false,

.travis.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
language: php
2-
3-
dist: trusty
42
sudo: false
5-
6-
git:
7-
depth: 1
8-
9-
php:
10-
- 7.0
11-
- 7.1
12-
- 7.2
13-
- 7.3
14-
153
cache:
164
directories:
175
- $HOME/.composer/cache/files
18-
- .phpunit
19-
- vendor
6+
- $HOME/symfony-bridge/.phpunit
7+
8+
services:
9+
- mysql
2010

2111
env:
2212
global:
23-
- SYMFONY_PHPUNIT_DIR=.phpunit
13+
- PHPUNIT_FLAGS="-v"
14+
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
15+
- SYMFONY_REQUIRE='>=3.4'
16+
17+
matrix:
18+
fast_finish: true
19+
include:
20+
- php: 7.1.33
21+
- php: 7.3
22+
- php: 7.3
23+
env: MAKER_TEST_VERSION=dev
24+
allow_failures:
25+
- php: 7.3
26+
env: MAKER_TEST_VERSION=dev
2427

2528
before_install:
26-
- phpenv config-rm xdebug.ini || echo "xdebug not available"
29+
- find ~/.phpenv -name xdebug.ini -delete
30+
- composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
31+
- composer update
2732

2833
install:
29-
- composer update --no-suggest
3034
- ./vendor/bin/simple-phpunit install
3135

3236
script:
33-
- ./vendor/bin/simple-phpunit
37+
- composer validate --strict --no-check-lock
38+
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
3439
- ./vendor/bin/php-cs-fixer fix --dry-run --diff

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
1.13
2+
====
3+
4+
* [make:functional-test] Use Panther when available - #417
5+
thanks to @adrienlucas
6+
7+
* Allow rehashing passwords when possible and needed - #389
8+
thanks to @nicolas-grekas
9+
10+
1.12
11+
====
12+
13+
* Use `[make:*-test]` Use the new WebTestAssertionsTrait methods in the generated
14+
functional tests - #381 thanks to @adrienlucas
15+
16+
* Add a agree terms checkbox to `make:registration-form` - #394
17+
thanks to @ismail1432
18+
19+
* Template generation respects `twig.default_path` - #346
20+
thanks to @LeJeanbono
21+
22+
* [Serializer] Normalizer now implements CacheableSupportsMethodInterface
23+
with condition - #399 thanks to @jojotjebaby
24+
25+
* Deprecate Argon2i encoder used in `make:user` and use
26+
`auto` instead - #398 thanks to @nicolas-grekas
27+
28+
* [make:auth] Added logout support and help for logged in user -
29+
in #406 thanks to @St0iK
30+
31+
* Use new event class names instead of strings in `make:event-subscriber` -
32+
in #403 thanks to @jojotjebaby
33+
134
1.11
235
====
336

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2017 Fabien Potencier
1+
Copyright (c) 2004-2019 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ install:
4949
- IF %PHP%==0 echo @php %%~dp0composer.phar %%* > composer.bat
5050
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
5151
- cd C:\projects\maker-bundle
52+
- composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
5253
- IF %dependencies%==highest appveyor-retry composer update --no-progress --no-suggest --ansi
5354
- vendor/bin/simple-phpunit install
5455

composer.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,29 @@
1111
"homepage": "https://symfony.com/contributors"
1212
}
1313
],
14+
"minimum-stability": "dev",
1415
"require": {
1516
"php": "^7.0.8",
1617
"doctrine/inflector": "^1.2",
1718
"nikic/php-parser": "^4.0",
18-
"symfony/config": "^3.4|^4.0",
19-
"symfony/console": "^3.4|^4.0",
20-
"symfony/dependency-injection": "^3.4|^4.0",
21-
"symfony/filesystem": "^3.4|^4.0",
22-
"symfony/finder": "^3.4|^4.0",
23-
"symfony/framework-bundle": "^3.4|^4.0",
24-
"symfony/http-kernel": "^3.4|^4.0"
19+
"symfony/config": "^3.4|^4.0|^5.0",
20+
"symfony/console": "^3.4|^4.0|^5.0",
21+
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
22+
"symfony/filesystem": "^3.4|^4.0|^5.0",
23+
"symfony/finder": "^3.4|^4.0|^5.0",
24+
"symfony/framework-bundle": "^3.4|^4.0|^5.0",
25+
"symfony/http-kernel": "^3.4|^4.0|^5.0"
2526
},
2627
"require-dev": {
27-
"allocine/twigcs": "^3.0",
28-
"doctrine/doctrine-bundle": "^1.8",
28+
"doctrine/doctrine-bundle": "^1.8|^2.0",
2929
"doctrine/orm": "^2.3",
3030
"friendsofphp/php-cs-fixer": "^2.8",
31-
"symfony/phpunit-bridge": "^3.4|^4.0",
32-
"symfony/process": "^3.4|^4.0",
33-
"symfony/yaml": "^3.4|^4.0"
31+
"friendsoftwig/twigcs": "^3.1.2",
32+
"symfony/http-client": "^4.3|^5.0",
33+
"symfony/phpunit-bridge": "^4.3|^5.0",
34+
"symfony/process": "^3.4|^4.0|^5.0",
35+
"symfony/security-core": "^3.4|^4.0|^5.0",
36+
"symfony/yaml": "^3.4|^4.0|^5.0"
3437
},
3538
"config": {
3639
"preferred-install": "dist",

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
backupGlobals="false"
77
colors="true"
88
bootstrap="vendor/autoload.php"
9+
failOnRisky="true"
10+
failOnWarning="true"
911
>
1012
<php>
1113
<ini name="error_reporting" value="-1" />
1214
<env name="TEST_DATABASE_DSN" value="mysql://root:@127.0.0.1:3306/test_maker" />
13-
<!-- See #237 -->
14-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors" />
1515
</php>
1616

1717
<testsuites>

src/ApplicationAwareMakerInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,5 @@
2020
*/
2121
interface ApplicationAwareMakerInterface
2222
{
23-
/**
24-
* @param Application $application
25-
*/
2623
public function setApplication(Application $application);
2724
}

src/Command/MakerCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ protected function interact(InputInterface $input, OutputInterface $output)
9999
$this->maker->interact($input, $this->io, $this);
100100
}
101101

102-
protected function execute(InputInterface $input, OutputInterface $output)
102+
protected function execute(InputInterface $input, OutputInterface $output): int
103103
{
104104
$this->maker->generate($input, $this->io, $this->generator);
105105

106106
// sanity check for custom makers
107107
if ($this->generator->hasPendingOperations()) {
108108
throw new \LogicException('Make sure to call the writeChanges() method on the generator.');
109109
}
110+
111+
return 0;
110112
}
111113

112114
public function setApplication(Application $application = null)

src/DependencyBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private function calculateMissingDependencies(array $dependencies): array
136136
$missingPackages = [];
137137
$missingOptionalPackages = [];
138138
foreach ($dependencies as $package) {
139-
if (class_exists($package['class']) || interface_exists($package['class'])) {
139+
if (class_exists($package['class']) || interface_exists($package['class']) || trait_exists($package['class'])) {
140140
continue;
141141
}
142142
if (true === $package['required']) {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
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+
12+
namespace Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass;
13+
14+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15+
use Symfony\Component\DependencyInjection\ContainerBuilder;
16+
17+
/**
18+
* Removes injected parameter arguments if they don't exist in this app.
19+
*
20+
* @author Ryan Weaver <[email protected]>
21+
*/
22+
class RemoveMissingParametersPass implements CompilerPassInterface
23+
{
24+
public function process(ContainerBuilder $container)
25+
{
26+
if (!$container->hasParameter('twig.default_path')) {
27+
$container->getDefinition('maker.file_manager')
28+
->replaceArgument(3, null);
29+
}
30+
}
31+
}

src/DependencyInjection/MakerExtension.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ public function load(array $configs, ContainerBuilder $container)
4040
$namespacesHelperDefinition = $container->getDefinition('maker.namespaces_helper');
4141
$namespacesHelperDefinition->replaceArgument(0, $config);
4242

43+
$rootNamespace = trim($config['root_namespace'], '\\');
44+
45+
$autoloaderFinderDefinition = $container->getDefinition('maker.autoloader_finder');
46+
$autoloaderFinderDefinition->replaceArgument(0, $rootNamespace);
47+
48+
$makeCommandDefinition = $container->getDefinition('maker.generator');
49+
$makeCommandDefinition->replaceArgument(1, $rootNamespace);
50+
51+
$doctrineHelperDefinition = $container->getDefinition('maker.doctrine_helper');
52+
$doctrineHelperDefinition->replaceArgument(0, $rootNamespace.'\\Entity');
53+
4354
$container->registerForAutoconfiguration(MakerInterface::class)
4455
->addTag(MakeCommandRegistrationPass::MAKER_TAG);
4556
}

src/Doctrine/DoctrineHelper.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Doctrine;
1313

14+
use Doctrine\Common\Persistence\ManagerRegistry;
1415
use Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory;
16+
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
1517
use Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver;
1618
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
1719
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
20+
use Doctrine\Common\Persistence\Mapping\MappingException as PersistenceMappingException;
1821
use Doctrine\ORM\EntityManagerInterface;
19-
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
2022
use Doctrine\ORM\Mapping\MappingException as ORMMappingException;
21-
use Doctrine\Common\Persistence\Mapping\MappingException as PersistenceMappingException;
2223
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
23-
use Symfony\Bridge\Doctrine\ManagerRegistry;
2424
use Symfony\Bundle\MakerBundle\Util\ClassNameDetails;
2525
use Symfony\Bundle\MakerBundle\Util\NamespacesHelper;
2626

@@ -75,8 +75,6 @@ public function getEntityNamespace(): string
7575
}
7676

7777
/**
78-
* @param string $className
79-
*
8078
* @return MappingDriver|null
8179
*
8280
* @throws \Exception
@@ -123,9 +121,6 @@ public function getEntitiesForAutocomplete(): array
123121
}
124122

125123
/**
126-
* @param string|null $classOrNamespace
127-
* @param bool $disconnected
128-
*
129124
* @return array|ClassMetadata
130125
*/
131126
public function getMetadata(string $classOrNamespace = null, bool $disconnected = false)
@@ -185,8 +180,6 @@ public function getMetadata(string $classOrNamespace = null, bool $disconnected
185180
}
186181

187182
/**
188-
* @param string $entityClassName
189-
*
190183
* @return EntityDetails|null
191184
*/
192185
public function createDoctrineDetails(string $entityClassName)

src/Doctrine/EntityClassGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(Generator $generator)
2626
$this->generator = $generator;
2727
}
2828

29-
public function generateEntityClass(ClassNameDetails $entityClassDetails, bool $apiResource): string
29+
public function generateEntityClass(ClassNameDetails $entityClassDetails, bool $apiResource, bool $withPasswordUpgrade = false): string
3030
{
3131
$repoClassDetails = $this->generator->createClassNameDetails(
3232
$entityClassDetails->getRelativeName(),
@@ -51,6 +51,7 @@ public function generateEntityClass(ClassNameDetails $entityClassDetails, bool $
5151
'entity_full_class_name' => $entityClassDetails->getFullName(),
5252
'entity_class_name' => $entityClassDetails->getShortName(),
5353
'entity_alias' => $entityAlias,
54+
'with_password_upgrade' => $withPasswordUpgrade,
5455
]
5556
);
5657

src/Doctrine/EntityRegenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ private function generateRepository(ClassMetadata $metadata)
234234
'entity_full_class_name' => $metadata->name,
235235
'entity_class_name' => $entityClassName,
236236
'entity_alias' => strtolower($entityClassName[0]),
237+
'with_password_upgrade' => false,
237238
]
238239
);
239240

src/Doctrine/ORMDependencyBuilder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ final class ORMDependencyBuilder
2222
{
2323
/**
2424
* Central method to add dependencies needed for Doctrine ORM.
25-
*
26-
* @param DependencyBuilder $dependencies
2725
*/
2826
public static function buildDependencies(DependencyBuilder $dependencies)
2927
{

0 commit comments

Comments
 (0)