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 = [];
/**
* @phpstan-template TEvent of Event
* @phpstan-param class-string<TEvent> $class
* @phpstan-param class-string<covariant Event> $class
*/
public function __construct(
private string $class,

View File

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

View File

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