@@ -25,8 +25,8 @@ |
||
| 25 | 25 | protected string $path; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * {@inheritdoc} |
|
| 29 | - */ |
|
| 28 | + * {@inheritdoc} |
|
| 29 | + */ |
|
| 30 | 30 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 31 | 31 | { |
| 32 | 32 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @class StaticTag |
| 60 | 60 | * @package Platine\Framework\Template\Tag |
| 61 | 61 | */ |
| 62 | -class StaticTag extends AbstractTag |
|
| 63 | -{ |
|
| 62 | +class StaticTag extends AbstractTag { |
|
| 64 | 63 | |
| 65 | 64 | /** |
| 66 | 65 | * The static path |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * {@inheritdoc} |
| 73 | 72 | */ |
| 74 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 75 | - { |
|
| 73 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 76 | 74 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 77 | 75 | if ($lexer->match($markup)) { |
| 78 | 76 | $this->path = $lexer->getStringMatch(0); |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | protected string $name; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * {@inheritdoc} |
|
| 30 | - */ |
|
| 29 | + * {@inheritdoc} |
|
| 30 | + */ |
|
| 31 | 31 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 32 | 32 | { |
| 33 | 33 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @class SessionFlashTag |
| 60 | 60 | * @package Platine\Framework\Template\Tag |
| 61 | 61 | */ |
| 62 | -class SessionFlashTag extends AbstractTag |
|
| 63 | -{ |
|
| 62 | +class SessionFlashTag extends AbstractTag { |
|
| 64 | 63 | |
| 65 | 64 | /** |
| 66 | 65 | * The key of the session |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * {@inheritdoc} |
| 73 | 72 | */ |
| 74 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 75 | - { |
|
| 73 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 76 | 74 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 77 | 75 | if ($lexer->match($markup)) { |
| 78 | 76 | $this->name = $lexer->getStringMatch(0); |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | protected string $name; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * {@inheritdoc} |
|
| 30 | - */ |
|
| 29 | + * {@inheritdoc} |
|
| 30 | + */ |
|
| 31 | 31 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 32 | 32 | { |
| 33 | 33 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @class RouteUrlTag |
| 60 | 60 | * @package Platine\Framework\Template\Tag |
| 61 | 61 | */ |
| 62 | -class RouteUrlTag extends AbstractTag |
|
| 63 | -{ |
|
| 62 | +class RouteUrlTag extends AbstractTag { |
|
| 64 | 63 | |
| 65 | 64 | /** |
| 66 | 65 | * The name of the route |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * {@inheritdoc} |
| 73 | 72 | */ |
| 74 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 75 | - { |
|
| 73 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 76 | 74 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 77 | 75 | if ($lexer->match($markup)) { |
| 78 | 76 | $this->name = $lexer->getStringMatch(0); |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class AuthInvalidPasswordEvent |
| 55 | 55 | * @package Platine\Framework\Auth\Event |
| 56 | 56 | */ |
| 57 | -class AuthInvalidPasswordEvent extends Event |
|
| 58 | -{ |
|
| 57 | +class AuthInvalidPasswordEvent extends Event { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * The authentication user |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | * Create new instance |
| 68 | 67 | * @param User $user |
| 69 | 68 | */ |
| 70 | - public function __construct(User $user) |
|
| 71 | - { |
|
| 69 | + public function __construct(User $user) { |
|
| 72 | 70 | parent::__construct(__CLASS__, []); |
| 73 | 71 | $this->user = $user; |
| 74 | 72 | } |
@@ -212,10 +212,10 @@ |
||
| 212 | 212 | return $this; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - /** |
|
| 216 | - * Return the application root path |
|
| 217 | - * @return string |
|
| 218 | - */ |
|
| 215 | + /** |
|
| 216 | + * Return the application root path |
|
| 217 | + * @return string |
|
| 218 | + */ |
|
| 219 | 219 | public function getAppPath(): string |
| 220 | 220 | { |
| 221 | 221 | return $this->appPath; |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | * @class Application |
| 64 | 64 | * @package Platine\Framework\App |
| 65 | 65 | */ |
| 66 | -class Application extends Container |
|
| 67 | -{ |
|
| 66 | +class Application extends Container { |
|
| 68 | 67 | |
| 69 | 68 | /** |
| 70 | 69 | * The application version |
@@ -135,8 +134,7 @@ discard block |
||
| 135 | 134 | * Create new instance |
| 136 | 135 | * @param string $basePath |
| 137 | 136 | */ |
| 138 | - public function __construct(string $basePath = '') |
|
| 139 | - { |
|
| 137 | + public function __construct(string $basePath = '') { |
|
| 140 | 138 | parent::__construct(); |
| 141 | 139 | |
| 142 | 140 | $this->basePath = $basePath; |
@@ -188,8 +186,7 @@ discard block |
||
| 188 | 186 | * @param string $env |
| 189 | 187 | * @return $this |
| 190 | 188 | */ |
| 191 | - public function setEnvironment(string $env) |
|
| 192 | - { |
|
| 189 | + public function setEnvironment(string $env) { |
|
| 193 | 190 | $this->env = $env; |
| 194 | 191 | |
| 195 | 192 | return $this; |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * @class CurrentUrlTag |
| 56 | 56 | * @package Platine\Framework\Template\Tag |
| 57 | 57 | */ |
| 58 | -class CurrentUrlTag extends AbstractTag |
|
| 59 | -{ |
|
| 58 | +class CurrentUrlTag extends AbstractTag { |
|
| 60 | 59 | |
| 61 | 60 | /** |
| 62 | 61 | * {@inheritdoc} |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class RequestData |
| 55 | 55 | * @package Platine\Framework\Http |
| 56 | 56 | */ |
| 57 | -class RequestData |
|
| 58 | -{ |
|
| 57 | +class RequestData { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * The request body or post data |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | * Create new instance |
| 92 | 91 | * @param ServerRequestInterface $request |
| 93 | 92 | */ |
| 94 | - public function __construct(ServerRequestInterface $request) |
|
| 95 | - { |
|
| 93 | + public function __construct(ServerRequestInterface $request) { |
|
| 96 | 94 | $this->posts = (array) $request->getParsedBody(); |
| 97 | 95 | $this->gets = $request->getQueryParams(); |
| 98 | 96 | $this->servers = $request->getServerParams(); |
@@ -154,8 +152,7 @@ discard block |
||
| 154 | 152 | * |
| 155 | 153 | * @return mixed |
| 156 | 154 | */ |
| 157 | - public function get(string $key, $default = null) |
|
| 158 | - { |
|
| 155 | + public function get(string $key, $default = null) { |
|
| 159 | 156 | $gets = $this->applyInputClean($this->gets); |
| 160 | 157 | return Arr::get($gets, $key, $default); |
| 161 | 158 | } |
@@ -167,8 +164,7 @@ discard block |
||
| 167 | 164 | * |
| 168 | 165 | * @return mixed |
| 169 | 166 | */ |
| 170 | - public function post(string $key, $default = null) |
|
| 171 | - { |
|
| 167 | + public function post(string $key, $default = null) { |
|
| 172 | 168 | $posts = $this->applyInputClean($this->posts); |
| 173 | 169 | return Arr::get($posts, $key, $default); |
| 174 | 170 | } |
@@ -180,8 +176,7 @@ discard block |
||
| 180 | 176 | * |
| 181 | 177 | * @return mixed |
| 182 | 178 | */ |
| 183 | - public function server(string $key, $default = null) |
|
| 184 | - { |
|
| 179 | + public function server(string $key, $default = null) { |
|
| 185 | 180 | $servers = $this->applyInputClean($this->servers); |
| 186 | 181 | return Arr::get($servers, $key, $default); |
| 187 | 182 | } |
@@ -193,8 +188,7 @@ discard block |
||
| 193 | 188 | * |
| 194 | 189 | * @return mixed |
| 195 | 190 | */ |
| 196 | - public function cookie(string $key, $default = null) |
|
| 197 | - { |
|
| 191 | + public function cookie(string $key, $default = null) { |
|
| 198 | 192 | $cookies = $this->applyInputClean($this->cookies); |
| 199 | 193 | return Arr::get($cookies, $key, $default); |
| 200 | 194 | } |
@@ -204,8 +198,7 @@ discard block |
||
| 204 | 198 | * @param mixed $str |
| 205 | 199 | * @return mixed |
| 206 | 200 | */ |
| 207 | - protected function cleanInput($str) |
|
| 208 | - { |
|
| 201 | + protected function cleanInput($str) { |
|
| 209 | 202 | if (is_array($str)) { |
| 210 | 203 | return array_map([$this, 'cleanInput'], $str); |
| 211 | 204 | } |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $config = $app->get(Config::class); |
| 88 | 88 | |
| 89 | 89 | $pagination->setItemsPerPage($config->get('pagination.item_per_page', 10)) |
| 90 | - ->setMaxPages($config->get('pagination.max_pages', 5)); |
|
| 90 | + ->setMaxPages($config->get('pagination.max_pages', 5)); |
|
| 91 | 91 | |
| 92 | 92 | return $pagination; |
| 93 | 93 | }); |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | * @class PaginationServiceProvider |
| 62 | 62 | * @package Platine\Framework\Service\Provider |
| 63 | 63 | */ |
| 64 | -class PaginationServiceProvider extends ServiceProvider |
|
| 65 | -{ |
|
| 64 | +class PaginationServiceProvider extends ServiceProvider { |
|
| 66 | 65 | |
| 67 | 66 | /** |
| 68 | 67 | * {@inheritdoc} |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function register(): void |
| 71 | 71 | { |
| 72 | - $this->app->bind(UrlGeneratorInterface::class, function (ContainerInterface $app) { |
|
| 72 | + $this->app->bind(UrlGeneratorInterface::class, function(ContainerInterface $app) { |
|
| 73 | 73 | return new ServerRequestUrlGenerator( |
| 74 | 74 | $app->get(ServerRequestInterface::class), |
| 75 | 75 | 'page' |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $this->app->bind(RendererInterface::class, BootstrapRenderer::class); |
| 80 | 80 | |
| 81 | - $this->app->bind(Pagination::class, function (ContainerInterface $app) { |
|
| 81 | + $this->app->bind(Pagination::class, function(ContainerInterface $app) { |
|
| 82 | 82 | $pagination = new Pagination( |
| 83 | 83 | $app->get(UrlGeneratorInterface::class), |
| 84 | 84 | $app->get(RendererInterface::class) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ) { |
| 75 | 75 | parent::__construct($application, $filesystem); |
| 76 | 76 | $this->setName('make:action') |
| 77 | - ->setDescription('Command to generate new request handler class'); |
|
| 77 | + ->setDescription('Command to generate new request handler class'); |
|
| 78 | 78 | |
| 79 | 79 | $this->addOption('-o|--overwrite', 'Overwrite existing files.', false, false); |
| 80 | 80 | } |
@@ -85,31 +85,3 @@ discard block |
||
| 85 | 85 | public function getClassTemplate(): string |
| 86 | 86 | { |
| 87 | 87 | return <<<EOF |
| 88 | - <?php |
|
| 89 | - |
|
| 90 | - declare(strict_types=1); |
|
| 91 | - |
|
| 92 | - namespace %namespace%; |
|
| 93 | - |
|
| 94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
| 95 | - use Platine\Http\ResponseInterface; |
|
| 96 | - use Platine\Http\ServerRequestInterface; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @class %classname% |
|
| 100 | - * @package %namespace% |
|
| 101 | - */ |
|
| 102 | - class %classname% implements RequestHandlerInterface |
|
| 103 | - { |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * {@inheritodc} |
|
| 107 | - */ |
|
| 108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
| 109 | - { |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - EOF; |
|
| 114 | - } |
|
| 115 | -} |
|
@@ -85,31 +85,3 @@ |
||
| 85 | 85 | public function getClassTemplate(): string |
| 86 | 86 | { |
| 87 | 87 | return <<<EOF |
| 88 | - <?php |
|
| 89 | - |
|
| 90 | - declare(strict_types=1); |
|
| 91 | - |
|
| 92 | - namespace %namespace%; |
|
| 93 | - |
|
| 94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
| 95 | - use Platine\Http\ResponseInterface; |
|
| 96 | - use Platine\Http\ServerRequestInterface; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @class %classname% |
|
| 100 | - * @package %namespace% |
|
| 101 | - */ |
|
| 102 | - class %classname% implements RequestHandlerInterface |
|
| 103 | - { |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * {@inheritodc} |
|
| 107 | - */ |
|
| 108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
| 109 | - { |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - EOF; |
|
| 114 | - } |
|
| 115 | -} |
|
@@ -85,31 +85,3 @@ |
||
| 85 | 85 | public function getClassTemplate(): string |
| 86 | 86 | { |
| 87 | 87 | return <<<EOF |
| 88 | - <?php |
|
| 89 | - |
|
| 90 | - declare(strict_types=1); |
|
| 91 | - |
|
| 92 | - namespace %namespace%; |
|
| 93 | - |
|
| 94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
| 95 | - use Platine\Http\ResponseInterface; |
|
| 96 | - use Platine\Http\ServerRequestInterface; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @class %classname% |
|
| 100 | - * @package %namespace% |
|
| 101 | - */ |
|
| 102 | - class %classname% implements RequestHandlerInterface |
|
| 103 | - { |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * {@inheritodc} |
|
| 107 | - */ |
|
| 108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
| 109 | - { |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - EOF; |
|
| 114 | - } |
|
| 115 | -} |
|
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @class MakeActionCommand |
| 56 | 56 | * @package Platine\Framework\Console\Command |
| 57 | 57 | */ |
| 58 | -class MakeActionCommand extends MakeCommand |
|
| 59 | -{ |
|
| 58 | +class MakeActionCommand extends MakeCommand { |
|
| 60 | 59 | |
| 61 | 60 | /** |
| 62 | 61 | * {@inheritodc} |
@@ -85,31 +84,3 @@ discard block |
||
| 85 | 84 | public function getClassTemplate(): string |
| 86 | 85 | { |
| 87 | 86 | return <<<EOF |
| 88 | - <?php |
|
| 89 | - |
|
| 90 | - declare(strict_types=1); |
|
| 91 | - |
|
| 92 | - namespace %namespace%; |
|
| 93 | - |
|
| 94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
| 95 | - use Platine\Http\ResponseInterface; |
|
| 96 | - use Platine\Http\ServerRequestInterface; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @class %classname% |
|
| 100 | - * @package %namespace% |
|
| 101 | - */ |
|
| 102 | - class %classname% implements RequestHandlerInterface |
|
| 103 | - { |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * {@inheritodc} |
|
| 107 | - */ |
|
| 108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
| 109 | - { |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - EOF; |
|
| 114 | - } |
|
| 115 | -} |
|
@@ -85,31 +85,3 @@ |
||
| 85 | 85 | public function getClassTemplate(): string |
| 86 | 86 | { |
| 87 | 87 | return <<<EOF |
| 88 | - <?php |
|
| 89 | - |
|
| 90 | - declare(strict_types=1); |
|
| 91 | - |
|
| 92 | - namespace %namespace%; |
|
| 93 | - |
|
| 94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
| 95 | - use Platine\Http\ResponseInterface; |
|
| 96 | - use Platine\Http\ServerRequestInterface; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @class %classname% |
|
| 100 | - * @package %namespace% |
|
| 101 | - */ |
|
| 102 | - class %classname% implements RequestHandlerInterface |
|
| 103 | - { |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * {@inheritodc} |
|
| 107 | - */ |
|
| 108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
| 109 | - { |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - EOF; |
|
| 114 | - } |
|
| 115 | -} |
|