@@ -7,21 +7,21 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | interface RequestHandlerInterface |
| 9 | 9 | { |
| 10 | - /** |
|
| 10 | +/** |
|
| 11 | 11 | * Get the target function or class and method |
| 12 | 12 | * |
| 13 | 13 | * @return Target|null |
| 14 | 14 | */ |
| 15 | - public function getTarget(): ?Target; |
|
| 15 | +public function getTarget(): ?Target; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | +/** |
|
| 18 | 18 | * @param ServerRequestInterface $xRequest |
| 19 | 19 | * |
| 20 | 20 | * @return Target |
| 21 | 21 | */ |
| 22 | - public function setTarget(ServerRequestInterface $xRequest): Target; |
|
| 22 | +public function setTarget(ServerRequestInterface $xRequest): Target; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | +/** |
|
| 25 | 25 | * Check if this plugin can process the current request |
| 26 | 26 | * |
| 27 | 27 | * Called by the <Jaxon\Plugin\RequestManager> when a request has been received to determine |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return bool |
| 33 | 33 | */ |
| 34 | - public static function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 34 | +public static function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | +/** |
|
| 37 | 37 | * Process the current request |
| 38 | 38 | * |
| 39 | 39 | * Called by the <Jaxon\Plugin\RequestManager> when a request is being processed. |
@@ -42,5 +42,5 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | - public function processRequest(): void; |
|
| 45 | +public function processRequest(): void; |
|
| 46 | 46 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | abstract class AbstractAnnotation extends Annotation implements IAnnotationParser |
| 22 | 22 | { |
| 23 | - /** |
|
| 23 | +/** |
|
| 24 | 24 | * Save the annotation value |
| 25 | 25 | * |
| 26 | 26 | * @param Metadata $xMetadata |
@@ -28,5 +28,5 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @return void |
| 30 | 30 | */ |
| 31 | - abstract public function saveValue(Metadata $xMetadata, string $sMethod = '*'): void; |
|
| 31 | +abstract public function saveValue(Metadata $xMetadata, string $sMethod = '*'): void; |
|
| 32 | 32 | } |
@@ -18,22 +18,22 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | class TemplateView implements ViewInterface |
| 20 | 20 | { |
| 21 | - /** |
|
| 21 | +/** |
|
| 22 | 22 | * The Jaxon template engine |
| 23 | 23 | * |
| 24 | 24 | * @var TemplateEngine |
| 25 | 25 | */ |
| 26 | - protected $xTemplateEngine; |
|
| 26 | +protected $xTemplateEngine; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 28 | +/** |
|
| 29 | 29 | * The class constructor |
| 30 | 30 | */ |
| 31 | - public function __construct(TemplateEngine $xTemplateEngine) |
|
| 32 | - { |
|
| 33 | - $this->xTemplateEngine = $xTemplateEngine; |
|
| 34 | - } |
|
| 31 | +public function __construct(TemplateEngine $xTemplateEngine) |
|
| 32 | +{ |
|
| 33 | +$this->xTemplateEngine = $xTemplateEngine; |
|
| 34 | +} |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | +/** |
|
| 37 | 37 | * Add a namespace to this view renderer |
| 38 | 38 | * |
| 39 | 39 | * @param string $sNamespace The namespace name |
@@ -42,28 +42,28 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | - public function addNamespace(string $sNamespace, string $sDirectory, string $sExtension = ''): void |
|
| 46 | - { |
|
| 47 | - $this->xTemplateEngine->addNamespace($sNamespace, $sDirectory, $sExtension); |
|
| 48 | - } |
|
| 45 | +public function addNamespace(string $sNamespace, string $sDirectory, string $sExtension = ''): void |
|
| 46 | +{ |
|
| 47 | +$this->xTemplateEngine->addNamespace($sNamespace, $sDirectory, $sExtension); |
|
| 48 | +} |
|
| 49 | 49 | |
| 50 | - /** |
|
| 50 | +/** |
|
| 51 | 51 | * Render a view |
| 52 | 52 | * |
| 53 | 53 | * @param Store $store A store populated with the view data |
| 54 | 54 | * |
| 55 | 55 | * @return string The string representation of the view |
| 56 | 56 | */ |
| 57 | - public function render(Store $store): string |
|
| 58 | - { |
|
| 59 | - $sViewName = $store->getViewName(); |
|
| 60 | - $sNamespace = $store->getNamespace(); |
|
| 61 | - // In this view renderer, the namespace must always be prepended to the view name. |
|
| 62 | - if(substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::') |
|
| 63 | - { |
|
| 64 | - $sViewName = $sNamespace . '::' . $sViewName; |
|
| 65 | - } |
|
| 66 | - // Render the template |
|
| 67 | - return trim($this->xTemplateEngine->render($sViewName, $store->getViewData()), " \t\n"); |
|
| 68 | - } |
|
| 57 | +public function render(Store $store): string |
|
| 58 | +{ |
|
| 59 | +$sViewName = $store->getViewName(); |
|
| 60 | +$sNamespace = $store->getNamespace(); |
|
| 61 | +// In this view renderer, the namespace must always be prepended to the view name. |
|
| 62 | +if(substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::') |
|
| 63 | +{ |
|
| 64 | +$sViewName = $sNamespace . '::' . $sViewName; |
|
| 65 | +} |
|
| 66 | +// Render the template |
|
| 67 | +return trim($this->xTemplateEngine->render($sViewName, $store->getViewData()), " \t\n"); |
|
| 68 | +} |
|
| 69 | 69 | } |
@@ -6,17 +6,17 @@ |
||
| 6 | 6 | |
| 7 | 7 | interface ResponsePluginInterface |
| 8 | 8 | { |
| 9 | - /** |
|
| 9 | +/** |
|
| 10 | 10 | * Get the attached response |
| 11 | 11 | * |
| 12 | 12 | * @return AbstractResponse|null |
| 13 | 13 | */ |
| 14 | - public function response(): ?AbstractResponse; |
|
| 14 | +public function response(): ?AbstractResponse; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 16 | +/** |
|
| 17 | 17 | * @param AbstractResponse $xResponse The response |
| 18 | 18 | * |
| 19 | 19 | * @return static |
| 20 | 20 | */ |
| 21 | - public function initPlugin(AbstractResponse $xResponse): static; |
|
| 21 | +public function initPlugin(AbstractResponse $xResponse): static; |
|
| 22 | 22 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | interface CallableRegistryInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 7 | +/** |
|
| 8 | 8 | * Check if the provided options are correct, and convert them into an array. |
| 9 | 9 | * |
| 10 | 10 | * @param string $sCallable |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @return array |
| 14 | 14 | */ |
| 15 | - public function checkOptions(string $sCallable, $xOptions): array; |
|
| 15 | +public function checkOptions(string $sCallable, $xOptions): array; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | +/** |
|
| 18 | 18 | * Register a callable entity: a function or a class. |
| 19 | 19 | * |
| 20 | 20 | * Called by the <Jaxon\Plugin\RequestManager> when a user script |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @return bool |
| 29 | 29 | */ |
| 30 | - public function register(string $sType, string $sCallable, array $aOptions): bool; |
|
| 30 | +public function register(string $sType, string $sCallable, array $aOptions): bool; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 32 | +/** |
|
| 33 | 33 | * Get the callable object for a registered item |
| 34 | 34 | * |
| 35 | 35 | * @param string $sCallable |
| 36 | 36 | * |
| 37 | 37 | * @return mixed |
| 38 | 38 | */ |
| 39 | - public function getCallable(string $sCallable): mixed; |
|
| 39 | +public function getCallable(string $sCallable): mixed; |
|
| 40 | 40 | } |
@@ -16,31 +16,31 @@ |
||
| 16 | 16 | |
| 17 | 17 | class JsCode |
| 18 | 18 | { |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * The main javascript code |
| 21 | 21 | * |
| 22 | 22 | * @var string |
| 23 | 23 | */ |
| 24 | - public $sJs = ''; |
|
| 24 | +public $sJs = ''; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 26 | +/** |
|
| 27 | 27 | * The js files |
| 28 | 28 | * |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - public $aFiles = []; |
|
| 31 | +public $aFiles = []; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 33 | +/** |
|
| 34 | 34 | * The javascript code to be inserted inline before the main code |
| 35 | 35 | * |
| 36 | 36 | * @var string |
| 37 | 37 | */ |
| 38 | - public $sJsBefore = ''; |
|
| 38 | +public $sJsBefore = ''; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 40 | +/** |
|
| 41 | 41 | * The javascript code to be inserted inline after the main code |
| 42 | 42 | * |
| 43 | 43 | * @var string |
| 44 | 44 | */ |
| 45 | - public $sJsAfter = ''; |
|
| 45 | +public $sJsAfter = ''; |
|
| 46 | 46 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | |
| 19 | 19 | class ReadyScriptGenerator extends AbstractCodeGenerator |
| 20 | 20 | { |
| 21 | - /** |
|
| 21 | +/** |
|
| 22 | 22 | * @inheritDoc |
| 23 | 23 | */ |
| 24 | - public function getScript(): string |
|
| 25 | - { |
|
| 26 | - return "jaxon.dom.ready(() => jaxon.processCustomAttrs());"; |
|
| 27 | - } |
|
| 24 | +public function getScript(): string |
|
| 25 | +{ |
|
| 26 | +return "jaxon.dom.ready(() => jaxon.processCustomAttrs());"; |
|
| 27 | +} |
|
| 28 | 28 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | interface MinifierInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 7 | +/** |
|
| 8 | 8 | * Minify javascript code |
| 9 | 9 | * |
| 10 | 10 | * @param string $sJsFile The javascript file to be minified |
@@ -12,5 +12,5 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @return bool |
| 14 | 14 | */ |
| 15 | - public function minify(string $sJsFile, string $sMinFile): bool; |
|
| 15 | +public function minify(string $sJsFile, string $sMinFile): bool; |
|
| 16 | 16 | } |
@@ -43,60 +43,60 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | class PaginatorPlugin extends AbstractResponsePlugin |
| 45 | 45 | { |
| 46 | - /** |
|
| 46 | +/** |
|
| 47 | 47 | * @const The plugin name |
| 48 | 48 | */ |
| 49 | - public const NAME = 'pg'; |
|
| 49 | +public const NAME = 'pg'; |
|
| 50 | 50 | |
| 51 | - /** |
|
| 51 | +/** |
|
| 52 | 52 | * The constructor. |
| 53 | 53 | * |
| 54 | 54 | * @param RendererInterface $xRenderer |
| 55 | 55 | */ |
| 56 | - public function __construct(protected RendererInterface $xRenderer) |
|
| 57 | - {} |
|
| 56 | +public function __construct(protected RendererInterface $xRenderer) |
|
| 57 | +{} |
|
| 58 | 58 | |
| 59 | - /** |
|
| 59 | +/** |
|
| 60 | 60 | * @inheritDoc |
| 61 | 61 | */ |
| 62 | - public function getName(): string |
|
| 63 | - { |
|
| 64 | - return self::NAME; |
|
| 65 | - } |
|
| 62 | +public function getName(): string |
|
| 63 | +{ |
|
| 64 | +return self::NAME; |
|
| 65 | +} |
|
| 66 | 66 | |
| 67 | - /** |
|
| 67 | +/** |
|
| 68 | 68 | * @inheritDoc |
| 69 | 69 | */ |
| 70 | - public function getHash(): string |
|
| 71 | - { |
|
| 72 | - return '5.0.0'; // Use the version number as hash |
|
| 73 | - } |
|
| 70 | +public function getHash(): string |
|
| 71 | +{ |
|
| 72 | +return '5.0.0'; // Use the version number as hash |
|
| 73 | +} |
|
| 74 | 74 | |
| 75 | - /** |
|
| 75 | +/** |
|
| 76 | 76 | * @inheritDoc |
| 77 | 77 | */ |
| 78 | - public function getCss(): string |
|
| 79 | - { |
|
| 80 | - return ' |
|
| 78 | +public function getCss(): string |
|
| 79 | +{ |
|
| 80 | +return ' |
|
| 81 | 81 | <style> |
| 82 | 82 | .pagination li a { |
| 83 | 83 | cursor: pointer; |
| 84 | 84 | } |
| 85 | 85 | </style> |
| 86 | 86 | '; |
| 87 | - } |
|
| 87 | +} |
|
| 88 | 88 | |
| 89 | - /** |
|
| 89 | +/** |
|
| 90 | 90 | * Get the view renderer |
| 91 | 91 | * |
| 92 | 92 | * @return RendererInterface |
| 93 | 93 | */ |
| 94 | - public function renderer(): RendererInterface |
|
| 95 | - { |
|
| 96 | - return $this->xRenderer; |
|
| 97 | - } |
|
| 94 | +public function renderer(): RendererInterface |
|
| 95 | +{ |
|
| 96 | +return $this->xRenderer; |
|
| 97 | +} |
|
| 98 | 98 | |
| 99 | - /** |
|
| 99 | +/** |
|
| 100 | 100 | * Create a paginator |
| 101 | 101 | * |
| 102 | 102 | * @param int $nPageNumber The current page number |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @return Paginator |
| 107 | 107 | */ |
| 108 | - public function paginator(int $nPageNumber, int $nItemsPerPage, int $nTotalItems): Paginator |
|
| 109 | - { |
|
| 110 | - return new Paginator($this, $nPageNumber, $nItemsPerPage, $nTotalItems); |
|
| 111 | - } |
|
| 108 | +public function paginator(int $nPageNumber, int $nItemsPerPage, int $nTotalItems): Paginator |
|
| 109 | +{ |
|
| 110 | +return new Paginator($this, $nPageNumber, $nItemsPerPage, $nTotalItems); |
|
| 111 | +} |
|
| 112 | 112 | } |