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/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
composer-options: "--prefer-dist --no-audit"

- name: Install StructArmed
run: composer require --dev boundwize/structarmed:^0.16.0 --no-interaction --prefer-dist --no-audit
run: composer require --dev boundwize/structarmed:^0.17.0 --no-interaction --prefer-dist --no-audit

# Execution
- name: Run StructArmed
Expand Down
4 changes: 2 additions & 2 deletions src/Files/src/FilesInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ interface FilesInterface
*/
public const KB = 1024;

public const MB = 1048576;
public const GB = 1073741824;
public const MB = 1_048_576;
public const GB = 1_073_741_824;

/**
* Default location (directory) separator.
Expand Down
2 changes: 1 addition & 1 deletion src/Prototype/tests/Commands/DumpCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testDump(): void
$files
->expects(self::once())
->method('write')
->with(static::callback(fn (): bool => true), static::callback($this->validateTrait(...)));
->with(static::callback(static fn (): bool => true), static::callback($this->validateTrait(...)));

$this->app->getContainer()->bindSingleton(FilesInterface::class, $files, true);

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function testLastModified(): void
self::assertGreaterThanOrEqual($now, $before);

// Wait 1.1 seconds and then again modify file
\usleep(1100000);
\usleep(1_100_000);

$file->write('content');
$after = $file->getLastModified();
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/tests/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function testLastModified(): void
self::assertGreaterThanOrEqual($now, $before);

// Wait 1.1 seconds and then again modify file
\usleep(1100000);
\usleep(1_100_000);

$this->manager->write('file.txt', 'content');
$after = $this->manager->getLastModified('file.txt');
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/tests/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testLastModified(): void
self::assertGreaterThanOrEqual($now, $before);

// Wait 1.1 seconds and then again modify file
\usleep(1100000);
\usleep(1_100_000);

$this->local->write('file.txt', 'content');
$after = $this->local->getLastModified('file.txt');
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizer/tests/Listener/ClassLocatorByTargetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testGetClasses(
array $expected,
): void {
$classes = \array_map(
fn (string $class): \ReflectionClass => new \ReflectionClass($class),
static fn (string $class): \ReflectionClass => new \ReflectionClass($class),
[
Targets\ConsoleCommand::class,
Targets\Filter::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizer/tests/Listener/EnumLocatorByTargetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testGetEnums(
array $expected,
): void {
$enums = \array_map(
fn (string $class): \ReflectionEnum => new \ReflectionEnum($class),
static fn (string $class): \ReflectionEnum => new \ReflectionEnum($class),
[
Targets\EnumWithAttributeOnClass::class,
Targets\EnumWithAllTargets::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testGetEnums(
array $expected,
): void {
$interfaces = \array_map(
fn (string $class): \ReflectionClass => new \ReflectionClass($class),
static fn (string $class): \ReflectionClass => new \ReflectionClass($class),
[
Targets\InterfaceWithAllTargets::class,
Targets\InterfaceWithAttributeOnClass::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizer/tests/Listener/ListenerInvokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testInvoke(): void
$invoker = new ListenerInvoker();

$classes = \array_map(
fn(string $class): \ReflectionClass => new \ReflectionClass($class),
static fn(string $class): \ReflectionClass => new \ReflectionClass($class),
[
Targets\ConsoleCommand::class,
Targets\Filter::class,
Expand Down
6 changes: 5 additions & 1 deletion structarmed.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Boundwize\StructArmed\Architecture;
use Boundwize\StructArmed\Preset\Preset;
use Boundwize\StructArmed\Preset\Presets\CodeQualityPreset;
use Boundwize\StructArmed\Rule\Rules\Class_\MustBeFinalRule;

$layerPatterns = [
Expand Down Expand Up @@ -149,6 +150,9 @@
'tests/app/src/Command/DeadCommand.php',
'tests/app/src/Controller/TestController.php',
],
CodeQualityPreset::ANONYMOUS_FUNCTIONS_MUST_BE_STATIC => [
__DIR__ . '/src/Core/tests/Exception/ClosureRendererTraitTest.php',
],
])
->skipPaths([
// fixtures
Expand All @@ -172,4 +176,4 @@
$architecture->layerPattern($name, $pattern);
}

return $architecture->withPreset(Preset::PSR4());
return $architecture->withPresets(Preset::PSR4(), Preset::CODEQUALITY());
Loading