Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Nov 29, 2023
1 parent bb45379 commit fbc429d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/schema-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ final class Types
return self::$types[$typeName] ??= new $className;
}

/** @return \Closure(): Type&NamedType */
/** @return \Closure(): (Type&NamedType) */
private static function lazyByClassName(string $className): \Closure
{
return static fn () => self::byClassName($className);
Expand Down
8 changes: 6 additions & 2 deletions examples/01-blog/Blog/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public static function load(string $typeName): Type
return self::$types[$typeName] = $type;
}

/** @param class-string<Type&NamedType> $className */
/**
* @param class-string<Type&NamedType> $className
*
* @return Type&NamedType
*/
private static function byClassName(string $className): Type
{
$parts = \explode('\\', $className);
Expand All @@ -76,7 +80,7 @@ private static function byClassName(string $className): Type
/**
* @param class-string<Type&NamedType> $classname
*
* @return \Closure(): Type&NamedType
* @return \Closure(): (Type&NamedType)
*/
private static function lazyByClassName(string $classname): \Closure
{
Expand Down

0 comments on commit fbc429d

Please sign in to comment.