Skip to content

Commit

Permalink
Formatted method argument spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <[email protected]>
  • Loading branch information
betterthanclay committed Nov 3, 2023
1 parent 1c86bf7 commit 0cb6dfa
Show file tree
Hide file tree
Showing 49 changed files with 249 additions and 166 deletions.
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
5 changes: 3 additions & 2 deletions src/Constraint/Interval/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] ?? 0);
$this->processor->test('max', $param[1] ?? 0);
return $this;
Expand Down
10 changes: 6 additions & 4 deletions src/Constraint/Number/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,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 @@ -46,8 +47,9 @@ public function getParameter(): mixed
return $this->max;
}

public function validate(mixed $value): Generator
{
public function validate(
mixed $value
): Generator {
if ($value > $this->max) {
yield new Error(
$this,
Expand Down
Loading

0 comments on commit 0cb6dfa

Please sign in to comment.