Skip to content

Commit

Permalink
Merge branch 'release/v0.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Nov 14, 2023
2 parents ca5defe + 6023ad4 commit 39370cc
Show file tree
Hide file tree
Showing 52 changed files with 269 additions and 182 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
php-version: "8.1"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "post_max_size=256M"

Expand Down Expand Up @@ -60,9 +60,9 @@ jobs:
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
php-version: "8.1"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "post_max_size=256M"

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.4.2 (2023-11-14)
* Updated Dictum dependency
* Made PHP8.1 minimum version

## v0.4.1 (2023-10-25)
* Coerce null scalar values if type required

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"email": "[email protected]"
} ],
"require": {
"php": "^8.0",
"php": "^8.1",

"decodelabs/archetype": "^0.2",
"decodelabs/coercion": "^0.2.2",
"decodelabs/dictum": "^0.5",
"decodelabs/dictum": "^0.5|^0.6",
"decodelabs/exceptional": "^0.4",
"decodelabs/lucid-support": "^0.3",
"decodelabs/veneer": "^0.10.10",
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Color/MaxLightness.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->max = (float)$param;
return $this;
}
Expand All @@ -47,8 +48,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Color/MaxSaturation.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->max = (float)$param;
return $this;
}
Expand All @@ -47,8 +48,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Color/MinLightness.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->min = (float)$param;
return $this;
}
Expand All @@ -47,8 +48,9 @@ public function getParameter(): mixed
return $this->min;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Color/MinSaturation.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->min = (float)$param;
return $this;
}
Expand All @@ -47,8 +48,9 @@ public function getParameter(): mixed
return $this->min;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Compass/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->max = Ip::parse($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if (
$value === null ||
$this->max === null
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Compass/Min.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->min = Ip::parse($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->min;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if (
$value === null ||
$this->min === null
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Compass/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->range = IpRange::parse($param);
return $this;
}
Expand All @@ -50,8 +51,9 @@ public function getParameter(): mixed
return $this->range;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if (
$value === null ||
$this->range === null
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Compass/V4.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public function getWeight(): int
return 1;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->v4 = $param;
return $this;
}
Expand All @@ -48,8 +49,9 @@ public function getParameter(): mixed
return $this->v4;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Compass/V6.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public function getWeight(): int
return 1;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->v6 = $param;
return $this;
}
Expand All @@ -48,8 +49,9 @@ public function getParameter(): mixed
return $this->v6;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/DateTime/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->max = $this->processor->coerce($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return true;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/DateTime/Min.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->min = $this->processor->coerce($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->min;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return true;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Constraint/DateTime/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->processor->test('min', $param[0] ?? 'now');
$this->processor->test('max', $param[1] ?? 'now');
return $this;
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/DefaultValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public function getWeight(): int
return 0;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->default = $param;
return $this;
}
Expand All @@ -41,8 +42,9 @@ public function getParameter(): mixed
return $this->default;
}

public function prepareValue(mixed $value): mixed
{
public function prepareValue(
mixed $value
): mixed {
if ($value === '') {
$value = null;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Interval/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->max = $this->processor->coerce($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return true;
}
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Interval/Min.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function getWeight(): int
return 20;
}

public function setParameter(mixed $param): static
{
public function setParameter(
mixed $param
): static {
$this->min = $this->processor->coerce($param);
return $this;
}
Expand All @@ -49,8 +50,9 @@ public function getParameter(): mixed
return $this->min;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value === null) {
return true;
}
Expand Down
Loading

0 comments on commit 39370cc

Please sign in to comment.