Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
check-composer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -29,12 +29,12 @@ jobs:
strategy:
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -43,4 +43,9 @@ jobs:
coverage: none

- name: PHP lint
run: "find *.php Classes Configuration -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
run: "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"

- name: OSKAR-PHP-CS-Fixer
uses: OskarStark/[email protected]
with:
args: --diff --dry-run
68 changes: 68 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

declare(strict_types=1);

// Return a Code Sniffing configuration using
// all sniffers needed for PER
// and additionally:
// - Remove leading slashes in use clauses.
// - PHP single-line arrays should not have trailing comma.
// - Single-line whitespace before closing semicolon are prohibited.
// - Remove unused use statements in the PHP source code
// - Ensure Concatenation to have at least one whitespace around
// - Remove trailing whitespace at the end of blank lines.
return (new \PhpCsFixer\Config())
->setFinder(
(new PhpCsFixer\Finder())
->ignoreVCSIgnored(true)
->in(__DIR__)
)
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PER' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'dir_constant' => true,
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
'function_typehint_space' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_namespace_whitespace' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
'php_unit_mock_short_will_return' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_no_access' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'return_type_declaration' => ['space_before' => 'none'],
'single_quote' => true,
'single_space_around_construct' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
]);
3 changes: 1 addition & 2 deletions Classes/Command/AbstractDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

abstract class AbstractDoctrineCommand extends Command
{

protected array $defaultConfiguration = [
'table_storage' => [
'table_name' => 'tx_migrations',
Expand Down Expand Up @@ -87,7 +86,7 @@ protected function runCli(): void
$configuration = array_merge(
$this->defaultConfiguration,
[
'migrations_paths' => $extConf['migrationsPaths']
'migrations_paths' => $extConf['migrationsPaths'],
],
);

Expand Down
6 changes: 3 additions & 3 deletions Classes/Command/DoctrineDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

class DoctrineDumpCommand extends AbstractDoctrineCommand
{

protected function configure(): void
{
parent::configure();

$this
->setAliases(['dump-schema'])
->setDescription('Dump the schema for your database to a migration.')
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command dumps the schema for your database to a migration:

<info>%command.full_name%</info>
Expand Down Expand Up @@ -56,7 +56,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ protected function configure(): void
InputOption::VALUE_NONE,
'Time all the queries individually.'
)
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command executes migration versions up or down manually:

<info>%command.full_name% FQCN</info>
Expand Down Expand Up @@ -88,7 +89,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ protected function configure(): void
InputOption::VALUE_REQUIRED,
'The namespace to use for the migration (must be in the list of configured namespaces)'
)
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command generates a blank migration class:

<info>%command.full_name%</info>
Expand All @@ -37,7 +38,7 @@ protected function configure(): void
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
* @throws \Doctrine\DBAL\Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/DoctrineLatestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function configure(): void
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
* @throws \Doctrine\DBAL\Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ protected function configure(): void
$this
->setAliases(['list-migrations'])
->setDescription('Display a list of all available migrations and their status.')
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command outputs a list of all available migrations and their status:

<info>%command.full_name%</info>
Expand All @@ -29,7 +30,7 @@ protected function configure(): void
* @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException
* @throws \Doctrine\DBAL\Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Command/DoctrineMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class DoctrineMigrateCommand extends AbstractDoctrineCommand
{

protected function configure(): void
{
$this
Expand Down Expand Up @@ -55,7 +54,8 @@ protected function configure(): void
InputOption::VALUE_NONE,
'Time all the queries individually.'
)
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command executes migration versions up or down manually:

<info>%command.full_name% FQCN</info>
Expand Down Expand Up @@ -89,7 +89,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineRollupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ protected function configure(): void
$this
->setAliases(['rollup'])
->setDescription('Rollup migrations by deleting all tracked versions and insert the one version that exists.')
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command rolls up migrations by deleting all tracked versions and
inserts the one version that exists that was created with the <info>migrations:dump-schema</info> command.

Expand All @@ -30,7 +31,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineStatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ protected function configure(): void
$this
->setAliases(['status'])
->setDescription('View the status of a set of migrations.')
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command outputs the status of a set of migrations:

<info>%command.full_name%</info>
Expand All @@ -25,7 +26,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/DoctrineVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ protected function configure(): void
InputOption::VALUE_OPTIONAL,
'Apply to specified version.'
)
->setHelp(<<<EOT
->setHelp(
<<<EOT
The <info>%command.name%</info> command allows you to manually add, delete or synchronize migration versions from the version table:

<info>%command.full_name% MIGRATION-FQCN --add</info>
Expand Down Expand Up @@ -82,7 +83,7 @@ protected function configure(): void
/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->runCli();
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"Migration"
],
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"doctrine/migrations": "^3.0",
"typo3/cms-core": "^10.4 || ^11"
"typo3/cms-core": "^11.5 || ^12.4"
},
"autoload": {
"psr-4": {
Expand Down
Loading