@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | class UserValidator extends AbstractValidator |
25 | 25 | { |
26 | 26 | /** |
27 | - * The parameter instance |
|
28 | - * @var UserParam<TEntity> |
|
29 | - */ |
|
27 | + * The parameter instance |
|
28 | + * @var UserParam<TEntity> |
|
29 | + */ |
|
30 | 30 | protected UserParam $param; |
31 | 31 | |
32 | 32 | /** |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | protected bool $ignorePassword; |
37 | 37 | |
38 | 38 | /** |
39 | - * Create new instance |
|
40 | - * @param UserParam<TEntity> $param |
|
41 | - * @param Lang $lang |
|
42 | - * @param bool $ignorePassword |
|
43 | - */ |
|
39 | + * Create new instance |
|
40 | + * @param UserParam<TEntity> $param |
|
41 | + * @param Lang $lang |
|
42 | + * @param bool $ignorePassword |
|
43 | + */ |
|
44 | 44 | public function __construct(UserParam $param, Lang $lang, bool $ignorePassword = false) |
45 | 45 | { |
46 | 46 | parent::__construct($lang); |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * {@inheritdoc} |
|
53 | - */ |
|
52 | + * {@inheritdoc} |
|
53 | + */ |
|
54 | 54 | public function setValidationData(): void |
55 | 55 | { |
56 | 56 | $this->addData('username', $this->param->getUsername()); |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * {@inheritdoc} |
|
68 | - */ |
|
67 | + * {@inheritdoc} |
|
68 | + */ |
|
69 | 69 | public function setValidationRules(): void |
70 | 70 | { |
71 | 71 | $this->addRules('username', [ |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | * @package Platine\App\Validator |
22 | 22 | * @template TEntity as \Platine\Orm\Entity |
23 | 23 | */ |
24 | -class UserValidator extends AbstractValidator |
|
25 | -{ |
|
24 | +class UserValidator extends AbstractValidator { |
|
26 | 25 | /** |
27 | 26 | * The parameter instance |
28 | 27 | * @var UserParam<TEntity> |
@@ -41,8 +40,7 @@ discard block |
||
41 | 40 | * @param Lang $lang |
42 | 41 | * @param bool $ignorePassword |
43 | 42 | */ |
44 | - public function __construct(UserParam $param, Lang $lang, bool $ignorePassword = false) |
|
45 | - { |
|
43 | + public function __construct(UserParam $param, Lang $lang, bool $ignorePassword = false) { |
|
46 | 44 | parent::__construct($lang); |
47 | 45 | $this->param = $param; |
48 | 46 | $this->ignorePassword = $ignorePassword; |
@@ -30,71 +30,71 @@ discard block |
||
30 | 30 | class UserProfileAction |
31 | 31 | { |
32 | 32 | /** |
33 | - * The Lang instance |
|
34 | - * @var Lang |
|
35 | - */ |
|
33 | + * The Lang instance |
|
34 | + * @var Lang |
|
35 | + */ |
|
36 | 36 | protected Lang $lang; |
37 | 37 | |
38 | 38 | /** |
39 | - * The Template instance |
|
40 | - * @var Template |
|
41 | - */ |
|
39 | + * The Template instance |
|
40 | + * @var Template |
|
41 | + */ |
|
42 | 42 | protected Template $template; |
43 | 43 | |
44 | 44 | /** |
45 | - * The Flash instance |
|
46 | - * @var Flash |
|
47 | - */ |
|
45 | + * The Flash instance |
|
46 | + * @var Flash |
|
47 | + */ |
|
48 | 48 | protected Flash $flash; |
49 | 49 | |
50 | 50 | /** |
51 | - * The RouteHelper instance |
|
52 | - * @var RouteHelper |
|
53 | - */ |
|
51 | + * The RouteHelper instance |
|
52 | + * @var RouteHelper |
|
53 | + */ |
|
54 | 54 | protected RouteHelper $routeHelper; |
55 | 55 | |
56 | 56 | /** |
57 | - * The LoggerInterface instance |
|
58 | - * @var LoggerInterface |
|
59 | - */ |
|
57 | + * The LoggerInterface instance |
|
58 | + * @var LoggerInterface |
|
59 | + */ |
|
60 | 60 | protected LoggerInterface $logger; |
61 | 61 | |
62 | 62 | /** |
63 | - * The StatusList instance |
|
64 | - * @var StatusList |
|
65 | - */ |
|
63 | + * The StatusList instance |
|
64 | + * @var StatusList |
|
65 | + */ |
|
66 | 66 | protected StatusList $statusList; |
67 | 67 | |
68 | 68 | /** |
69 | - * The HashInterface instance |
|
70 | - * @var HashInterface |
|
71 | - */ |
|
69 | + * The HashInterface instance |
|
70 | + * @var HashInterface |
|
71 | + */ |
|
72 | 72 | protected HashInterface $hash; |
73 | 73 | |
74 | 74 | /** |
75 | - * The UserRepository instance |
|
76 | - * @var UserRepository |
|
77 | - */ |
|
75 | + * The UserRepository instance |
|
76 | + * @var UserRepository |
|
77 | + */ |
|
78 | 78 | protected UserRepository $userRepository; |
79 | 79 | |
80 | 80 | /** |
81 | - * The AuthenticationInterface instance |
|
82 | - * @var AuthenticationInterface |
|
83 | - */ |
|
81 | + * The AuthenticationInterface instance |
|
82 | + * @var AuthenticationInterface |
|
83 | + */ |
|
84 | 84 | protected AuthenticationInterface $authentication; |
85 | 85 | |
86 | 86 | /** |
87 | - * Create new instance |
|
88 | - * @param Lang $lang |
|
89 | - * @param AuthenticationInterface $authentication |
|
90 | - * @param Template $template |
|
91 | - * @param Flash $flash |
|
92 | - * @param RouteHelper $routeHelper |
|
93 | - * @param LoggerInterface $logger |
|
94 | - * @param StatusList $statusList |
|
95 | - * @param HashInterface $hash |
|
96 | - * @param UserRepository $userRepository |
|
97 | - */ |
|
87 | + * Create new instance |
|
88 | + * @param Lang $lang |
|
89 | + * @param AuthenticationInterface $authentication |
|
90 | + * @param Template $template |
|
91 | + * @param Flash $flash |
|
92 | + * @param RouteHelper $routeHelper |
|
93 | + * @param LoggerInterface $logger |
|
94 | + * @param StatusList $statusList |
|
95 | + * @param HashInterface $hash |
|
96 | + * @param UserRepository $userRepository |
|
97 | + */ |
|
98 | 98 | public function __construct( |
99 | 99 | Lang $lang, |
100 | 100 | AuthenticationInterface $authentication, |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * User profile |
|
122 | - * @param ServerRequestInterface $request |
|
123 | - * @return ResponseInterface |
|
124 | - */ |
|
121 | + * User profile |
|
122 | + * @param ServerRequestInterface $request |
|
123 | + * @return ResponseInterface |
|
124 | + */ |
|
125 | 125 | public function detail(ServerRequestInterface $request): ResponseInterface |
126 | 126 | { |
127 | 127 | $context = []; |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
154 | - * Update user profile |
|
155 | - * @param ServerRequestInterface $request |
|
156 | - * @return ResponseInterface |
|
157 | - */ |
|
154 | + * Update user profile |
|
155 | + * @param ServerRequestInterface $request |
|
156 | + * @return ResponseInterface |
|
157 | + */ |
|
158 | 158 | public function update(ServerRequestInterface $request): ResponseInterface |
159 | 159 | { |
160 | 160 | $context = []; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $user = $this->userRepository->find($id); |
167 | 167 | |
168 | 168 | if ($user === null) { |
169 | - $this->authentication->logout(); |
|
169 | + $this->authentication->logout(); |
|
170 | 170 | |
171 | 171 | $this->flash->setError($this->lang->tr('This record doesn\'t exist')); |
172 | 172 | |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | $usernameExist = $this->userRepository->findBy([ |
204 | - 'username' => $formParam->getUsername(), |
|
205 | - ]); |
|
204 | + 'username' => $formParam->getUsername(), |
|
205 | + ]); |
|
206 | 206 | |
207 | 207 | if ($usernameExist !== null && $usernameExist->id !== $id) { |
208 | 208 | $this->flash->setError($this->lang->tr('This username already exist')); |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | $emailExist = $this->userRepository->findBy([ |
218 | - 'email' => $formParam->getEmail(), |
|
219 | - ]); |
|
218 | + 'email' => $formParam->getEmail(), |
|
219 | + ]); |
|
220 | 220 | |
221 | 221 | if ($emailExist !== null && $emailExist->id !== $id) { |
222 | 222 | $this->flash->setError($this->lang->tr('This email already exist')); |
@@ -27,8 +27,7 @@ |
||
27 | 27 | * @class UserProfileAction |
28 | 28 | * @package Platine\App\Http\Action\User |
29 | 29 | */ |
30 | -class UserProfileAction |
|
31 | -{ |
|
30 | +class UserProfileAction { |
|
32 | 31 | /** |
33 | 32 | * The Lang instance |
34 | 33 | * @var Lang |
@@ -14,15 +14,15 @@ |
||
14 | 14 | //Action when migrate up |
15 | 15 | $this->create('product_categories', function (CreateTable $table) { |
16 | 16 | $table->integer('id') |
17 | - ->autoincrement() |
|
18 | - ->primary(); |
|
17 | + ->autoincrement() |
|
18 | + ->primary(); |
|
19 | 19 | |
20 | 20 | $table->string('name') |
21 | - ->description('The category name') |
|
22 | - ->notNull(); |
|
21 | + ->description('The category name') |
|
22 | + ->notNull(); |
|
23 | 23 | |
24 | 24 | $table->string('description') |
25 | - ->description('The category description'); |
|
25 | + ->description('The category description'); |
|
26 | 26 | |
27 | 27 | $table->timestamps(); |
28 | 28 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | public function up(): void |
13 | 13 | { |
14 | 14 | //Action when migrate up |
15 | - $this->create('product_categories', function (CreateTable $table) { |
|
15 | + $this->create('product_categories', function(CreateTable $table) { |
|
16 | 16 | $table->integer('id') |
17 | 17 | ->autoincrement() |
18 | 18 | ->primary(); |
@@ -6,8 +6,7 @@ |
||
6 | 6 | use Platine\Database\Schema\CreateTable; |
7 | 7 | use Platine\Framework\Migration\AbstractMigration; |
8 | 8 | |
9 | -class AddProductCategoriesTable20231207053927 extends AbstractMigration |
|
10 | -{ |
|
9 | +class AddProductCategoriesTable20231207053927 extends AbstractMigration { |
|
11 | 10 | |
12 | 11 | public function up(): void |
13 | 12 | { |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | class ProductServiceProvider extends ServiceProvider |
17 | 17 | { |
18 | 18 | /** |
19 | - * {@inheritdoc} |
|
20 | - */ |
|
19 | + * {@inheritdoc} |
|
20 | + */ |
|
21 | 21 | public function register(): void |
22 | 22 | { |
23 | 23 | $this->app->bind(ProductCategoryRepository::class); |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
29 | - * {@inheritdoc} |
|
30 | - */ |
|
29 | + * {@inheritdoc} |
|
30 | + */ |
|
31 | 31 | public function addRoutes(Router $router): void |
32 | 32 | { |
33 | 33 | $router->group('/product', function (Router $router) { |
@@ -13,8 +13,7 @@ |
||
13 | 13 | * @class ProductServiceProvider |
14 | 14 | * @package Platine\App\Provider |
15 | 15 | */ |
16 | -class ProductServiceProvider extends ServiceProvider |
|
17 | -{ |
|
16 | +class ProductServiceProvider extends ServiceProvider { |
|
18 | 17 | /** |
19 | 18 | * {@inheritdoc} |
20 | 19 | */ |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function addRoutes(Router $router): void |
37 | 37 | { |
38 | - $router->group('/product', function (Router $router) { |
|
38 | + $router->group('/product', function(Router $router) { |
|
39 | 39 | $router->resource('', ProductAction::class, 'product'); |
40 | 40 | $router->resource('/category', CategoryAction::class, 'product_category'); |
41 | 41 | }); |
@@ -16,9 +16,9 @@ |
||
16 | 16 | class ProductCategoryRepository extends Repository |
17 | 17 | { |
18 | 18 | /** |
19 | - * Create new instance |
|
20 | - * @param EntityManager<ProductCategory> $manager |
|
21 | - */ |
|
19 | + * Create new instance |
|
20 | + * @param EntityManager<ProductCategory> $manager |
|
21 | + */ |
|
22 | 22 | public function __construct(EntityManager $manager) |
23 | 23 | { |
24 | 24 | parent::__construct($manager, ProductCategory::class); |
@@ -13,14 +13,12 @@ |
||
13 | 13 | * @package Platine\App\Model\Repository |
14 | 14 | * @extends Repository<ProductCategory> |
15 | 15 | */ |
16 | -class ProductCategoryRepository extends Repository |
|
17 | -{ |
|
16 | +class ProductCategoryRepository extends Repository { |
|
18 | 17 | /** |
19 | 18 | * Create new instance |
20 | 19 | * @param EntityManager<ProductCategory> $manager |
21 | 20 | */ |
22 | - public function __construct(EntityManager $manager) |
|
23 | - { |
|
21 | + public function __construct(EntityManager $manager) { |
|
24 | 22 | parent::__construct($manager, ProductCategory::class); |
25 | 23 | } |
26 | 24 | } |
@@ -15,16 +15,16 @@ |
||
15 | 15 | class ProductCategory extends Entity |
16 | 16 | { |
17 | 17 | /** |
18 | - * @param EntityMapperInterface<ProductCategory> $mapper |
|
19 | - * @return void |
|
20 | - */ |
|
18 | + * @param EntityMapperInterface<ProductCategory> $mapper |
|
19 | + * @return void |
|
20 | + */ |
|
21 | 21 | public static function mapEntity(EntityMapperInterface $mapper): void |
22 | 22 | { |
23 | 23 | $mapper->table('product_categories'); |
24 | 24 | $mapper->useTimestamp(); |
25 | 25 | $mapper->casts([ |
26 | - 'created_at' => 'date', |
|
27 | - 'updated_at' => '?date', |
|
26 | + 'created_at' => 'date', |
|
27 | + 'updated_at' => '?date', |
|
28 | 28 | ]); |
29 | 29 | } |
30 | 30 | } |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * @package Platine\App\Model\Entity |
13 | 13 | * @extends Entity<ProductCategory> |
14 | 14 | */ |
15 | -class ProductCategory extends Entity |
|
16 | -{ |
|
15 | +class ProductCategory extends Entity { |
|
17 | 16 | /** |
18 | 17 | * @param EntityMapperInterface<ProductCategory> $mapper |
19 | 18 | * @return void |
@@ -28,59 +28,59 @@ discard block |
||
28 | 28 | class CategoryAction |
29 | 29 | { |
30 | 30 | /** |
31 | - * The Lang instance |
|
32 | - * @var Lang |
|
33 | - */ |
|
31 | + * The Lang instance |
|
32 | + * @var Lang |
|
33 | + */ |
|
34 | 34 | protected Lang $lang; |
35 | 35 | |
36 | 36 | /** |
37 | - * The Pagination instance |
|
38 | - * @var Pagination |
|
39 | - */ |
|
37 | + * The Pagination instance |
|
38 | + * @var Pagination |
|
39 | + */ |
|
40 | 40 | protected Pagination $pagination; |
41 | 41 | |
42 | 42 | /** |
43 | - * The Template instance |
|
44 | - * @var Template |
|
45 | - */ |
|
43 | + * The Template instance |
|
44 | + * @var Template |
|
45 | + */ |
|
46 | 46 | protected Template $template; |
47 | 47 | |
48 | 48 | /** |
49 | - * The Flash instance |
|
50 | - * @var Flash |
|
51 | - */ |
|
49 | + * The Flash instance |
|
50 | + * @var Flash |
|
51 | + */ |
|
52 | 52 | protected Flash $flash; |
53 | 53 | |
54 | 54 | /** |
55 | - * The RouteHelper instance |
|
56 | - * @var RouteHelper |
|
57 | - */ |
|
55 | + * The RouteHelper instance |
|
56 | + * @var RouteHelper |
|
57 | + */ |
|
58 | 58 | protected RouteHelper $routeHelper; |
59 | 59 | |
60 | 60 | /** |
61 | - * The LoggerInterface instance |
|
62 | - * @var LoggerInterface |
|
63 | - */ |
|
61 | + * The LoggerInterface instance |
|
62 | + * @var LoggerInterface |
|
63 | + */ |
|
64 | 64 | protected LoggerInterface $logger; |
65 | 65 | |
66 | 66 | /** |
67 | - * The ProductCategoryRepository instance |
|
68 | - * @var ProductCategoryRepository |
|
69 | - */ |
|
67 | + * The ProductCategoryRepository instance |
|
68 | + * @var ProductCategoryRepository |
|
69 | + */ |
|
70 | 70 | protected ProductCategoryRepository $productCategoryRepository; |
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | 74 | /** |
75 | - * Create new instance |
|
76 | - * @param Lang $lang |
|
77 | - * @param Pagination $pagination |
|
78 | - * @param Template $template |
|
79 | - * @param Flash $flash |
|
80 | - * @param RouteHelper $routeHelper |
|
81 | - * @param LoggerInterface $logger |
|
82 | - * @param ProductCategoryRepository $productCategoryRepository |
|
83 | - */ |
|
75 | + * Create new instance |
|
76 | + * @param Lang $lang |
|
77 | + * @param Pagination $pagination |
|
78 | + * @param Template $template |
|
79 | + * @param Flash $flash |
|
80 | + * @param RouteHelper $routeHelper |
|
81 | + * @param LoggerInterface $logger |
|
82 | + * @param ProductCategoryRepository $productCategoryRepository |
|
83 | + */ |
|
84 | 84 | public function __construct( |
85 | 85 | Lang $lang, |
86 | 86 | Pagination $pagination, |
@@ -100,16 +100,16 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | - * List all entities |
|
104 | - * @param ServerRequestInterface $request |
|
105 | - * @return ResponseInterface |
|
106 | - */ |
|
103 | + * List all entities |
|
104 | + * @param ServerRequestInterface $request |
|
105 | + * @return ResponseInterface |
|
106 | + */ |
|
107 | 107 | public function index(ServerRequestInterface $request): ResponseInterface |
108 | 108 | { |
109 | 109 | $context = []; |
110 | 110 | $param = new RequestData($request); |
111 | 111 | $totalItems = $this->productCategoryRepository->query() |
112 | - ->count('id'); |
|
112 | + ->count('id'); |
|
113 | 113 | |
114 | 114 | $currentPage = (int) $param->get('page', 1); |
115 | 115 | |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
140 | - * List entity detail |
|
141 | - * @param ServerRequestInterface $request |
|
142 | - * @return ResponseInterface |
|
143 | - */ |
|
140 | + * List entity detail |
|
141 | + * @param ServerRequestInterface $request |
|
142 | + * @return ResponseInterface |
|
143 | + */ |
|
144 | 144 | public function detail(ServerRequestInterface $request): ResponseInterface |
145 | 145 | { |
146 | 146 | $context = []; |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | - * Create new entity |
|
170 | - * @param ServerRequestInterface $request |
|
171 | - * @return ResponseInterface |
|
172 | - */ |
|
169 | + * Create new entity |
|
170 | + * @param ServerRequestInterface $request |
|
171 | + * @return ResponseInterface |
|
172 | + */ |
|
173 | 173 | public function create(ServerRequestInterface $request): ResponseInterface |
174 | 174 | { |
175 | 175 | $context = []; |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | $entityExist = $this->productCategoryRepository->findBy([ |
201 | - 'name' => $formParam->getName(), |
|
202 | - ]); |
|
201 | + 'name' => $formParam->getName(), |
|
202 | + ]); |
|
203 | 203 | |
204 | 204 | if ($entityExist !== null) { |
205 | 205 | $this->flash->setError($this->lang->tr('This record already exist')); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | /** @var ProductCategory $category */ |
215 | 215 | $category = $this->productCategoryRepository->create([ |
216 | - 'name' => $formParam->getName(), |
|
216 | + 'name' => $formParam->getName(), |
|
217 | 217 | 'description' => $formParam->getDescription(), |
218 | 218 | ]); |
219 | 219 | |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
242 | - * Update existing entity |
|
243 | - * @param ServerRequestInterface $request |
|
244 | - * @return ResponseInterface |
|
245 | - */ |
|
242 | + * Update existing entity |
|
243 | + * @param ServerRequestInterface $request |
|
244 | + * @return ResponseInterface |
|
245 | + */ |
|
246 | 246 | public function update(ServerRequestInterface $request): ResponseInterface |
247 | 247 | { |
248 | 248 | $context = []; |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | $entityExist = $this->productCategoryRepository->findBy([ |
287 | - 'name' => $formParam->getName(), |
|
288 | - ]); |
|
287 | + 'name' => $formParam->getName(), |
|
288 | + ]); |
|
289 | 289 | |
290 | 290 | if ($entityExist !== null && $entityExist->id !== $id) { |
291 | 291 | $this->flash->setError($this->lang->tr('This record already exist')); |
@@ -322,10 +322,10 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
325 | - * Delete the entity |
|
326 | - * @param ServerRequestInterface $request |
|
327 | - * @return ResponseInterface |
|
328 | - */ |
|
325 | + * Delete the entity |
|
326 | + * @param ServerRequestInterface $request |
|
327 | + * @return ResponseInterface |
|
328 | + */ |
|
329 | 329 | public function delete(ServerRequestInterface $request): ResponseInterface |
330 | 330 | { |
331 | 331 | $id = (int) $request->getAttribute('id'); |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * @class CategoryAction |
26 | 26 | * @package Platine\App\Http\Action\Product |
27 | 27 | */ |
28 | -class CategoryAction |
|
29 | -{ |
|
28 | +class CategoryAction { |
|
30 | 29 | /** |
31 | 30 | * The Lang instance |
32 | 31 | * @var Lang |
@@ -15,22 +15,22 @@ discard block |
||
15 | 15 | class ProductCategoryParam extends BaseParam |
16 | 16 | { |
17 | 17 | /** |
18 | - * The name field |
|
19 | - * @var string |
|
20 | - */ |
|
18 | + * The name field |
|
19 | + * @var string |
|
20 | + */ |
|
21 | 21 | protected string $name; |
22 | 22 | |
23 | 23 | /** |
24 | - * The description field |
|
25 | - * @var string|null |
|
26 | - */ |
|
24 | + * The description field |
|
25 | + * @var string|null |
|
26 | + */ |
|
27 | 27 | protected ?string $description = null; |
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
31 | - * @param TEntity $entity |
|
32 | - * @return $this |
|
33 | - */ |
|
31 | + * @param TEntity $entity |
|
32 | + * @return $this |
|
33 | + */ |
|
34 | 34 | public function fromEntity(Entity $entity): self |
35 | 35 | { |
36 | 36 | $this->name = $entity->name; |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * Return the name value |
|
44 | - * @return string |
|
45 | - */ |
|
43 | + * Return the name value |
|
44 | + * @return string |
|
45 | + */ |
|
46 | 46 | public function getName(): string |
47 | 47 | { |
48 | 48 | return $this->name; |
49 | 49 | } |
50 | 50 | |
51 | - /** |
|
52 | - * Return the description value |
|
53 | - * @return string|null |
|
54 | - */ |
|
51 | + /** |
|
52 | + * Return the description value |
|
53 | + * @return string|null |
|
54 | + */ |
|
55 | 55 | public function getDescription(): ?string |
56 | 56 | { |
57 | 57 | return $this->description; |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | /** |
62 | - * Set the name value |
|
63 | - * @param string $name |
|
64 | - * @return $this |
|
65 | - */ |
|
62 | + * Set the name value |
|
63 | + * @param string $name |
|
64 | + * @return $this |
|
65 | + */ |
|
66 | 66 | public function setName(string $name): self |
67 | 67 | { |
68 | 68 | $this->name = $name; |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | return $this; |
71 | 71 | } |
72 | 72 | |
73 | - /** |
|
74 | - * Set the description value |
|
75 | - * @param string|null $description |
|
76 | - * @return $this |
|
77 | - */ |
|
73 | + /** |
|
74 | + * Set the description value |
|
75 | + * @param string|null $description |
|
76 | + * @return $this |
|
77 | + */ |
|
78 | 78 | public function setDescription(?string $description): self |
79 | 79 | { |
80 | 80 | $this->description = $description; |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * @package Platine\App\Param |
13 | 13 | * @template TEntity as Entity |
14 | 14 | */ |
15 | -class ProductCategoryParam extends BaseParam |
|
16 | -{ |
|
15 | +class ProductCategoryParam extends BaseParam { |
|
17 | 16 | /** |
18 | 17 | * The name field |
19 | 18 | * @var string |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | class ProductCategoryValidator extends AbstractValidator |
20 | 20 | { |
21 | 21 | /** |
22 | - * The parameter instance |
|
23 | - * @var ProductCategoryParam<TEntity> |
|
24 | - */ |
|
22 | + * The parameter instance |
|
23 | + * @var ProductCategoryParam<TEntity> |
|
24 | + */ |
|
25 | 25 | protected ProductCategoryParam $param; |
26 | 26 | |
27 | 27 | /** |
28 | - * Create new instance |
|
29 | - * @param ProductCategoryParam<TEntity> $param |
|
30 | - * @param Lang $lang |
|
31 | - */ |
|
28 | + * Create new instance |
|
29 | + * @param ProductCategoryParam<TEntity> $param |
|
30 | + * @param Lang $lang |
|
31 | + */ |
|
32 | 32 | public function __construct(ProductCategoryParam $param, Lang $lang) |
33 | 33 | { |
34 | 34 | parent::__construct($lang); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * {@inheritdoc} |
|
40 | - */ |
|
39 | + * {@inheritdoc} |
|
40 | + */ |
|
41 | 41 | public function setValidationData(): void |
42 | 42 | { |
43 | 43 | $this->addData('name', $this->param->getName()); |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * {@inheritdoc} |
|
49 | - */ |
|
48 | + * {@inheritdoc} |
|
49 | + */ |
|
50 | 50 | public function setValidationRules(): void |
51 | 51 | { |
52 | 52 | $this->addRules('name', [ |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | * @package Platine\App\Validator |
17 | 17 | * @template TEntity as \Platine\Orm\Entity |
18 | 18 | */ |
19 | -class ProductCategoryValidator extends AbstractValidator |
|
20 | -{ |
|
19 | +class ProductCategoryValidator extends AbstractValidator { |
|
21 | 20 | /** |
22 | 21 | * The parameter instance |
23 | 22 | * @var ProductCategoryParam<TEntity> |
@@ -29,8 +28,7 @@ discard block |
||
29 | 28 | * @param ProductCategoryParam<TEntity> $param |
30 | 29 | * @param Lang $lang |
31 | 30 | */ |
32 | - public function __construct(ProductCategoryParam $param, Lang $lang) |
|
33 | - { |
|
31 | + public function __construct(ProductCategoryParam $param, Lang $lang) { |
|
34 | 32 | parent::__construct($lang); |
35 | 33 | $this->param = $param; |
36 | 34 | } |