Skip to content

Commit d9859d5

Browse files
committed
add magic fixture
1 parent bca109c commit d9859d5

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Source\SomeClassWithSetter;
7+
8+
final class SkipDocblockType extends TestCase
9+
{
10+
public function test()
11+
{
12+
$someClassWithSetter = new SomeClassWithSetter();
13+
$someClassWithSetter->setMagicType(123456);
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\ScalarArgumentToExpectedParamTypeRector\Source\SomeClassWithSetter;
7+
8+
final class SkipUnionType extends TestCase
9+
{
10+
public function test()
11+
{
12+
$someClassWithSetter = new SomeClassWithSetter();
13+
$someClassWithSetter->setUnionType(123456);
14+
}
15+
}

rules-tests/CodeQuality/Rector/MethodCall/ScalarArgumentToExpectedParamTypeRector/Source/SomeClassWithSetter.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,17 @@ final class SomeClassWithSetter
99
public function setPhoneNumber(string $phoneNumber)
1010
{
1111
}
12+
13+
/**
14+
* @param string $passportId
15+
*/
16+
public function setMagicType($passportId)
17+
{
18+
19+
}
20+
21+
public function setUnionType(int|string $unionValue)
22+
{
23+
24+
}
1225
}

0 commit comments

Comments
 (0)