Skip to content

Commit 3f73de4

Browse files
authored
Merge pull request #3 from visol/feature/v12
[FEAT] Update for v11 & v12
2 parents 3ab98a1 + 87164f7 commit 3f73de4

13 files changed

Lines changed: 106 additions & 28 deletions

.github/workflows/ci.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
check-composer:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

1515
- name: Install PHP
1616
uses: shivammathur/setup-php@v2
@@ -29,12 +29,12 @@ jobs:
2929
strategy:
3030
matrix:
3131
php-version:
32-
- 7.4
33-
- 8.0
3432
- 8.1
33+
- 8.2
34+
- 8.3
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3838

3939
- name: Install PHP
4040
uses: shivammathur/setup-php@v2
@@ -43,4 +43,9 @@ jobs:
4343
coverage: none
4444

4545
- name: PHP lint
46-
run: "find *.php Classes Configuration -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
46+
run: "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
47+
48+
- name: OSKAR-PHP-CS-Fixer
49+
uses: OskarStark/php-cs-fixer-ga@3.22.0
50+
with:
51+
args: --diff --dry-run

.php-cs-fixer.dist.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
// Return a Code Sniffing configuration using
6+
// all sniffers needed for PER
7+
// and additionally:
8+
// - Remove leading slashes in use clauses.
9+
// - PHP single-line arrays should not have trailing comma.
10+
// - Single-line whitespace before closing semicolon are prohibited.
11+
// - Remove unused use statements in the PHP source code
12+
// - Ensure Concatenation to have at least one whitespace around
13+
// - Remove trailing whitespace at the end of blank lines.
14+
return (new \PhpCsFixer\Config())
15+
->setFinder(
16+
(new PhpCsFixer\Finder())
17+
->ignoreVCSIgnored(true)
18+
->in(__DIR__)
19+
)
20+
->setRiskyAllowed(true)
21+
->setRules([
22+
'@DoctrineAnnotation' => true,
23+
'@PER' => true,
24+
'array_syntax' => ['syntax' => 'short'],
25+
'cast_spaces' => ['space' => 'none'],
26+
'concat_space' => ['spacing' => 'one'],
27+
'declare_equal_normalize' => ['space' => 'none'],
28+
'declare_parentheses' => true,
29+
'dir_constant' => true,
30+
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
31+
'function_typehint_space' => true,
32+
'modernize_strpos' => true,
33+
'modernize_types_casting' => true,
34+
'native_function_casing' => true,
35+
'no_alias_functions' => true,
36+
'no_blank_lines_after_phpdoc' => true,
37+
'no_empty_phpdoc' => true,
38+
'no_empty_statement' => true,
39+
'no_extra_blank_lines' => true,
40+
'no_leading_namespace_whitespace' => true,
41+
'no_null_property_initialization' => true,
42+
'no_short_bool_cast' => true,
43+
'no_singleline_whitespace_before_semicolons' => true,
44+
'no_superfluous_elseif' => true,
45+
'no_trailing_comma_in_singleline' => true,
46+
'no_unneeded_control_parentheses' => true,
47+
'no_unused_imports' => true,
48+
'no_useless_else' => true,
49+
'no_useless_nullsafe_operator' => true,
50+
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
51+
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
52+
'php_unit_mock_short_will_return' => true,
53+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
54+
'phpdoc_no_access' => true,
55+
'phpdoc_no_empty_return' => true,
56+
'phpdoc_no_package' => true,
57+
'phpdoc_scalar' => true,
58+
'phpdoc_trim' => true,
59+
'phpdoc_types' => true,
60+
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
61+
'return_type_declaration' => ['space_before' => 'none'],
62+
'single_quote' => true,
63+
'single_space_around_construct' => true,
64+
'single_line_comment_style' => ['comment_types' => ['hash']],
65+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
66+
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
67+
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
68+
]);

Classes/Command/AbstractDoctrineCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
abstract class AbstractDoctrineCommand extends Command
2828
{
29-
3029
protected array $defaultConfiguration = [
3130
'table_storage' => [
3231
'table_name' => 'tx_migrations',
@@ -87,7 +86,7 @@ protected function runCli(): void
8786
$configuration = array_merge(
8887
$this->defaultConfiguration,
8988
[
90-
'migrations_paths' => $extConf['migrationsPaths']
89+
'migrations_paths' => $extConf['migrationsPaths'],
9190
],
9291
);
9392

Classes/Command/DoctrineDumpCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
class DoctrineDumpCommand extends AbstractDoctrineCommand
1212
{
13-
1413
protected function configure(): void
1514
{
1615
parent::configure();
1716

1817
$this
1918
->setAliases(['dump-schema'])
2019
->setDescription('Dump the schema for your database to a migration.')
21-
->setHelp(<<<EOT
20+
->setHelp(
21+
<<<EOT
2222
The <info>%command.name%</info> command dumps the schema for your database to a migration:
2323
2424
<info>%command.full_name%</info>
@@ -56,7 +56,7 @@ protected function configure(): void
5656
/**
5757
* @throws \Exception
5858
*/
59-
protected function execute(InputInterface $input, OutputInterface $output): void
59+
protected function execute(InputInterface $input, OutputInterface $output): int
6060
{
6161
$this->runCli();
6262
}

Classes/Command/DoctrineExecuteCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ protected function configure(): void
5454
InputOption::VALUE_NONE,
5555
'Time all the queries individually.'
5656
)
57-
->setHelp(<<<EOT
57+
->setHelp(
58+
<<<EOT
5859
The <info>%command.name%</info> command executes migration versions up or down manually:
5960
6061
<info>%command.full_name% FQCN</info>
@@ -88,7 +89,7 @@ protected function configure(): void
8889
/**
8990
* @throws \Exception
9091
*/
91-
protected function execute(InputInterface $input, OutputInterface $output): void
92+
protected function execute(InputInterface $input, OutputInterface $output): int
9293
{
9394
$this->runCli();
9495
}

Classes/Command/DoctrineGenerateCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ protected function configure(): void
2121
InputOption::VALUE_REQUIRED,
2222
'The namespace to use for the migration (must be in the list of configured namespaces)'
2323
)
24-
->setHelp(<<<EOT
24+
->setHelp(
25+
<<<EOT
2526
The <info>%command.name%</info> command generates a blank migration class:
2627
2728
<info>%command.full_name%</info>
@@ -37,7 +38,7 @@ protected function configure(): void
3738
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
3839
* @throws \Doctrine\DBAL\Exception
3940
*/
40-
protected function execute(InputInterface $input, OutputInterface $output): void
41+
protected function execute(InputInterface $input, OutputInterface $output): int
4142
{
4243
$this->runCli();
4344
}

Classes/Command/DoctrineLatestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function configure(): void
2323
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
2424
* @throws \Doctrine\DBAL\Exception
2525
*/
26-
protected function execute(InputInterface $input, OutputInterface $output): void
26+
protected function execute(InputInterface $input, OutputInterface $output): int
2727
{
2828
$this->runCli();
2929
}

Classes/Command/DoctrineListCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ protected function configure(): void
1414
$this
1515
->setAliases(['list-migrations'])
1616
->setDescription('Display a list of all available migrations and their status.')
17-
->setHelp(<<<EOT
17+
->setHelp(
18+
<<<EOT
1819
The <info>%command.name%</info> command outputs a list of all available migrations and their status:
1920
2021
<info>%command.full_name%</info>
@@ -29,7 +30,7 @@ protected function configure(): void
2930
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
3031
* @throws \Doctrine\DBAL\Exception
3132
*/
32-
protected function execute(InputInterface $input, OutputInterface $output): void
33+
protected function execute(InputInterface $input, OutputInterface $output): int
3334
{
3435
$this->runCli();
3536
}

Classes/Command/DoctrineMigrateCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
class DoctrineMigrateCommand extends AbstractDoctrineCommand
1212
{
13-
1413
protected function configure(): void
1514
{
1615
$this
@@ -55,7 +54,8 @@ protected function configure(): void
5554
InputOption::VALUE_NONE,
5655
'Time all the queries individually.'
5756
)
58-
->setHelp(<<<EOT
57+
->setHelp(
58+
<<<EOT
5959
The <info>%command.name%</info> command executes migration versions up or down manually:
6060
6161
<info>%command.full_name% FQCN</info>
@@ -89,7 +89,7 @@ protected function configure(): void
8989
/**
9090
* @throws \Exception
9191
*/
92-
protected function execute(InputInterface $input, OutputInterface $output): void
92+
protected function execute(InputInterface $input, OutputInterface $output): int
9393
{
9494
$this->runCli();
9595
}

Classes/Command/DoctrineRollupCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ protected function configure(): void
1616
$this
1717
->setAliases(['rollup'])
1818
->setDescription('Rollup migrations by deleting all tracked versions and insert the one version that exists.')
19-
->setHelp(<<<EOT
19+
->setHelp(
20+
<<<EOT
2021
The <info>%command.name%</info> command rolls up migrations by deleting all tracked versions and
2122
inserts the one version that exists that was created with the <info>migrations:dump-schema</info> command.
2223
@@ -30,7 +31,7 @@ protected function configure(): void
3031
/**
3132
* @throws \Exception
3233
*/
33-
protected function execute(InputInterface $input, OutputInterface $output): void
34+
protected function execute(InputInterface $input, OutputInterface $output): int
3435
{
3536
$this->runCli();
3637
}

0 commit comments

Comments
 (0)