Skip to content

Commit

Permalink
Refactor FluentBuilder properties
Browse files Browse the repository at this point in the history
  • Loading branch information
rudashi committed Mar 6, 2024
1 parent e244816 commit 0403c4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Concerns/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function lowerLetters(): static

return $this;
}
}
}
13 changes: 10 additions & 3 deletions src/FluentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class FluentBuilder
{
use Tokens;

protected const DELIMITER = '/';

protected string $context = '';
/**
* @var array<int, string>
Expand All @@ -18,19 +20,24 @@ class FluentBuilder
/**
* @var array<int, string>
*/
protected array $prefix = ['/'];
protected array $prefix = [self::DELIMITER];
/**
* @var array<int, string>
*/
protected array $suffix = ['/'];
protected array $suffix = [self::DELIMITER];
/**
* @var array<int, string>
*/
protected array $modifiers = [];

public function get(): string
{
return implode('', [...$this->prefix, ...$this->pattern, ...$this->suffix, ...$this->modifiers]);
return implode('', [
...$this->prefix,
...$this->pattern,
...$this->suffix,
...$this->modifiers,
]);
}

public function setContext(string $string): static
Expand Down

0 comments on commit 0403c4d

Please sign in to comment.