-
Notifications
You must be signed in to change notification settings - Fork 51
Extra test scenarios #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 8.2.x
Are you sure you want to change the base?
Extra test scenarios #208
Changes from 1 commit
ee60899
20a0567
9f66c9f
768a777
11c71d8
3d5a35d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
declare(strict_types=1); | ||
|
||
$array = [ | ||
0, | ||
0, // this is the first index | ||
1, | ||
2, | ||
3, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,8 @@ public function c(iterable $foo): void | |
* @deprecated | ||
* | ||
* @link https://example.com | ||
* @see other | ||
* @see Something else and make this see annotation | ||
* multiline | ||
* @uses other | ||
* | ||
* @ORM\Id | ||
|
@@ -67,4 +68,38 @@ public function c(iterable $foo): void | |
public function d(iterable $foo, iterable $bar): iterable | ||
{ | ||
} | ||
|
||
/** | ||
* Description | ||
* More Description | ||
* | ||
* @internal | ||
* @deprecated | ||
* | ||
* @link https://example.com | ||
* @see other | ||
* @uses other | ||
* | ||
* @ORM\Id | ||
* @ORM\Column | ||
* @ODM\Id | ||
* @ODM\Column | ||
* @PHPCR\Uuid | ||
* @PHPCR\Field | ||
* | ||
* @param int[] $foo | ||
* @param int[] $bar | ||
* | ||
* @return int[] | ||
* | ||
* @throws FooException | ||
* @throws BarException | ||
* | ||
* @phpstan-param string $foo | ||
* @psalm-param string $foo | ||
* @phpstan-return true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to handle these? |
||
*/ | ||
public function f(iterable $foo, iterable $bar): iterable | ||
{ | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
namespace Test; | ||
|
||
use function array_map; | ||
use function chop; | ||
use function compact; | ||
use function extract; | ||
|
@@ -28,3 +29,5 @@ | |
extract($bar); | ||
|
||
compact('foo', 'bar'); | ||
|
||
array_map('is_null', ['1', '2', null]); // forbidden function will not be detected | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI codesniffer can not detect these.. is this fine? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
$args = [123, [123], true]; | ||
in_array(...$args); | ||
in_array(...$args); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
$qb->select() | ||
->from() | ||
->where(); | ||
|
||
$qb->select() | ||
->from('mytable'); // we select from my table |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ class FooException extends RuntimeException | |
{ | ||
} | ||
|
||
class FooError extends \Error | ||
{ | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is superfluous but not reported.. i guess there is no existing rule for this |
||
interface FooInterface | ||
{ | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,17 @@ public function uselessIfCondition(): bool | |
return false; | ||
} | ||
|
||
public function uselessIfConditionWithComment(): bool | ||
{ | ||
if ($bar === 'bar') { | ||
// Return true here in case $bar is bar | ||
return true; | ||
} | ||
|
||
// Return true here in case $bar is bar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
return false; | ||
} | ||
|
||
public function uselessNegativeCondition(): bool | ||
{ | ||
if ($foo !== 'foo') { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
declare(strict_types=1); | ||
|
||
$array = [ | ||
0, | ||
0, // this is the first index | ||
1, | ||
2, | ||
3, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
$args = [123, [123], true]; | ||
in_array(...$args); | ||
\in_array(...$args); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ | |
->from() | ||
->where() | ||
; | ||
|
||
$qb->select() | ||
->from('mytable') // we select from my table | ||
; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,8 @@ | |
'key1' => 'value', | ||
'key2' => 'value' | ||
]; | ||
|
||
$arrayWithComment = [ | ||
'key1' => 'value', | ||
'key2' => 'value' // comment | ||
]; |
Uh oh!
There was an error while loading. Please reload this page.