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
4 changes: 4 additions & 0 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
composer require php-parallel-lint/php-parallel-lint --ansi
vendor/bin/parallel-lint src bin/rector config tests rules --colors
-
name: 'Run StructArmed'
run: vendor/bin/structarmed analyze

name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"webmozart/assert": "^2.3"
},
"require-dev": {
"boundwize/structarmed": "^0.5.4",
"nette/robot-loader": "^4.1",
"php-parallel-lint/php-parallel-lint": "^1.4",
"symplify/easy-coding-standard": "^13.1",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
Expand All @@ -55,6 +55,7 @@
"rector/swiss-knife": "^2.3",
"rector/type-perfect": "^2.1.2",
"shipmonk/composer-dependency-analyser": "^1.8",
"symplify/easy-coding-standard": "^13.1",
"symplify/phpstan-extensions": "^12.0.2",
"symplify/phpstan-rules": "^14.9.11",
"symplify/vendor-patches": "^11.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Assert\Rector\ClassMethod\AddAssertArrayFromClassMethodDocblockRector;
namespace Rector\Tests\Assert\Rector\ClassMethod\AddAssertArrayFromClassMethodDocblockRector;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector\Source;
declare(strict_types=1);

namespace Rector\Tests\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector\Source;

class Notification
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DeadCode\Rector\Cast\RecastingRemovalRector;
namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector\Source;

interface interfaceWithMethod
interface InterfaceWithMethod
{
public function run($a, $b);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Fixture;

use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeInterface;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Sourcet\SomeAbstractClass;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeAbstractClass;

final class FinalInheritance extends SomeAbstractClass
{
Expand Down Expand Up @@ -34,7 +34,7 @@ final class FinalInterfaceImplementation implements SomeInterface
namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Fixture;

use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeInterface;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Sourcet\SomeAbstractClass;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeAbstractClass;

final class FinalInheritance extends SomeAbstractClass
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Fixture;

use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeInterface;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Sourcet\SomeAbstractClass;
use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source\SomeAbstractClass;

class SkipInheritance extends SomeAbstractClass
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Sourcet;
namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\Source;

abstract class SomeAbstractClass
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Naming\Rector\ClassMethod\RenameParamToMatchTypeRector\Source\ValueObject;
namespace Rector\Tests\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector\Source\ValueObject;

final class Repository
{
Expand Down
2 changes: 1 addition & 1 deletion rules/DeadCode/NodeAnalyzer/PropertyWriteonlyAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(

public function hasClassDynamicPropertyNames(Class_ $class): bool
{
return (bool) $this->betterNodeFinder->findFirst($class, function (Node $node) : bool {
return (bool) $this->betterNodeFinder->findFirst($class, function (Node $node): bool {
if ($node instanceof FuncCall && $this->nodeNameResolver->isName(
$node,
'get_object_vars'
Expand Down
3 changes: 2 additions & 1 deletion src/Configuration/ConfigInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public function createConfig(string $projectDirectory): void
return;
}

$mainConfigFile = $this->rectorConfigsResolver->provide()->getMainConfigFile();
$mainConfigFile = $this->rectorConfigsResolver->provide()
->getMainConfigFile();
if ($mainConfigFile !== null && file_exists($mainConfigFile)) {
$this->symfonyStyle->warning(
'Register rules or sets in your "' . basename($mainConfigFile) . '" config'
Expand Down
26 changes: 26 additions & 0 deletions structarmed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use Boundwize\StructArmed\Architecture;
use Boundwize\StructArmed\Preset\Preset;
use Boundwize\StructArmed\Preset\Presets\Psr4Preset;

return Architecture::define()
->skip([
Psr4Preset::CLASSES_MUST_MATCH_COMPOSER => [
// the namespace different is on purpose
__DIR__ . '/rules-tests/Renaming/Rector/Name/RenameClassRector',
__DIR__ . '/rules-tests/CodingStyle/Rector/Namespace_',

// no namespace on purpose
__DIR__ . '/rules-tests/Php70/Rector/ClassMethod/Php4ConstructorRector/Source/ParentClass.php',

// multi classes in one file on purpose
__DIR__ . '/rules-tests/Php70/Rector/StaticCall/StaticCallOnNonStaticToInstanceCallRector/Source/Service.php',

// simulate under phpstan.phar
__DIR__ . '/rules-tests/Php71/Rector/FuncCall/RemoveExtraParametersRector/Source/phpstan.phar',
],
])
->withPreset(Preset::PSR4());
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Rector\Tests\FileSystem\FilesFinder\SourceWithSuffix;

final class OtherUnrelatedFile
{
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FileSystem\FilesFinder\SourceWithSuffix;
namespace Rector\Tests\FileSystem\FilesFinder\SourceWithSuffix;

final class SomeController
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FileSystem\FilesFinder\SourceWithSuffix;
namespace Rector\Tests\FileSystem\FilesFinder\SourceWithSuffix;

final class SomeRepository
{
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Issues/InlineTags/InlineTagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Tests\Issues\InlineTagsTest;
namespace Rector\Tests\Issues\InlineTags;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down
Loading