Skip to content

Commit

Permalink
Check and showcase new enumOnly() validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 17, 2024
1 parent 26e51f7 commit d4ee56e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/Sandbox/src/Controller/CakeExamplesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function enumValidation() {
if ($this->request->is(['post', 'put'])) {
$user = $table->patchEntity($user, $this->request->getData());

Check failure on line 64 in plugins/Sandbox/src/Controller/CakeExamplesController.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Parameter #1 $entity of method Cake\ORM\Table::patchEntity() expects Cake\Datasource\EntityInterface, Sandbox\Model\Table\SandboxUsersTable given.

Check failure on line 64 in plugins/Sandbox/src/Controller/CakeExamplesController.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Parameter #1 $entity of method Cake\ORM\Table::patchEntity() expects Cake\Datasource\EntityInterface, Sandbox\Model\Table\SandboxUsersTable given.
$value = $this->request->getData('status');
$label = UserStatus::tryFrom((int)$value)->label();
$label = UserStatus::tryFrom((int)$value)?->label();
if (!$user->getErrors()) {

Check failure on line 67 in plugins/Sandbox/src/Controller/CakeExamplesController.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Call to an undefined method Sandbox\Model\Table\SandboxUsersTable::getErrors().

Check failure on line 67 in plugins/Sandbox/src/Controller/CakeExamplesController.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Call to an undefined method Sandbox\Model\Table\SandboxUsersTable::getErrors().
$this->Flash->success('Value posted: `' . $value . '` (`' . $label . '`)');
} else {
Expand Down

0 comments on commit d4ee56e

Please sign in to comment.