Skip to content

Commit 4e188d5

Browse files
authored
Merge branch 'feature/custom-namespaces-1' into feature/custom-namespaces
2 parents 9ac0b3b + 0890fd3 commit 4e188d5

File tree

182 files changed

+2328
-1732
lines changed

Some content is hidden

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

182 files changed

+2328
-1732
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ jobs:
1616
coding-standards:
1717
name: "Coding Standards (${{ matrix.php-version }})"
1818

19-
runs-on: "ubuntu-18.04"
19+
runs-on: ubuntu-latest
2020

2121
strategy:
2222
fail-fast: false
2323
matrix:
2424
php-version:
25-
- '8.0'
25+
- '8.1'
2626

2727
steps:
2828
-
2929
name: "Checkout code"
30-
uses: "actions/checkout@v2"
30+
uses: "actions/checkout@v3"
3131

3232
-
3333
name: "Install PHP"
@@ -42,13 +42,13 @@ jobs:
4242

4343
-
4444
name: "Composer install"
45-
uses: "ramsey/composer-install@v1"
45+
uses: "ramsey/composer-install@v2"
4646
with:
4747
composer-options: "--no-scripts"
4848

4949
-
5050
name: "Composer install php-cs-fixer"
51-
uses: "ramsey/composer-install@v1"
51+
uses: "ramsey/composer-install@v2"
5252
with:
5353
composer-options: "--no-scripts --working-dir=tools/php-cs-fixer"
5454

@@ -59,7 +59,7 @@ jobs:
5959
test:
6060
name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps"
6161

62-
runs-on: ubuntu-18.04
62+
runs-on: ubuntu-latest
6363

6464
services:
6565
mysql:
@@ -90,28 +90,26 @@ jobs:
9090
fail-fast: false
9191
matrix:
9292
php-version:
93-
- '8.1'
93+
- '8.2'
9494
symfony-version:
95-
- '5.4.*'
96-
- '5.4.x-dev'
97-
- '6.0.x-dev'
98-
- '6.1.x-dev'
99-
- '6.2.x-dev'
95+
- '6.3.x-dev'
96+
- '6.4.x-dev'
97+
- '7.0.x-dev'
10098
dependency-versions: ['highest']
10199
allow-dev-deps-in-apps: ['0']
102100
include:
103-
# testing lowest PHP version with LTS
104-
- php-version: '8.0.0'
105-
symfony-version: '5.4.*'
101+
# testing lowest PHP+dependencies with lowest Symfony
102+
- php-version: '8.1'
103+
symfony-version: '6.3.*'
106104
dependency-versions: 'lowest'
107-
# testing lowest php version with highest 5.x stable
108-
- php-version: '8.0.0'
109-
symfony-version: '5.4.*'
105+
# testing lowest PHP+dependencies with highest Symfony
106+
- php-version: '8.1'
107+
symfony-version: '6.3.*'
110108
dependency-versions: 'highest'
111109

112110
steps:
113111
- name: "Checkout code"
114-
uses: actions/checkout@v2.3.3
112+
uses: actions/checkout@v3
115113

116114
- name: "Start MySQL"
117115
run: |
@@ -136,17 +134,17 @@ jobs:
136134
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
137135

138136
- name: "Composer install"
139-
uses: "ramsey/composer-install@v1"
137+
uses: "ramsey/composer-install@v2"
140138
with:
141139
dependency-versions: "${{ matrix.dependency-versions }}"
142140

143141
- name: "Composer install php-cs-fixer"
144-
uses: "ramsey/composer-install@v1"
142+
uses: "ramsey/composer-install@v2"
145143
with:
146144
composer-options: "--no-scripts --working-dir=tools/php-cs-fixer"
147145

148146
- name: "Composer install twigcs"
149-
uses: "ramsey/composer-install@v1"
147+
uses: "ramsey/composer-install@v2"
150148
with:
151149
composer-options: "--no-scripts --working-dir=tools/twigcs"
152150

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# Changelog
22

3+
## [v1.50.0](https://github.com/symfony/maker-bundle/releases/tag/v1.50.0)
4+
5+
### Feature
6+
7+
- [#1328](https://github.com/symfony/maker-bundle/pull/1328) - Deleting save and remove methods from repositories - *@mdoutreluingne*
8+
- [#986](https://github.com/symfony/maker-bundle/pull/986) - Add RememberMeBadge - *@bechir*
9+
- [#1332](https://github.com/symfony/maker-bundle/pull/1332) - Add conditional @implements tag to Doctrine repository template - *@gremo*
10+
- [#1325](https://github.com/symfony/maker-bundle/pull/1325) - Fix English typo in reset password template - *@pbek*
11+
12+
### Bug
13+
14+
- [#1322](https://github.com/symfony/maker-bundle/pull/1322) - [make:crud] fix typo in Kernel::VERSION usage - *@nacorp*
15+
- [#1324](https://github.com/symfony/maker-bundle/pull/1324) - Fix(Doctrine Repository template)/Avoid potential double call in save method - *@Mano-Lis*
16+
- [#1293](https://github.com/symfony/maker-bundle/pull/1293) - [make:entity] don't set array field default value for nullable column - *@Rootie*
17+
18+
## [v1.49.0](https://github.com/symfony/maker-bundle/releases/tag/v1.49.0)
19+
20+
*June 7th, 2023*
21+
22+
### Feature
23+
24+
- [#1321](https://github.com/symfony/maker-bundle/pull/1321) - Changing make:stimulus-controller to require StimulusBundle - *@weaverryan*
25+
- [#1309](https://github.com/symfony/maker-bundle/pull/1309) - Apply `get_class_to_class_keyword` PHP-CS-Fixer rule - *@seb-jean*
26+
- [#1276](https://github.com/symfony/maker-bundle/pull/1276) - [make:migration] Change message when required package for migration doesn't exist. - *@bdaler*
27+
- [#1261](https://github.com/symfony/maker-bundle/pull/1261) - [make:registration-form] use UniqueEntity attribute instead of annotation - *@jrushlow*
28+
- [#1253](https://github.com/symfony/maker-bundle/pull/1253) - [make:migration] Add link to new migration files - *@nicolas-grekas*
29+
- [#1251](https://github.com/symfony/maker-bundle/pull/1251) - [make:*] use php-cs-fixer to style/lint all generated php templates - *@jrushlow*
30+
- [#1244](https://github.com/symfony/maker-bundle/pull/1244) - [make:security:form-login] new maker to use built in FormLogin - *@jrushlow*
31+
- [#1242](https://github.com/symfony/maker-bundle/pull/1242) - [make:*] use static return type instead of self for setters - *@jrushlow*
32+
- [#1239](https://github.com/symfony/maker-bundle/pull/1239) - Improve error messages to show PHP & XML configurations are not supported - *@ThomasLandauer*
33+
- [#1238](https://github.com/symfony/maker-bundle/pull/1238) - [make:*] improve output messages for Symfony CLI users - *@jrushlow*
34+
- [#1237](https://github.com/symfony/maker-bundle/pull/1237) - [make:registration-form] Print registration form errors - *@comxd*
35+
### Bug
36+
37+
- [#1307](https://github.com/symfony/maker-bundle/pull/1307) - [make:twig-component] handle upstream changes to how live components are rendered - *@jrushlow*
38+
- [#1270](https://github.com/symfony/maker-bundle/pull/1270) - [make:authenticator] Core\Security or SecurityBundle\Security - Avoid deprecations in 6.2 - *@nacorp*
39+
- [#1265](https://github.com/symfony/maker-bundle/pull/1265) - [make:crud] Make sensio/framework-extra-bundle an optional dependency - *@acrobat*
40+
- [#1264](https://github.com/symfony/maker-bundle/pull/1264) - [make:controller] doctrine/annotations is not needed - *@jrushlow*
41+
- [#1262](https://github.com/symfony/maker-bundle/pull/1262) - [make:reset-password] doctrine/annotations are not needed - *@jrushlow*
42+
43+
## [v1.48.0](https://github.com/symfony/maker-bundle/releases/tag/v1.48.0)
44+
45+
*November 14th, 2022*
46+
47+
### Feature
48+
49+
- [#1221](https://github.com/symfony/maker-bundle/pull/1221) - [make:voter] Set type for subject in Voter template - *@N-M*
50+
### Bug
51+
52+
- [#1232](https://github.com/symfony/maker-bundle/pull/1232) - [make:entity] Minor: Consistent output formatting - *@ThomasLandauer*
53+
- [#1227](https://github.com/symfony/maker-bundle/pull/1227) - [make:registration] Make router optional in MakeRegistrationForm constructor - *@odolbeau*
54+
- [#1226](https://github.com/symfony/maker-bundle/pull/1226) - [make:controller] replace repository method add by save - *@bechir*
55+
356
## [v1.47.0](https://github.com/symfony/maker-bundle/releases/tag/v1.47.0)
457

558
*October 4th, 2022*

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ environment:
2727
TEST_DATABASE_DSN: mysql://root:[email protected]:3306/test_maker
2828
matrix:
2929
- dependencies: highest
30-
php_ver_target: 8.0.19
30+
php_ver_target: 8.1.23
3131

3232
install:
3333
- choco install sqlite --params "/NoTools"

composer.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "symfony/maker-bundle",
55
"type": "symfony-bundle",
66
"license": "MIT",
7-
"keywords": ["generator", "code generator", "scaffolding", "scaffold"],
7+
"keywords": ["generator", "code generator", "scaffolding", "scaffold", "dev"],
88
"authors": [
99
{
1010
"name": "Symfony Community",
@@ -13,28 +13,27 @@
1313
],
1414
"minimum-stability": "dev",
1515
"require": {
16-
"php": ">=8.0",
16+
"php": ">=8.1",
1717
"doctrine/inflector": "^2.0",
1818
"nikic/php-parser": "^4.11",
19-
"symfony/config": "^5.4.7|^6.0",
20-
"symfony/console": "^5.4.7|^6.0",
21-
"symfony/dependency-injection": "^5.4.7|^6.0",
19+
"symfony/config": "^6.3|^7.0",
20+
"symfony/console": "^6.3|^7.0",
21+
"symfony/dependency-injection": "^6.3|^7.0",
2222
"symfony/deprecation-contracts": "^2.2|^3",
23-
"symfony/filesystem": "^5.4.7|^6.0",
24-
"symfony/finder": "^5.4.3|^6.0",
25-
"symfony/framework-bundle": "^5.4.7|^6.0",
26-
"symfony/http-kernel": "^5.4.7|^6.0"
23+
"symfony/filesystem": "^6.3|^7.0",
24+
"symfony/finder": "^6.3|^7.0",
25+
"symfony/framework-bundle": "^6.3|^7.0",
26+
"symfony/http-kernel": "^6.3|^7.0",
27+
"symfony/process": "^6.3|^7.0"
2728
},
2829
"require-dev": {
2930
"composer/semver": "^3.0",
30-
"doctrine/doctrine-bundle": "^2.4",
31+
"doctrine/doctrine-bundle": "^2.5.0",
3132
"doctrine/orm": "^2.10.0",
32-
"symfony/http-client": "^5.4.7|^6.0",
33-
"symfony/phpunit-bridge": "^5.4.7|^6.0",
34-
"symfony/polyfill-php80": "^1.16.0",
35-
"symfony/process": "^5.4.7|^6.0",
36-
"symfony/security-core": "^5.4.7|^6.0",
37-
"symfony/yaml": "^5.4.3|^6.0",
33+
"symfony/http-client": "^6.3|^7.0",
34+
"symfony/phpunit-bridge": "^6.3|^7.0",
35+
"symfony/security-core": "^6.3|^7.0",
36+
"symfony/yaml": "^6.3|^7.0",
3837
"twig/twig": "^2.0|^3.0"
3938
},
4039
"config": {
@@ -43,8 +42,7 @@
4342
},
4443
"conflict": {
4544
"doctrine/orm": "<2.10",
46-
"doctrine/doctrine-bundle": "<2.4",
47-
"symfony/doctrine-bridge": "<5.4"
45+
"doctrine/doctrine-bundle": "<2.4"
4846
},
4947
"autoload": {
5048
"psr-4": { "Symfony\\Bundle\\MakerBundle\\": "src/" }
@@ -54,7 +52,7 @@
5452
},
5553
"extra": {
5654
"branch-alias": {
57-
"dev-main": "1.0-dev"
55+
"dev-main": "1.x-dev"
5856
}
5957
}
6058
}

src/Command/MakerCommand.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Bundle\MakerBundle\Generator;
2020
use Symfony\Bundle\MakerBundle\InputConfiguration;
2121
use Symfony\Bundle\MakerBundle\MakerInterface;
22+
use Symfony\Bundle\MakerBundle\Util\TemplateLinter;
2223
use Symfony\Bundle\MakerBundle\Validator;
2324
use Symfony\Component\Console\Application;
2425
use Symfony\Component\Console\Command\Command;
@@ -36,8 +37,12 @@ final class MakerCommand extends Command
3637
private ConsoleStyle $io;
3738
private bool $checkDependencies = true;
3839

39-
public function __construct(private MakerInterface $maker, private FileManager $fileManager, private Generator $generator)
40-
{
40+
public function __construct(
41+
private MakerInterface $maker,
42+
private FileManager $fileManager,
43+
private Generator $generator,
44+
private TemplateLinter $linter,
45+
) {
4146
$this->inputConfig = new InputConfiguration();
4247

4348
parent::__construct();
@@ -90,13 +95,19 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
9095

9196
protected function execute(InputInterface $input, OutputInterface $output): int
9297
{
98+
if ($output->isVerbose()) {
99+
$this->linter->writeLinterMessage($output);
100+
}
101+
93102
$this->maker->generate($input, $this->io, $this->generator);
94103

95104
// sanity check for custom makers
96105
if ($this->generator->hasPendingOperations()) {
97106
throw new \LogicException('Make sure to call the writeChanges() method on the generator.');
98107
}
99108

109+
$this->linter->lintFiles($this->generator->getGeneratedFiles());
110+
100111
return 0;
101112
}
102113

src/Console/MigrationDiffFilteredOutput.php

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,7 @@
1414
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616

17-
// look for the "string|iterable" type on OutputInterface::write()
18-
// @legacy - Use MigrationDiffFilteredOutput_php8 when Symfony 5.4 is no longer supported
19-
if (!(new \ReflectionMethod(OutputInterface::class, 'write'))->getParameters()[0]->getType()) {
20-
class MigrationDiffFilteredOutput implements OutputInterface
21-
{
22-
use BaseMakerMigrationDiffFilteredOuputTrait;
23-
24-
public function write($messages, $newline = false, $options = 0)
25-
{
26-
$this->_write($messages, $newline, $options);
27-
}
28-
29-
public function writeln($messages, $options = 0)
30-
{
31-
$this->_writeln($messages, $options);
32-
}
33-
34-
public function setVerbosity($level)
35-
{
36-
$this->output->setVerbosity($level);
37-
}
38-
39-
public function setDecorated($decorated)
40-
{
41-
$this->output->setDecorated($decorated);
42-
}
43-
}
44-
} else {
45-
require __DIR__.'/MigrationDiffFilteredOutput_php8';
46-
}
47-
48-
trait BaseMakerMigrationDiffFilteredOuputTrait
17+
class MigrationDiffFilteredOutput implements OutputInterface
4918
{
5019
private string $buffer = '';
5120
private bool $previousLineWasRemoved = false;
@@ -55,20 +24,30 @@ public function __construct(
5524
) {
5625
}
5726

58-
public function _write($messages, bool $newline = false, $options = 0)
27+
public function write($messages, bool $newline = false, $options = 0): void
5928
{
6029
$messages = $this->filterMessages($messages, $newline);
6130

6231
$this->output->write($messages, $newline, $options);
6332
}
6433

65-
public function _writeln($messages, int $options = 0)
34+
public function writeln($messages, int $options = 0): void
6635
{
6736
$messages = $this->filterMessages($messages, true);
6837

6938
$this->output->writeln($messages, $options);
7039
}
7140

41+
public function setVerbosity(int $level): void
42+
{
43+
$this->output->setVerbosity($level);
44+
}
45+
46+
public function setDecorated(bool $decorated): void
47+
{
48+
$this->output->setDecorated($decorated);
49+
}
50+
7251
public function getVerbosity(): int
7352
{
7453
return $this->output->getVerbosity();
@@ -99,7 +78,7 @@ public function isDecorated(): bool
9978
return $this->output->isDecorated();
10079
}
10180

102-
public function setFormatter(OutputFormatterInterface $formatter)
81+
public function setFormatter(OutputFormatterInterface $formatter): void
10382
{
10483
$this->output->setFormatter($formatter);
10584
}

0 commit comments

Comments
 (0)