Skip to content

Commit

Permalink
Refactored package file structure
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <[email protected]>
  • Loading branch information
betterthanclay committed Oct 18, 2023
1 parent ba390c5 commit a6f6e5d
Show file tree
Hide file tree
Showing 53 changed files with 22 additions and 38 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Refactored package file structure

## v0.3.9 (2023-09-26)
* Converted phpstan doc comments to generic

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $myDate = Lucid::make('tomorrow', 'date', [
If you need more fine grained control of the responses to constraints, use <code>validate()</code>:

```php
$result = Lucid::validate('int', 'potato', [
$result = Lucid::validate('potato', 'int', [
'min' => 4
]);

Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "decodelabs/lucid",
"description": "Flexible and expansive sanitisation and validation framework",
"type": "library",
"keywords": ["validation", "sanitisation", "input"],
"keywords": [ "validation", "sanitisation", "input" ],
"license": "MIT",
"authors": [{
"name": "Tom Wright",
"email": "[email protected]"
}],
"authors": [ {
"name": "Tom Wright",
"email": "[email protected]"
} ],
"require": {
"php": "^8.0",

Expand All @@ -31,11 +31,10 @@
},
"autoload": {
"psr-4": {
"DecodeLabs\\Archetype\\": "src/Archetype/",
"DecodeLabs\\Lucid\\": "src/Lucid/"
"DecodeLabs\\Lucid\\": "src/"
},
"files": [
"src/global.php"
"src/Context.php"
]
},
"extra": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@

declare(strict_types=1);

namespace DecodeLabs\Archetype\Resolver;
namespace DecodeLabs\Lucid;

use DecodeLabs\Archetype\Resolver;
use DecodeLabs\Lucid\Constraint;

class LucidConstraint implements Resolver
class ConstraintResolver implements Resolver
{
/**
* Get mapped interface
Expand Down
10 changes: 10 additions & 0 deletions src/Lucid/Context.php → src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

namespace DecodeLabs\Lucid;

use DecodeLabs\Archetype;
use DecodeLabs\Lucid;
use DecodeLabs\Lucid\Provider\DirectContext;
use DecodeLabs\Lucid\Provider\DirectContextTrait;
use DecodeLabs\Lucid\Sanitizer\ValueContainer;
use DecodeLabs\Veneer;

/**
* @template TValue
Expand All @@ -25,3 +28,10 @@ public function newSanitizer(mixed $value): Sanitizer
return new ValueContainer($value);
}
}


// Veneer
Veneer::register(Context::class, Lucid::class);

// Load Archetype Constraint Resolver
Archetype::register(new ConstraintResolver());
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 0 additions & 26 deletions src/global.php

This file was deleted.

0 comments on commit a6f6e5d

Please sign in to comment.