Skip to content

Commit

Permalink
Fix: Rename parameter and field
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 29, 2021
1 parent 54e8f9f commit c46216e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Format/NewLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@

final class NewLine
{
private string $string;
private string $value;

private function __construct(string $string)
private function __construct(string $value)
{
$this->string = $string;
$this->value = $value;
}

/**
* @throws Exception\InvalidNewLineStringException
*/
public static function fromString(string $string): self
public static function fromString(string $value): self
{
if (1 !== \preg_match('/^(?>\r\n|\n|\r)$/', $string)) {
throw Exception\InvalidNewLineStringException::fromString($string);
if (1 !== \preg_match('/^(?>\r\n|\n|\r)$/', $value)) {
throw Exception\InvalidNewLineStringException::fromString($value);
}

return new self($string);
return new self($value);
}

public static function fromJson(Json $json): self
Expand All @@ -48,6 +48,6 @@ public static function fromJson(Json $json): self

public function toString(): string
{
return $this->string;
return $this->value;
}
}

0 comments on commit c46216e

Please sign in to comment.