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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
"psr/container": "^1.1 || ^2.0.0"
},
"require-dev": {
"phpunit/phpunit": "^10.2",
"boundwize/structarmed": "^0.18.11",
"laminas/laminas-coding-standard": "^2.5",
"phpstan/phpstan": "^2.1.33",
"phpstan/phpstan-phpunit": "^2.0.10",
"laminas/laminas-coding-standard": "^2.5"
"phpunit/phpunit": "^10.2"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function generateRecoveryCodes(int $count = 8, int $length = 10, string $

public function hashRecoveryCodes(array $codes): array
{
return array_map(fn($code) => password_hash($code, PASSWORD_DEFAULT), $codes);
return array_map(static fn($code) => password_hash($code, PASSWORD_DEFAULT), $codes);
}

public function validateRecoveryCode(string $inputCode, array &$hashedCodes): bool
Expand Down
25 changes: 25 additions & 0 deletions structarmed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

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

return Architecture::define()
->withPresets(Preset::PSR4(), Preset::CODEQUALITY())

->layer('Totp', 'src/Totp.php')
->layer('TotpFactory', 'src/TotpFactory.php')
->layer('ConfigProvider', 'src/ConfigProvider.php')
->ruleset([
'Totp' => [],
'TotpFactory' => ['Totp'],
'ConfigProvider' => ['+TotpFactory'],
])

->layer('tests', 'test')
->rule(
'tests_must_be_final',
new MustBeFinalRule(layer: 'tests')
);
2 changes: 1 addition & 1 deletion test/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Dot\Totp\TotpFactory;
use PHPUnit\Framework\TestCase;

class ConfigProviderTest extends TestCase
final class ConfigProviderTest extends TestCase
{
private ConfigProvider $provider;

Expand Down
2 changes: 1 addition & 1 deletion test/TotpFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

class TotpFactoryTest extends TestCase
final class TotpFactoryTest extends TestCase
{
/**
* @throws ContainerExceptionInterface
Expand Down
2 changes: 1 addition & 1 deletion test/TotpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use function password_verify;
use function strlen;

class TotpTest extends TestCase
final class TotpTest extends TestCase
{
public function testConstructorDefaults(): void
{
Expand Down
Loading