PHP code example of savinmikhail / annotate_throws_rector
1. Go to this page and download the library: Download savinmikhail/annotate_throws_rector library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
savinmikhail / annotate_throws_rector example snippets
declare(strict_types=1);
use Rector\Config\RectorConfig;
use SavinMikhail\AnnotateThrowsRector\AnnotateThrowsRector;
return RectorConfig::configure()
->phpstanConfig(__DIR__ . '/phpstan.neon')
->withRules([
AnnotateThrowsRector::class,
]);
final class InterviewRunner
{
public function process(): void
{
$this->normalize();
}
public function normalize(): void
{
throw new \JsonException('Boom');
}
}
final class InterviewRunner
{
/**
* @throws \JsonException
*/
public function process(): void
{
$this->normalize();
}
/**
* @throws \JsonException
*/
public function normalize(): void
{
throw new \JsonException('Boom');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.