@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * @class ResponseEmitter |
59 | 59 | * @package Platine\Framework\Http\Emitter |
60 | 60 | */ |
61 | -class ResponseEmitter implements EmitterInterface |
|
62 | -{ |
|
61 | +class ResponseEmitter implements EmitterInterface { |
|
63 | 62 | /** |
64 | 63 | * The response buffer length |
65 | 64 | * @var int|null |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * Create new instance |
71 | 70 | * @param int|null $bufferLength |
72 | 71 | */ |
73 | - public function __construct(?int $bufferLength = null) |
|
74 | - { |
|
72 | + public function __construct(?int $bufferLength = null) { |
|
75 | 73 | if ($bufferLength !== null && $bufferLength < 1) { |
76 | 74 | throw new InvalidArgumentException(sprintf( |
77 | 75 | 'The response buffer length must be greater than zero; received [%d].', |
@@ -59,8 +59,7 @@ |
||
59 | 59 | * @class BaseMakeActionCommand |
60 | 60 | * @package Platine\Framework\Console |
61 | 61 | */ |
62 | -abstract class BaseMakeActionCommand extends MakeCommand |
|
63 | -{ |
|
62 | +abstract class BaseMakeActionCommand extends MakeCommand { |
|
64 | 63 | /** |
65 | 64 | * The form parameter class name |
66 | 65 | * @var class-string |
@@ -65,8 +65,7 @@ |
||
65 | 65 | * @class MakeResourceActionCommand |
66 | 66 | * @package Platine\Framework\Console\Command |
67 | 67 | */ |
68 | -class MakeResourceActionCommand extends BaseMakeActionCommand |
|
69 | -{ |
|
68 | +class MakeResourceActionCommand extends BaseMakeActionCommand { |
|
70 | 69 | /** |
71 | 70 | * {@inheritdoc} |
72 | 71 | */ |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | parent::__construct($application, $filesystem); |
84 | 84 | |
85 | 85 | $this->setName('make:resource') |
86 | - ->setDescription('Command to generate resource action'); |
|
86 | + ->setDescription('Command to generate resource action'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | $this->addProperty($this->repositoryClass); |
103 | 103 | } |
104 | 104 | |
105 | - /** |
|
106 | - * {@inheritdoc} |
|
107 | - */ |
|
105 | + /** |
|
106 | + * {@inheritdoc} |
|
107 | + */ |
|
108 | 108 | public function getClassTemplate(): string |
109 | 109 | { |
110 | 110 | return <<<EOF |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * @class MakeCrudActionCommand |
57 | 57 | * @package Platine\Framework\Console\Command |
58 | 58 | */ |
59 | -class MakeCrudActionCommand extends BaseMakeActionCommand |
|
60 | -{ |
|
59 | +class MakeCrudActionCommand extends BaseMakeActionCommand { |
|
61 | 60 | /** |
62 | 61 | * {@inheritdoc} |
63 | 62 | */ |
@@ -75,12 +75,12 @@ |
||
75 | 75 | parent::__construct($application, $filesystem); |
76 | 76 | |
77 | 77 | $this->setName('make:crud') |
78 | - ->setDescription('Command to generate platine CRUD action'); |
|
78 | + ->setDescription('Command to generate platine CRUD action'); |
|
79 | 79 | } |
80 | 80 | |
81 | - /** |
|
82 | - * {@inheritdoc} |
|
83 | - */ |
|
81 | + /** |
|
82 | + * {@inheritdoc} |
|
83 | + */ |
|
84 | 84 | public function getClassTemplate(): string |
85 | 85 | { |
86 | 86 | return <<<EOF |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | protected string $permission; |
68 | 68 | |
69 | 69 | /** |
70 | - * {@inheritdoc} |
|
71 | - */ |
|
70 | + * {@inheritdoc} |
|
71 | + */ |
|
72 | 72 | public function __construct(string $markup, &$tokens, Parser $parser) |
73 | 73 | { |
74 | 74 | $lexer = new Lexer('/(\w+)/'); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * {@inheritdoc} |
|
88 | - */ |
|
87 | + * {@inheritdoc} |
|
88 | + */ |
|
89 | 89 | public function render(Context $context): string |
90 | 90 | { |
91 | 91 | if ($context->hasKey($this->permission)) { |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * @class PermissionTag |
59 | 59 | * @package Platine\Framework\Template\Tag |
60 | 60 | */ |
61 | -class PermissionTag extends AbstractBlock |
|
62 | -{ |
|
61 | +class PermissionTag extends AbstractBlock { |
|
63 | 62 | /** |
64 | 63 | * The code of the permission |
65 | 64 | * @var string |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | /** |
70 | 69 | * {@inheritdoc} |
71 | 70 | */ |
72 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
73 | - { |
|
71 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
74 | 72 | $lexer = new Lexer('/(\w+)/'); |
75 | 73 | if ($lexer->match($markup)) { |
76 | 74 | $this->permission = $lexer->getStringMatch(1); |
@@ -58,8 +58,8 @@ |
||
58 | 58 | class AuthTag extends AbstractBlock |
59 | 59 | { |
60 | 60 | /** |
61 | - * {@inheritdoc} |
|
62 | - */ |
|
61 | + * {@inheritdoc} |
|
62 | + */ |
|
63 | 63 | public function render(Context $context): string |
64 | 64 | { |
65 | 65 | /** @var AuthenticationInterface $authentication */ |
@@ -55,8 +55,7 @@ |
||
55 | 55 | * @class AuthTag |
56 | 56 | * @package Platine\Framework\Template\Tag |
57 | 57 | */ |
58 | -class AuthTag extends AbstractBlock |
|
59 | -{ |
|
58 | +class AuthTag extends AbstractBlock { |
|
60 | 59 | /** |
61 | 60 | * {@inheritdoc} |
62 | 61 | */ |
@@ -61,8 +61,8 @@ |
||
61 | 61 | class CsrfTag extends AbstractTag |
62 | 62 | { |
63 | 63 | /** |
64 | - * {@inheritdoc} |
|
65 | - */ |
|
64 | + * {@inheritdoc} |
|
65 | + */ |
|
66 | 66 | public function __construct(string $markup, &$tokens, Parser $parser) |
67 | 67 | { |
68 | 68 | parent::__construct($markup, $tokens, $parser); |
@@ -58,13 +58,11 @@ |
||
58 | 58 | * @package Platine\Framework\Template\Tag |
59 | 59 | * @template T |
60 | 60 | */ |
61 | -class CsrfTag extends AbstractTag |
|
62 | -{ |
|
61 | +class CsrfTag extends AbstractTag { |
|
63 | 62 | /** |
64 | 63 | * {@inheritdoc} |
65 | 64 | */ |
66 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
67 | - { |
|
65 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
68 | 66 | parent::__construct($markup, $tokens, $parser); |
69 | 67 | $this->extractAttributes($markup); |
70 | 68 | } |
@@ -103,11 +103,11 @@ |
||
103 | 103 | return new static($quota, 1); |
104 | 104 | } |
105 | 105 | |
106 | - /** |
|
107 | - * Set quota to be used per minute |
|
108 | - * @param int $quota |
|
109 | - * @return self |
|
110 | - */ |
|
106 | + /** |
|
107 | + * Set quota to be used per minute |
|
108 | + * @param int $quota |
|
109 | + * @return self |
|
110 | + */ |
|
111 | 111 | public static function perMinute(int $quota): self |
112 | 112 | { |
113 | 113 | return new static($quota, 60); |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | * @class Rate |
54 | 54 | * @package Platine\Framework\Http\RateLimit |
55 | 55 | */ |
56 | -class Rate |
|
57 | -{ |
|
56 | +class Rate { |
|
58 | 57 | /** |
59 | 58 | * The rate limit quota |
60 | 59 | * @var int |
@@ -73,8 +72,7 @@ discard block |
||
73 | 72 | * @param int $quota |
74 | 73 | * @param int $interval |
75 | 74 | */ |
76 | - final protected function __construct(int $quota, int $interval) |
|
77 | - { |
|
75 | + final protected function __construct(int $quota, int $interval) { |
|
78 | 76 | if ($quota <= 0) { |
79 | 77 | throw new InvalidArgumentException(sprintf( |
80 | 78 | 'Quota must be greater than zero, received [%d]', |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * @class LimitExceededException |
41 | 41 | * @package Platine\Framework\Http\RateLimit\Exception |
42 | 42 | */ |
43 | -class LimitExceededException extends RuntimeException |
|
44 | -{ |
|
43 | +class LimitExceededException extends RuntimeException { |
|
45 | 44 | /** |
46 | 45 | * The identifier |
47 | 46 | * @var string |