mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
More phpstan checks for better code
This commit is contained in:
@@ -10,7 +10,10 @@ use phpDocumentor\Reflection\FqsenResolver;
|
||||
|
||||
final class CustomParam implements Tag
|
||||
{
|
||||
/** @var string|null */
|
||||
public $myParam;
|
||||
|
||||
/** @var FqsenResolver|null */
|
||||
public $fqsenResolver;
|
||||
|
||||
public function getName() : string
|
||||
@@ -18,7 +21,7 @@ final class CustomParam implements Tag
|
||||
return 'spy';
|
||||
}
|
||||
|
||||
public static function create($body, FqsenResolver $fqsenResolver = null, ?string $myParam = null)
|
||||
public static function create(string $body, FqsenResolver $fqsenResolver = null, ?string $myParam = null)
|
||||
{
|
||||
$tag = new self();
|
||||
$tag->fqsenResolver = $fqsenResolver;
|
||||
|
||||
@@ -7,11 +7,10 @@ namespace phpDocumentor\Reflection\Assets;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Formatter;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
|
||||
use phpDocumentor\Reflection\FqsenResolver;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod;
|
||||
|
||||
final class CustomServiceClass implements Tag
|
||||
{
|
||||
/** @var Formatter|null */
|
||||
public $formatter;
|
||||
|
||||
public function getName() : string
|
||||
@@ -19,7 +18,7 @@ final class CustomServiceClass implements Tag
|
||||
return 'spy';
|
||||
}
|
||||
|
||||
public static function create($body, PassthroughFormatter $formatter = null)
|
||||
public static function create(string $body, PassthroughFormatter $formatter = null)
|
||||
{
|
||||
$tag = new self();
|
||||
$tag->formatter = $formatter;
|
||||
|
||||
@@ -11,6 +11,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod;
|
||||
|
||||
final class CustomServiceInterface implements Tag
|
||||
{
|
||||
/** @var Formatter|null */
|
||||
public $formatter;
|
||||
|
||||
public function getName() : string
|
||||
@@ -18,7 +19,7 @@ final class CustomServiceInterface implements Tag
|
||||
return 'spy';
|
||||
}
|
||||
|
||||
public static function create($body, Formatter $formatter = null)
|
||||
public static function create(string $body, Formatter $formatter = null)
|
||||
{
|
||||
$tag = new self();
|
||||
$tag->formatter = $formatter;
|
||||
|
||||
@@ -20,6 +20,7 @@ use phpDocumentor\Reflection\Types\Context;
|
||||
|
||||
class CustomTagFactory implements Factory
|
||||
{
|
||||
/** @var CustomServiceClass|null */
|
||||
public $class;
|
||||
|
||||
public function create(string $tagLine, ?Context $context = null, CustomServiceClass $class = null): Tag
|
||||
|
||||
Reference in New Issue
Block a user