1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 10:17:33 +01:00
psalm/tests/FileManipulation/RedundantCastManipulationTest.php
Matthew Brown f439d6550b
Ensure that all entries in test arrays have explicit keys (#7386)
* Transformation that updates assertions

* Simplify transformation

* Ensure that all tests have keys

* Fix a few remaining keys
2022-01-13 13:49:37 -05:00

48 lines
1.4 KiB
PHP

<?php
namespace Psalm\Tests\FileManipulation;
class RedundantCastManipulationTest extends FileManipulationTestCase
{
/**
* @return array<string,array{input:string,output:string,php_version:string,issues_to_fix:array<string>,safe_types:bool,allow_backwards_incompatible_changes?:bool}>
*/
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,
],
];
}
}