This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from mlencki/rector
Rector configs
- Loading branch information
Showing
17 changed files
with
461 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use MLencki\CodeStyle\Rector\Config; | ||
use Rector\Core\Configuration\Option; | ||
|
||
$config = new Config(); | ||
$config->scanPaths(['src', 'tests', 'ecs.php', 'rector.php']); | ||
$config->setOption(Option::AUTOLOAD_PATHS, ['tests']); | ||
$config->checkPhpUnit(); | ||
|
||
return $config->get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MLencki\CodeStyle; | ||
|
||
interface CodeStyleConfig | ||
{ | ||
public function get(): callable; | ||
|
||
public function setOption(string $name, mixed $value): void; | ||
|
||
public function getOptions(): array; | ||
|
||
public function useSets(array $sets): void; | ||
|
||
public function scanPaths(array $paths): void; | ||
|
||
public function skipSniffs(array $sniffs): void; | ||
|
||
public function addSet(string $set): void; | ||
|
||
public function addPath(string $path): void; | ||
|
||
public function addSkip(string $sniff): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MLencki\CodeStyle\EasyCodingStandard; | ||
|
||
use MLencki\CodeStyle\Config as BaseConfig; | ||
use Symplify\EasyCodingStandard\ValueObject\Option; | ||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | ||
|
||
class Config extends BaseConfig | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->useSets([ | ||
SetList::SPACES, | ||
SetList::ARRAY, | ||
SetList::DOCBLOCK, | ||
SetList::NAMESPACES, | ||
SetList::CONTROL_STRUCTURES, | ||
SetList::COMMENTS, | ||
SetList::CLEAN_CODE, | ||
SetList::PSR_12, | ||
SetList::PHP_70, | ||
SetList::PHP_71, | ||
]); | ||
|
||
$this->setOption(Option::LINE_ENDING, "\n"); | ||
} | ||
|
||
public function checkPhpUnit(): void | ||
{ | ||
$this->addSet(SetList::PHPUNIT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MLencki\CodeStyle\EasyCodingStandard; | ||
|
||
final class LaravelConfig extends Config | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->scanPaths(['app', 'bootstrap', 'config', 'database', 'routes']); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.