Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 21b619f

Browse files
feat: Working on the new version
1 parent 6618354 commit 21b619f

File tree

75 files changed

+835
-714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+835
-714
lines changed

config/app.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

config/paths.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

config/routes.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010

11+
use Cake\Routing\Route\DashedRoute;
1112
use Cake\Routing\RouteBuilder;
1213
use Cake\Routing\Router;
13-
use Cake\Routing\Route\DashedRoute;
1414

1515
Router::plugin('DataTables', ['path' => '/data-tables'], function (RouteBuilder $builder) {
1616
$builder->fallbacks(DashedRoute::class);

src/Command/DataTablesCommand.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010

1111
namespace DataTables\Command;
@@ -98,10 +98,12 @@ public function execute(Arguments $args, ConsoleIo $io): ?int {
9898
foreach ($scanner->listUnskipped() as $item) {
9999
$io->out('- ' . Inflector::camelize($item));
100100
}
101+
101102
return static::CODE_SUCCESS;
102103
}
103104
if (!empty($this->_callback)) {
104105
$io->warning(sprintf("You don't must use callback argument on bake configs."));
106+
105107
return static::CODE_SUCCESS;
106108
}
107109
$this->bakeConfig($args, $io);
@@ -114,17 +116,20 @@ public function execute(Arguments $args, ConsoleIo $io): ?int {
114116
foreach ($validConfigs as $item) {
115117
$io->out('- ' . Inflector::camelize($item));
116118
}
119+
117120
return static::CODE_SUCCESS;
118121
}
119122
if (empty($this->_callback) || !in_array($this->_callback, $this->getValidCallbacks())) {
120123
$io->warning(sprintf('You must choose a valid callback name like:'));
121124
foreach ($this->getValidCallbacks() as $validCallback) {
122125
$io->out(" - $validCallback");
123126
}
127+
124128
return static::CODE_SUCCESS;
125129
}
126130
$this->bakeCallbackBody($args, $io);
127131
}
132+
128133
return static::CODE_SUCCESS;
129134
}
130135

@@ -212,6 +217,7 @@ private function getValidCallbacks(): array {
212217
$callbacks[$index] = str_replace(['callback_', '.twig'], '', $callback);
213218
}
214219
}
220+
215221
return $callbacks;
216222
}
217223

@@ -228,6 +234,7 @@ private function getValidConfigs(): array {
228234
$configs[$index] = str_replace(['DataTables.php'], '', $callback);
229235
}
230236
}
237+
231238
return $configs;
232239
}
233240

@@ -261,6 +268,7 @@ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionPar
261268
]);
262269
$parser->removeOption('plugin');
263270
$parser->removeOption('theme');
271+
264272
return $parser;
265273
}
266274

src/Controller/AppController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

src/Controller/AssetsController.php

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
namespace DataTables\Controller;
55

6-
use DataTables\Controller\AppController;
7-
86
/**
97
* Class AssetsController
108
* Created by allancarvalho in june 26, 2020

src/Controller/Component/AssetsTrait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/**
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
5-
* link: https://github.com/wsssoftware/cakephp-data-renderer
6-
* author: Allan Carvalho <[email protected]>
7-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
5+
* link: https://github.com/wsssoftware/cakephp-data-renderer
6+
* author: Allan Carvalho <[email protected]>
7+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
88
*/
99
declare(strict_types = 1);
1010

src/Controller/Component/CssComponent.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

src/Controller/Component/DataTablesComponent.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function initialize(array $config): void {
5050
* original ConfigBundle Columns configuration on table render.
5151
*
5252
* @param string $dataTablesName
53-
* @return \DataTables\Table\Columns
5453
* @throws \ReflectionException
54+
* @return \DataTables\Table\Columns
5555
*/
5656
public function getColumns(string $dataTablesName): Columns {
5757
return $this->setEventAndGetObject($dataTablesName, 'Columns');
@@ -62,8 +62,8 @@ public function getColumns(string $dataTablesName): Columns {
6262
* original ConfigBundle MainOption configuration on table render.
6363
*
6464
* @param string $dataTablesName
65-
* @return \DataTables\Table\Option\MainOption
6665
* @throws \ReflectionException
66+
* @return \DataTables\Table\Option\MainOption
6767
*/
6868
public function getOptions(string $dataTablesName): MainOption {
6969
return $this->setEventAndGetObject($dataTablesName, 'Options');
@@ -74,8 +74,8 @@ public function getOptions(string $dataTablesName): MainOption {
7474
* original ConfigBundle QueryBaseState configuration on table render.
7575
*
7676
* @param string $dataTablesName
77-
* @return \DataTables\Table\QueryBaseState
7877
* @throws \ReflectionException
78+
* @return \DataTables\Table\QueryBaseState
7979
*/
8080
public function getQuery(string $dataTablesName): QueryBaseState {
8181
return $this->setEventAndGetObject($dataTablesName, 'Query');
@@ -86,8 +86,8 @@ public function getQuery(string $dataTablesName): QueryBaseState {
8686
*
8787
* @param string $dataTablesName
8888
* @param string $objectName
89-
* @return \DataTables\Table\QueryBaseState|\DataTables\Table\Option\MainOption|\DataTables\Table\Columns
9089
* @throws \ReflectionException
90+
* @return \DataTables\Table\QueryBaseState|\DataTables\Table\Option\MainOption|\DataTables\Table\Columns
9191
*/
9292
private function setEventAndGetObject(string $dataTablesName, string $objectName) {
9393
$configBundle = $this->getConfigBundle($dataTablesName);
@@ -111,8 +111,8 @@ private function setEventAndGetObject(string $dataTablesName, string $objectName
111111
* Get a ConfigBundle instance using its name or FQN.
112112
*
113113
* @param string $dataTables
114-
* @return \DataTables\Table\ConfigBundle
115114
* @throws \ReflectionException
115+
* @return \DataTables\Table\ConfigBundle
116116
*/
117117
private function getConfigBundle(string $dataTables): ConfigBundle {
118118
if (empty($this->_configBundles[$dataTables])) {

src/Controller/Component/JsComponent.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

src/Controller/ProviderController.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/**
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
5-
* link: https://github.com/wsssoftware/cakephp-data-renderer
6-
* author: Allan Carvalho <[email protected]>
7-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
5+
* link: https://github.com/wsssoftware/cakephp-data-renderer
6+
* author: Allan Carvalho <[email protected]>
7+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
88
*/
99
declare(strict_types = 1);
1010

@@ -54,8 +54,8 @@ public function beforeFilter(EventInterface $event) {
5454
}
5555

5656
/**
57-
* @return void
5857
* @noinspection PhpUnused
58+
* @return void
5959
*/
6060
public function getI18nTranslation() {
6161
$json = [
@@ -94,10 +94,10 @@ public function getI18nTranslation() {
9494
/**
9595
* Index method
9696
*
97+
* @noinspection PhpUnused
9798
* @param string $tablesCass
98-
* @return \Cake\Http\Response|null|void Renders view
9999
* @throws \ReflectionException
100-
* @noinspection PhpUnused
100+
* @return \Cake\Http\Response|null|void Renders view
101101
*/
102102
public function getTablesData(string $tablesCass) {
103103
$configBundle = Builder::getInstance()->getConfigBundle(Inflector::camelize($tablesCass), $this->_cache);

src/Plugin.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

src/StorageEngine/CacheStorageEngine.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

@@ -27,8 +27,6 @@ class CacheStorageEngine implements StorageEngineInterface {
2727
private $_cacheConfigName = '_data_tables_config_bundles_';
2828

2929
/**
30-
* CacheStorageEngine constructor.
31-
*
3230
* @param string|null $cacheConfigName
3331
*/
3432
public function __construct(?string $cacheConfigName = null) {
@@ -57,6 +55,7 @@ public function exists(string $key): bool {
5755
*/
5856
public function read(string $key): ?ConfigBundle {
5957
$configBundle = Cache::read($key, '_data_tables_config_bundles_');
58+
6059
return ($configBundle instanceof ConfigBundle) ? $configBundle : null;
6160
}
6261

src/StorageEngine/StorageEngineInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Copyright (c) Allan Carvalho 2020.
44
* Under Mit License
55
*
6-
* link: https://github.com/wsssoftware/cakephp-data-renderer
7-
* author: Allan Carvalho <[email protected]>
8-
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
6+
* link: https://github.com/wsssoftware/cakephp-data-renderer
7+
* author: Allan Carvalho <[email protected]>
8+
* license: MIT License https://github.com/wsssoftware/cakephp-datatables/blob/master/LICENSE
99
*/
1010
declare(strict_types = 1);
1111

0 commit comments

Comments
 (0)