Closed githubjeka closed 9 years ago
This code not valid for phpcs:
<?php namespace test; class NEW1 { /** * @inheritdoc */ public function rules() { return [ [['date'], 'date'], [ ['ip_manual'], 'filter', 'filter' => function ($v) { if ($this->operator == 3 || $this->operator == 4) { //here return null; } return $v; } //and here ], ]; } }
PHPCS requires ugly operations from me:
<?php namespace test; class NEW1 { /** * @inheritdoc */ public function rules() { return [ [['date'], 'date'], [ ['ip_manual'], 'filter', 'filter' => function ($v) { if ($this->operator == 3 || $this->operator == 4) { return null; } return $v; } ], ]; } }
I think it's a bug in PHPCS.
This code not valid for phpcs:
PHPCS requires ugly operations from me: