Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace PHPCS with PHP-CS-Fixer #195

Merged
merged 6 commits into from
Dec 15, 2023
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
60 changes: 48 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,60 @@
root = true
charset = utf-8
# EditorConfig is awesome: http://EditorConfig.org

trim_trailing_whitespace = true
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[composer.json]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.less]
indent_style = space
# TS/JS-Files
[*.{ts,js}]
indent_size = 2

[*.php]
indent_style = space
# JSON-Files
[*.json]
indent_style = tab

# ReST-Files
[*.{rst,rst.txt}]
indent_size = 4
max_line_length = 80

[*.ts]
indent_style = space
# Markdown-Files
[*.md]
max_line_length = 80

# YAML-Files
[*.{yaml,yml}]
indent_size = 2

# NEON-Files
[*.neon]
indent_size = 2
indent_style = tab

# package.json
[package.json]
indent_size = 2

# TypoScript
[*.{typoscript,tsconfig}]
indent_size = 2

# XLF-Files
[*.xlf]
indent_style = tab

# SQL-Files
[*.sql]
indent_style = tab
indent_size = 2

# .htaccess
[{_.htaccess,.htaccess}]
indent_style = tab
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
.github export-ignore
.gitignore export-ignore
.phpunit.result.cache export-ignore
.php-cs-fixer.* export-ignore
bower.json export-ignore
composer.lock export-ignore
docker-compose.yml export-ignore
Gruntfile.js export-ignore
package.json export-ignore
package-lock.json export-ignore
phpcs.xml export-ignore
phpstan*.neon export-ignore
phpunit-functional.xml export-ignore
phpunit.xml export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.php-cs-fixer.cache
/.phpunit.result.cache
/bower_components
/composer.lock
Expand Down
11 changes: 11 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$config = \TYPO3\CodingStandards\CsFixerConfig::create();
$config->getFinder()
->in(__DIR__)
->exclude([
'var',
'web',
]);

return $config;
9 changes: 2 additions & 7 deletions Classes/Controller/Backend/FormLogController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Controller\Backend;

Expand Down Expand Up @@ -28,17 +28,14 @@
*/
class FormLogController extends ActionController
{

protected array $viewFormatToExportMap = [
'csv' => CsvExport::class,
'xlsx' => XlsxExport::class,
];

protected FormLogEntryRepository $formLogEntryRepository;

public function __construct(protected ModuleTemplateFactory $moduleTemplateFactory)
{
}
public function __construct(protected ModuleTemplateFactory $moduleTemplateFactory) {}

public function injectFormLogEntryRepository(FormLogEntryRepository $formLogEntryRepository)
{
Expand All @@ -47,8 +44,6 @@ public function injectFormLogEntryRepository(FormLogEntryRepository $formLogEntr

/**
* Initialize all actions
*
* @return void
*/
public function initializeAction()
{
Expand Down
6 changes: 2 additions & 4 deletions Classes/Controller/Backend/FormLogSuggestController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Controller\Backend;

Expand All @@ -18,9 +18,7 @@
*/
final class FormLogSuggestController
{
public function __construct(private Suggestions $suggestions, private ResponseFactoryInterface $responseFactory)
{
}
public function __construct(private Suggestions $suggestions, private ResponseFactoryInterface $responseFactory) {}

public function searchAction(ServerRequestInterface $request): ResponseInterface
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Data/JsonData.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\Data;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Form/Finishers/LoggerFinisher.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\Form\Finishers;

Expand Down
6 changes: 2 additions & 4 deletions Classes/Domain/FormLog/DateRangeFilter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\FormLog;

Expand All @@ -13,9 +13,7 @@
*/
class DateRangeFilter implements FilterInterface
{
public function __construct(protected ?\DateTime $startDate = null, protected ?\DateTime $endDate = null)
{
}
public function __construct(protected ?\DateTime $startDate = null, protected ?\DateTime $endDate = null) {}

public function getStartDate(): ?\DateTime
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/FormLog/FilterInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\FormLog;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/FormLog/Filters.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\FormLog;

Expand Down
6 changes: 2 additions & 4 deletions Classes/Domain/FormLog/Suggestions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\FormLog;

Expand All @@ -15,9 +15,7 @@
*/
final class Suggestions
{
public function __construct(private ConnectionPool $connectionPool)
{
}
public function __construct(private ConnectionPool $connectionPool) {}

/**
* Get suggestions for a form log property
Expand Down
6 changes: 2 additions & 4 deletions Classes/Domain/FormLog/ValueFilter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\FormLog;

Expand All @@ -13,9 +13,7 @@
*/
class ValueFilter implements FilterInterface
{
public function __construct(protected string $value = '')
{
}
public function __construct(protected string $value = '') {}

public function getValue(): string
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/FormLogEntry.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\Model;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/FormLogEntry/Page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\Model\FormLogEntry;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/FormLogEntryRepository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Domain\Repository;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Export/AbstractExport.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Export;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Export/CsvExport.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Export;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Export/XlsxExport.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Export;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Form/Element/JSONDataElement.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Form\Element;

Expand Down
6 changes: 2 additions & 4 deletions Classes/Json.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog;

Expand Down Expand Up @@ -35,7 +35,5 @@ public static function encode(mixed $value): string
return $encoded;
}

private function __construct()
{
}
private function __construct() {}
}
2 changes: 1 addition & 1 deletion Classes/Rendering/ValueFormatter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\Rendering;

Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Format/FormValueViewHelper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Pagemachine\Formlog\ViewHelpers\Format;

Expand Down
3 changes: 1 addition & 2 deletions Configuration/ContentSecurityPolicies.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\MutationCollection;
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\MutationMode;
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\Scope;
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\SourceKeyword;
use TYPO3\CMS\Core\Type\Map;
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue;
use TYPO3\CMS\Core\Type\Map;

return Map::fromEntries([
Scope::backend(),
Expand Down
1 change: 1 addition & 0 deletions Configuration/TCA/tx_formlog_entries.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

defined('TYPO3') or die();

return [
Expand Down
Loading