-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDirective.php
More file actions
34 lines (29 loc) · 717 Bytes
/
Directive.php
File metadata and controls
34 lines (29 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace Intervention\HttpAuth;
use Intervention\HttpAuth\Interfaces\DirectiveInterface;
class Directive implements DirectiveInterface
{
/**
* Create new instance
*
* @param array<mixed> $parameters
* @return void
*/
public function __construct(protected array $parameters = [])
{
}
/**
* {@inheritdoc}
*
* @see DirectiveInterface::__toString()
*/
public function __toString(): string
{
return implode(', ', array_map(
fn(mixed $key, mixed $value): string => sprintf('%s="%s"', $key, $value),
array_keys($this->parameters),
$this->parameters,
));
}
}