Skip to content

Commit 1a31137

Browse files
committed
Fix code style errors
1 parent 02df8f4 commit 1a31137

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ jobs:
7777
composer require cakephp/cakephp-codesniffer
7878
vendor/bin/phpcs --config-set installed_paths /home/runner/work/cakephp-filter-plugin/cakephp-filter-plugin/vendor/cakephp/cakephp-codesniffer
7979
- name: Run PHPCS
80-
run: vendor/bin/phpcs --colors --parallel=16 -p --standard=CakePHP src/ tests/
80+
run: vendor/bin/phpcs --colors --parallel=16 -p --standard=CakePHP --extensions=php,ctp src/ tests/

src/View/Elements/filter_form_begin.ctp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,30 @@
99
MPL <http://www.mozilla.org/MPL/MPL-1.1.html>
1010
LGPL <http://www.gnu.org/licenses/lgpl.html>
1111
GPL <http://www.gnu.org/licenses/gpl.html>
12-
*/
12+
13+
@var mixed[] $options
14+
@var string $modelName
15+
@var \Cake\View\View $this
16+
*/
17+
1318
?>
1419
<div class="filterForm">
1520
<?php echo $this->Form->create(
1621
false,
1722
array(
1823
'url' => array(
19-
'plugin' => $this->request->params['plugin'],
20-
'controller' => $this->request->params['controller'],
21-
'action' => $this->request->params['action'],
24+
'plugin' => $this->getRequest()->getParam('plugin'),
25+
'controller' => $this->getRequest()->getParam('controller'),
26+
'action' => $this->getRequest()->getParam('action'),
2227
),
2328
'id' => $modelName.'Filter',
2429
) + $options
2530
); ?>
26-
<?php $this->Form->inputDefaults(array('required' => false)); ?>
2731
<fieldset>
2832
<?php
2933
if (isset($options['legend']))
3034
{
3135
?><legend><?php echo $options['legend']; ?></legend><?php
3236
}
3337
?>
34-
<?php echo $this->Form->input('Filter.filterFormId', array('type' => 'hidden', 'value' => $modelName)); ?>
38+
<?php echo $this->Form->control('Filter.filterFormId', array('type' => 'hidden', 'value' => $modelName)); ?>

src/View/Elements/filter_form_end.ctp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
MPL <http://www.mozilla.org/MPL/MPL-1.1.html>
1010
LGPL <http://www.gnu.org/licenses/lgpl.html>
1111
GPL <http://www.gnu.org/licenses/gpl.html>
12+
13+
@var \Cake\View\View $this
1214
*/
1315
?>
1416
</fieldset>

src/View/Elements/filter_form_fields.ctp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
MPL <http://www.mozilla.org/MPL/MPL-1.1.html>
1010
LGPL <http://www.gnu.org/licenses/lgpl.html>
1111
GPL <http://www.gnu.org/licenses/gpl.html>
12+
13+
@var \Cake\View\View $this
1214
*/
1315

1416
if (isset($viewFilterParams))
@@ -21,7 +23,10 @@ if (isset($viewFilterParams))
2123
if (count($fieldName) === 2) {
2224
$field['options']['name'] = sprintf('data[%s][%s]', $fieldName[0], $fieldName[1]);
2325
}
24-
echo $this->Form->input($field['name'], $field['options']);
26+
if (!isset($field['required'])) {
27+
$field['required'] = false;
28+
}
29+
echo $this->Form->control($field['name'], $field['options']);
2530
}
2631
}
2732
}

0 commit comments

Comments
 (0)