-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
The following code is not being sniffed correctly:
<?php
function test($test)
{
$bar = 'foobar';
$foo = $test ? $bar : (1);
}This is the error:
$ ./vendor/bin/phpcs.bat --standard=vendor/kohana/coding-standards/Kohana -s test.php
Notice: Undefined offset: -1 in C:\work\public_html\kohana_test\vendor\squizlabs\php_codesniffer\CodeSniffer\File.php on line 2665
FILE: C:\work\public_html\kohana_test\test.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
3 | ERROR | Comparisons and operations must be in parentheses in the false
| | value portion of ternary operations
| | (Kohana.Operators.TernaryOperator.TernaryParenthesized)
--------------------------------------------------------------------------------
Time: 0 seconds, Memory: 1.25Mb
The coding standard error also seems to be wrong, but perhaps that's just related to the line number thing?
(I'll dig into this deeper when I've got time... just putting this here now as a reminder, and in case someone smarter than me can tell me where I'm going wrong.)
Thanks!
Metadata
Metadata
Assignees
Labels
No labels