rector/packages/ChangesReporting/ValueObjectFactory/ErrorFactory.php
Abdul Malik Ikhsan fc10fce13d
[Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
* re-enable rectify and ecs

* [Rectify] [Php81] Enable Rectify on Readonly Property only

* comment

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2021-12-04 15:32:52 +03:00

27 lines
764 B
PHP

<?php
declare(strict_types=1);
namespace Rector\ChangesReporting\ValueObjectFactory;
use PHPStan\AnalysedCodeException;
use Rector\Core\Error\ExceptionCorrector;
use Rector\Core\ValueObject\Application\RectorError;
use Symplify\SmartFileSystem\SmartFileInfo;
final class ErrorFactory
{
public function __construct(
private readonly ExceptionCorrector $exceptionCorrector
) {
}
public function createAutoloadError(
AnalysedCodeException $analysedCodeException,
SmartFileInfo $smartFileInfo
): RectorError {
$message = $this->exceptionCorrector->getAutoloadExceptionMessageAndAddLocation($analysedCodeException);
return new RectorError($message, $smartFileInfo->getRelativeFilePathFromCwd());
}
}