Skip to content

Commit

Permalink
Reorganize project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
erickskrauch committed Jan 23, 2024
1 parent 55364f4 commit e098773
Show file tree
Hide file tree
Showing 24 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('tests/ClassNotation/_data')
->exclude('tests/Fixer/ClassNotation/_data')
;

return Ely\CS\Config::create([
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractFixer.php → src/Fixer/AbstractFixer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer;
namespace ErickSkrauch\PhpCsFixer\Fixer;

abstract class AbstractFixer extends \PhpCsFixer\AbstractFixer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\ClassNotation;
namespace ErickSkrauch\PhpCsFixer\Fixer\ClassNotation;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Analyzer\ClassElementsAnalyzer;
use ErickSkrauch\PhpCsFixer\Analyzer\ClassNameAnalyzer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\FunctionNotation;
namespace ErickSkrauch\PhpCsFixer\Fixer\FunctionNotation;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\LanguageConstruct;
namespace ErickSkrauch\PhpCsFixer\Fixer\LanguageConstruct;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Whitespace;
namespace ErickSkrauch\PhpCsFixer\Fixer\Whitespace;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Whitespace;
namespace ErickSkrauch\PhpCsFixer\Fixer\Whitespace;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Whitespace;
namespace ErickSkrauch\PhpCsFixer\Fixer\Whitespace;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Whitespace;
namespace ErickSkrauch\PhpCsFixer\Fixer\Whitespace;

use ErickSkrauch\PhpCsFixer\AbstractFixer;
use ErickSkrauch\PhpCsFixer\Fixer\AbstractFixer;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
Expand Down
2 changes: 1 addition & 1 deletion src/Fixers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class Fixers implements IteratorAggregate {
*/
public function getIterator(): Traversable {
$finder = new Finder();
$finder->in(__DIR__)->name('*.php');
$finder->in(__DIR__ . '/Fixer')->name('*.php');
$classes = [];
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ($finder as $file) {
Expand Down
8 changes: 0 additions & 8 deletions tests/ClassNotation/_data/EmptyInterface.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation;

use ErickSkrauch\PhpCsFixer\ClassNotation\OrderedOverridesFixer;
use ErickSkrauch\PhpCsFixer\Fixer\ClassNotation\OrderedOverridesFixer;
use PhpCsFixer\AbstractFixer;
use PhpCsFixer\Tests\Test\AbstractFixerTestCase;

/**
* @covers \ErickSkrauch\PhpCsFixer\ClassNotation\OrderedOverridesFixer
* @covers \ErickSkrauch\PhpCsFixer\Fixer\ClassNotation\OrderedOverridesFixer
*/
final class OrderedOverridesFixerTest extends AbstractFixerTestCase {

Expand All @@ -34,21 +34,21 @@ public function bar(): void {}

yield 'implements empty interface' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\EmptyInterface {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\EmptyInterface {
public function foo(): void {}
}
',
];

yield 'single interface implementation' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function foo(): void {}
public function bar(): void {}
}
',
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function bar(): void {}
public function foo(): void {}
}
Expand All @@ -57,7 +57,7 @@ public function foo(): void {}

yield 'multiple interfaces implementation' => [
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
class A implements _data\InterfaceA, _data\InterfaceB {
public function foo(): void {}
Expand All @@ -67,7 +67,7 @@ public function qux(): void {}
}
',
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
class A implements _data\InterfaceA, _data\InterfaceB {
public function baz(): void {}
Expand All @@ -80,7 +80,7 @@ public function foo(): void {}

yield 'abstract class' => [
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
abstract class A implements _data\InterfaceA, _data\InterfaceB {
public function bar(): void {}
Expand All @@ -89,7 +89,7 @@ public function baz(): void {}
}
',
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
abstract class A implements _data\InterfaceA, _data\InterfaceB {
public function baz(): void {}
Expand All @@ -101,22 +101,22 @@ public function bar(): void {}

yield 'interface extension' => [
'<?php
interface ExtendedA extends \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
interface ExtendedA extends \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function baz(): void;
}
',
];

yield 'non-interface methods' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function foo(): void {}
public function nonInterface(): void {}
public function bar(): void {}
}
',
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function bar(): void {}
public function nonInterface(): void {}
public function foo(): void {}
Expand All @@ -126,14 +126,14 @@ public function foo(): void {}

yield 'extend abstract class' => [
'<?php
class A extends \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\AbstractA {
class A extends \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\AbstractA {
public function foo(): void {}
public function nonInterface(): void {}
public function bar(): void {}
}
',
'<?php
class A extends \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\AbstractA {
class A extends \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\AbstractA {
public function bar(): void {}
public function nonInterface(): void {}
public function foo(): void {}
Expand All @@ -143,7 +143,7 @@ public function foo(): void {}

yield 'interface with multiple extends' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceAandB {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceAandB {
public function foo(): void {}
public function nonInterface(): void {}
public function bar(): void {}
Expand All @@ -153,7 +153,7 @@ public function quux(): void{}
}
',
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceAandB {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceAandB {
public function bar(): void {}
public function nonInterface(): void {}
public function qux() : void{}
Expand All @@ -166,7 +166,7 @@ public function baz() : void{}

yield 'mix of extends and interface' => [
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
class A extends _data\AbstractA implements _data\InterfaceB {
public function foo(): void {}
Expand All @@ -176,7 +176,7 @@ public function qux() : void{}
}
',
'<?php
use ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
use ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;
class A extends _data\AbstractA implements _data\InterfaceB {
public function qux() : void{}
Expand All @@ -189,7 +189,7 @@ public function baz() : void{}

yield 'function in implementation' => [
'<?php
class A extends \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\AbstractA {
class A extends \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\AbstractA {
public function bar(): void {
$a = function() {
// body
Expand All @@ -201,13 +201,13 @@ public function bar(): void {

yield 'anonymous class' => [
'<?php
$a = new class implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
$a = new class implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function foo(): void {}
public function bar(): void {}
};
',
'<?php
$a = new class implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
$a = new class implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function bar(): void {}
public function foo(): void {}
};
Expand All @@ -225,7 +225,7 @@ public function foo(): void {}

yield 'mix of other class elements' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function foo(): void {}
private string $a;
public function nonInterface(): void {}
Expand All @@ -236,7 +236,7 @@ public function qux(): void {}
}
',
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceA {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceA {
public function bar(): void {}
private string $a;
public function nonInterface(): void {}
Expand All @@ -250,13 +250,13 @@ public function qux(): void {}

yield 'use the order of the deepest parent ' => [
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceAReverseOrder {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceAReverseOrder {
public function foo(): void {}
public function bar(): void {}
}
',
'<?php
class A implements \ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data\InterfaceAReverseOrder {
class A implements \ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data\InterfaceAReverseOrder {
public function bar(): void {}
public function foo(): void {}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

abstract class AbstractA implements InterfaceA {

Expand Down
8 changes: 8 additions & 0 deletions tests/Fixer/ClassNotation/_data/EmptyInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

interface EmptyInterface {

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

interface InterfaceA {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

interface InterfaceAReverseOrder extends InterfaceA {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

interface InterfaceAandB extends InterfaceA, InterfaceB {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace ErickSkrauch\PhpCsFixer\Tests\ClassNotation\_data;
namespace ErickSkrauch\PhpCsFixer\Tests\Fixer\ClassNotation\_data;

interface InterfaceB {

Expand Down
Loading

0 comments on commit e098773

Please sign in to comment.