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
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
### Static analysis

To run static analysis:
- psalm
- phpstan
- [psalm](https://psalm.dev/)
- [phpstan](https://phpstan.org/)

```shell
make check
```

To fix code style:
- [phpcs](https://github.com/squizlabs/PHP_CodeSniffer)
- [rector](https://getrector.com/)

```shell
make fix
```

### Testing

The package is tested with
- [PHPUnit](https://phpunit.de/).
- [Infection](https://github.com/infection/infection).
- [PHPUnit](https://phpunit.de/)
- [Infection](https://github.com/infection/infection)

To run tests:
```shell
Expand Down
17 changes: 13 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector;
use Rector\Set\ValueObject\SetList;

return Rector\Config\RectorConfig::configure()
->withPaths(
Expand All @@ -17,9 +18,17 @@
)
->withParallel()
->withCache('/tmp/var/rector')
->withPhpSets()
->withRules(
->withPhpSets(php83: true)
->withSets(
[
InlineConstructorDefaultToPropertyRector::class,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION_DOCBLOCKS,
]
)
->withSkip(
[
RemoveNonExistingVarAnnotationRector::class,
]
);
4 changes: 0 additions & 4 deletions src/exception/ConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@

final class ConfigurationException extends MigratorException
{
public function __construct(string $message)
{
parent::__construct($message);
}
}
4 changes: 0 additions & 4 deletions src/exception/PrepareException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@

final class PrepareException extends MigratorException
{
public function __construct(string $message)
{
parent::__construct(message: $message);
}
}
2 changes: 1 addition & 1 deletion src/internal/filesystem/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function up(array $listExcluded, Options $options = new Options()): Itera
public function down(array $listApplied, Options $options = new Options()): Iterator
{
$iternum = 0;
foreach ($listApplied as $filename => $_) {
foreach (array_keys($listApplied) as $filename) {
if ($options->limit > 0 && $iternum >= $options->limit) {
return;
}
Expand Down
4 changes: 0 additions & 4 deletions tests/stub/TestDriverError.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

final readonly class TestDriverError implements DriverInterface
{
public function __construct()
{
}

#[Override]
public function getName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion tests/workflow/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace dbschemix\core\tests\workflow;

use dbschemix\core\tests\stub\TestDriverError;
use Override;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use dbschemix\core\exception\ConnectionException;
use dbschemix\core\exception\ConfigurationException;
use dbschemix\core\exception\InitializationException;
use dbschemix\core\tests\stub\TestDriverError;
use dbschemix\core\tests\stub\TestDriver;
use dbschemix\core\tests\stub\TestStorage;
use dbschemix\core\tests\MigratorFactory;
Expand Down
Loading