Skip to content

Commit

Permalink
Merge pull request #599 from ergebnis/fix/rename
Browse files Browse the repository at this point in the history
Fix: Rename parameter and field
  • Loading branch information
localheinz authored Dec 29, 2021
2 parents b93d1e6 + c46216e commit 38148ff
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 38148ff

Please sign in to comment.