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
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
run: composer bin php-cs-fixer update --no-interaction --no-progress

- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
run: vendor/bin/php-cs-fixer fix --diff --dry-run
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/public/bundles/
/var/
/vendor/
/vendor-bin/php-cs-fixer/vendor/
/vendor-bin/phpstan/vendor/
###< symfony/framework-bundle ###


Expand Down
6 changes: 3 additions & 3 deletions .php_cs → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

$finder = PhpCsFixer\Finder::create()
$finder = (new PhpCsFixer\Finder())
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;

return PhpCsFixer\Config::create()
->setCacheFile(__DIR__.'/.github/.cache/php-cs-fixer/.php_cs.cache')
return (new PhpCsFixer\Config())
->setCacheFile(__DIR__.'/.github/.cache/php-cs-fixer/.php-cs-fixer.cache')
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
Expand Down
4 changes: 0 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ parameters:
paths:
- src
tmpDir: .github/.cache/phpstan/

excludes_analyse:
- src/*/tests/*
- src/*/vendor/*
4 changes: 2 additions & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(Kernel $kernel)
*
* @return int 0 if everything went fine, or an error code
*/
public function doRun(InputInterface $input, OutputInterface $output)
public function doRun(InputInterface $input, OutputInterface $output): int
{
$this->registerCommands();

Expand Down Expand Up @@ -66,7 +66,7 @@ protected function registerCommands()
foreach ($container->getParameter('console.command.ids') as $id) {
if (!isset($lazyCommandIds[$id])) {
try {
$this->add($container->get($id));
$this->addCommand($container->get($id));
} catch (\Throwable $e) {
$this->registrationErrors[] = $e;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Command/CacheClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function __construct(string $cacheDir)
$this->cacheDirectory = $cacheDir;
}

protected function configure()
protected function configure(): void
{
$this->setDescription('Clear the cache directory');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
(new Filesystem())->remove($this->cacheDirectory);

Expand Down
4 changes: 2 additions & 2 deletions src/Command/CheckDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(CodeValidator $validator, Baseline $baseline, CodeRu
$this->codeRunner = $codeRunner;
}

protected function configure()
protected function configure(): void
{
$this
->addArgument('source-dir', InputArgument::REQUIRED, 'RST files Source directory')
Expand All @@ -57,7 +57,7 @@ protected function configure()
;
}

protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$this->io = new SymfonyStyle($input, $output);

Expand Down
2 changes: 1 addition & 1 deletion src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function boot()

$container->compile();

//dump the container
// dump the container
file_put_contents(
$containerDumpFile,
(new PhpDumper($container))->dump(['class' => 'CachedContainer'])
Expand Down
6 changes: 3 additions & 3 deletions src/Service/Baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function filter(IssueCollection $issues, array $baseline): IssueCollectio
foreach ($fileIssues as $issue) {
foreach ($fileBaseline as $i => $item) {
if (
$issue->getType() === $item['type'] &&
$issue->getText() === $item['text'] &&
$issue->getErroredLine() === $item['code']
$issue->getType() === $item['type']
&& $issue->getText() === $item['text']
&& $issue->getErroredLine() === $item['code']
) {
unset($fileBaseline[$i]);
continue 2;
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CodeValidator/PhpValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function getContents(CodeNode $node, &$linesPrepended = null): string
$contents = str_replace(['...,', '...)', '...;', '...]', '... }'], ['null,', 'null)', 'null;', 'null]', '$a = null; }'], $contents);

$lines = explode("\n", $contents);
if (!str_contains($lines[0] ?? '', '<?php') && !str_contains($lines[1] ?? '', '<?php') && !str_contains($lines[2] ?? '', '<?php')) {
if (!str_contains($lines[0], '<?php') && !str_contains($lines[1] ?? '', '<?php') && !str_contains($lines[2] ?? '', '<?php')) {
$contents = '<?php'."\n".$contents;
$linesPrepended = 1;
}
Expand Down