for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace ReliQArts\Docweaver\Exceptions;
use ReliQArts\Docweaver\Contracts\Exception as ExceptionContract;
final class ParsingFailed extends Exception
{
private const CODE = 1004;
/**
* @var null|string
*/
private $failedFile;
* @param string $file
* @param ExceptionContract $previous
$previous
null|ExceptionContract
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
*
* @return ExceptionContract
public static function forFile(string $file, ExceptionContract $previous = null): ExceptionContract
$message = sprintf('Failed to parse file `%s`.', $file);
$self = new self($message, self::CODE, $previous);
$self->failedFile = $file;
return $self;
}
* Get the file which parsing failed for.
* @return null|string
public function getFailedFile(): ?string
return $this->failedFile;
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.