Modernize single-use phpstan-template tags

This commit is contained in:
Dylan K. Taylor 2023-12-20 15:20:28 +00:00
parent 8dc28b7ea8
commit 80125f9b19
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 5 additions and 10 deletions

View File

@ -37,8 +37,7 @@ class HandlerList{
private array $affectedHandlerCaches = []; private array $affectedHandlerCaches = [];
/** /**
* @phpstan-template TEvent of Event * @phpstan-param class-string<covariant Event> $class
* @phpstan-param class-string<TEvent> $class
*/ */
public function __construct( public function __construct(
private string $class, private string $class,

View File

@ -86,8 +86,7 @@ class HandlerListManager{
* *
* Calling this method also lazily initializes the $classMap inheritance tree of handler lists. * Calling this method also lazily initializes the $classMap inheritance tree of handler lists.
* *
* @phpstan-template TEvent of Event * @phpstan-param class-string<covariant Event> $event
* @phpstan-param class-string<TEvent> $event
* *
* @throws \ReflectionException * @throws \ReflectionException
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
@ -113,8 +112,7 @@ class HandlerListManager{
} }
/** /**
* @phpstan-template TEvent of Event * @phpstan-param class-string<covariant Event> $event
* @phpstan-param class-string<TEvent> $event
* *
* @return RegisteredListener[] * @return RegisteredListener[]
*/ */

View File

@ -210,8 +210,7 @@ abstract class Timings{
} }
/** /**
* @phpstan-template T of object * @phpstan-param class-string<covariant object> $class
* @phpstan-param class-string<T> $class
*/ */
private static function shortenCoreClassName(string $class, string $prefix) : string{ private static function shortenCoreClassName(string $class, string $prefix) : string{
if(str_starts_with($class, $prefix)){ if(str_starts_with($class, $prefix)){
@ -302,8 +301,7 @@ abstract class Timings{
} }
/** /**
* @phpstan-template TEvent of Event * @phpstan-param class-string<covariant Event> $event
* @phpstan-param class-string<TEvent> $event
*/ */
public static function getEventHandlerTimings(string $event, string $handlerName, string $group) : TimingsHandler{ public static function getEventHandlerTimings(string $event, string $handlerName, string $group) : TimingsHandler{
if(!isset(self::$eventHandlers[$event][$handlerName])){ if(!isset(self::$eventHandlers[$event][$handlerName])){