chore: nice-to-have improvements for v1.0
Sync GitHub / sync (push) Successful in 8s

Code quality:
- Create AppConstants class with shared constants:
  - FAR_FUTURE_DATE (replaces duplicated '2999-12-31' strings)
  - MAX_INPUT_LENGTH (replaces duplicated 128 in Payload and StringTrait)
- Extract duplicated 'hi $id' response body into StringTrait::authSuccessResponse()
  method, used by AcceptListener, AllowListener, and LoginManager
- Add missing @throws InvalidArgumentException annotations to
  MonitorCacheKeys (getItem, hasItem, deleteItem, deleteItems, commit)

Configuration:
- Add proper env var type casting in services.yaml:
  - COOKIE_TTL → env(int:)
  - SUBDOMAIN_REDIRECT → env(bool:)
  - IP_TTL → env(int:)
  - TEAPOT → env(bool:)

Documentation:
- Create CONTRIBUTING.md with development setup, code style,
  testing guidelines, and PR process
This commit is contained in:
2026-08-11 16:37:23 -04:00
parent b89070e985
commit 408d75dda1
11 changed files with 135 additions and 25 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Service;
use App\AppConstants;
use App\MonitorCacheKeys;
use App\Trait\HasLoggerTrait;
use App\Trait\StringTrait;
@@ -84,7 +85,7 @@ final readonly class BackupCodeManager implements BackupCodeInterface
* we want this to keep forever, so a few hundred years should do it */
$backupItem->expiresAt(DateTimeImmutable::createFromFormat(
'Y-m-d',
'2999-12-31'
AppConstants::FAR_FUTURE_DATE
));
$this->sessionCache->save($backupItem);
@@ -104,7 +105,7 @@ final readonly class BackupCodeManager implements BackupCodeInterface
* we want this to keep forever, so a few hundred years should do it */
$backupItem->expiresAt(DateTimeImmutable::createFromFormat(
'Y-m-d',
'2999-12-31'
AppConstants::FAR_FUTURE_DATE
));
$this->sessionCache->saveDeferred($backupItem);
}