Skip to content

Commit

Permalink
nitpick
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Feb 17, 2018
1 parent b31476b commit a91523b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Profiles/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ abstract class Profile

protected $reportOnly = false;

abstract public function registerDirectives();

public function addDirective(string $directive, string $value): self
{
$this->guardAgainstInvalidDirectives($directive);
Expand All @@ -22,8 +24,6 @@ public function addDirective(string $directive, string $value): self
return $this;
}

abstract public function registerDirectives();

public function reportOnly(): self
{
$this->reportOnly = true;
Expand Down Expand Up @@ -69,13 +69,6 @@ public function applyTo(Response $response)
$response->headers->set($headerName, (string)$this);
}

protected function guardAgainstInvalidDirectives(string $directive)
{
if (!Directive::isValid($directive)) {
throw InvalidDirective::notSupported($directive);
}
}

public function __toString()
{
return collect($this->directives)
Expand All @@ -86,4 +79,11 @@ public function __toString()
})
->implode(';');
}

protected function guardAgainstInvalidDirectives(string $directive)
{
if (!Directive::isValid($directive)) {
throw InvalidDirective::notSupported($directive);
}
}
}

0 comments on commit a91523b

Please sign in to comment.