mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 01:09:38 +01:00
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Psalm\Tests\FileManipulation;
|
|
|
|
class RedundantCastManipulationTest extends FileManipulationTestCase
|
|
{
|
|
public function providerValidCodeParse(): array
|
|
{
|
|
return [
|
|
'RemoveRedundantCast' => [
|
|
'input' => '<?php
|
|
$test = 1;
|
|
(int)$test;
|
|
',
|
|
'output' => '<?php
|
|
$test = 1;
|
|
$test;
|
|
',
|
|
'php_version' => '5.6',
|
|
'issues_to_fix' => ['RedundantCast'],
|
|
'safe_types' => true,
|
|
],
|
|
'RemoveRedundantCastGivenDocblockType' => [
|
|
'input' => '<?php
|
|
/** @param int $test */
|
|
function a($test){
|
|
(int)$test;
|
|
}
|
|
|
|
',
|
|
'output' => '<?php
|
|
/** @param int $test */
|
|
function a($test){
|
|
$test;
|
|
}
|
|
|
|
',
|
|
'php_version' => '5.6',
|
|
'issues_to_fix' => ['RedundantCastGivenDocblockType'],
|
|
'safe_types' => true,
|
|
],
|
|
];
|
|
}
|
|
}
|