File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,6 @@ parameters:
108108 count : 1
109109 path : src/Controller/DevelopersController.php
110110
111- -
112- message : ' #^Method `redirect\(\)` must be used to prevent unreachable code\. Use `return \$this\-\>redirect\(\)` or assign it to a variable\.$#'
113- identifier : cake.controller.redirectMustBeUsed
114- count : 1
115- path : src/Controller/DevelopersController.php
116-
117111 -
118112 message : ' #^Parameter \#1 \$payload of method App\\Controller\\EventsController\:\:getHash\(\) expects string, string\|false given\.$#'
119113 identifier : argument.type
Original file line number Diff line number Diff line change @@ -134,16 +134,19 @@ protected function isWriteAccessRequired(ServerRequest $request): bool
134134
135135 // Check for the controller name
136136 if (! isset (self ::READ_ONLY_ACCESS_CONTROL_LIST [$ controllerName ])) {
137- // Not public
138- return false ;
137+ return false ;// The controller is not in the list
139138 }
140139
141140 // Require for all actions ?
142141 if (self ::READ_ONLY_ACCESS_CONTROL_LIST [$ controllerName ] === '* ' ) {
143- return true ;
142+ return true ;// Needs write access
144143 }
145144
146145 // Check for the specific action name
147- return in_array ($ action , self ::READ_ONLY_ACCESS_CONTROL_LIST [$ controllerName ]);
146+ if (in_array ($ action , self ::READ_ONLY_ACCESS_CONTROL_LIST [$ controllerName ])) {// phpcs:ignore SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn.UselessIfCondition
147+ return true ;// Needs write access
148+ }
149+
150+ return false ;// phpcs:ignore SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn.UselessIfCondition
148151 }
149152}
You can’t perform that action at this time.
0 commit comments