mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-13 14:42:23 +00:00
fc10fce13d
* 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>
27 lines
764 B
PHP
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());
|
|
}
|
|
}
|