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
10 changes: 10 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Upgrade Guide

## Version 1.4 to 1.5

### Base Classes Are Now Abstract

- `CodeIgniter\Shield\Authentication\Passwords\BaseValidator` is now `abstract`.
Code that instantiated it directly with `new BaseValidator()` will now throw
an `Error`.
- `CodeIgniter\Shield\Config\BaseAuthToken` is now `abstract`. Code that
instantiated it directly with `new BaseAuthToken()` will now throw an `Error`.

## Version 1.2 to 1.3

### JWT: Minimum Key Length Now Enforced
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/Passwords/BaseValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use CodeIgniter\Shield\Config\Auth as AuthConfig;

class BaseValidator
abstract class BaseValidator
{
protected ?string $error = null;
protected ?string $suggestion = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/BaseAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use CodeIgniter\Config\BaseConfig;

class BaseAuthToken extends BaseConfig
abstract class BaseAuthToken extends BaseConfig
{
/**
* List of HMAC Encryption Keys
Expand Down
4 changes: 4 additions & 0 deletions structarmed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Boundwize\StructArmed\Architecture;
use Boundwize\StructArmed\Preset\Preset;
use Boundwize\StructArmed\Preset\Presets\Psr4Preset;
use Boundwize\StructArmed\Rule\Rules\Class_\ExtendedClassMustBeAbstractOrInstantiatedRule;
use Boundwize\StructArmed\Rule\Rules\Class_\MustBeFinalRule;

return Architecture::define()
Expand All @@ -19,6 +20,9 @@
])
->cacheDirectory(is_dir('/tmp') ? '/tmp/structarmed' : null)
->withPresets(Preset::PSR4(), Preset::CODEQUALITY())

->rule('base_classes.must_be_abstract', new ExtendedClassMustBeAbstractOrInstantiatedRule('Source', '/^CodeIgniter\\\\Shield\\\\.*Base.*$/'))

->layer('tests', __DIR__ . '/tests')
->layerPattern('Model', '/^CodeIgniter\\\\Shield\\\\.*Model$/')
->layerPattern('Controller', '/^CodeIgniter\\\\Shield\\\\Controllers\\\\.*$/')
Expand Down
Loading