-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#3372Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 0.15.1 |
| PHP version | 7.4.30 |
| Applied rules | RenameClassRector, TypedPropertyFromAssignsRector |
<?php
declare(strict_types=1);
namespace Tests;
use DateTime;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
/**
* @var DateTime&MockObject
*/
private $property;
public function testExample(): void
{
$this->property = $this->createMock(DateTime::class);
$this->property->expects(self::once())->method('format');
$this->property->format('Y');
}
}
Current modification
- /**
- * @var DateTime&MockObject
- */
- private $property;
+ private ?MockObject $property = null;
Expected Behaviour
Rector should not change this file with this rules
Reactions are currently unavailable