Closed shahlin closed 1 year ago
Hey, I was wondering if the docblocks in Fractal.php can be replaced with typehints. Example:
Fractal.php
Change:
class Fractal implements JsonSerializable { /** @var \League\Fractal\Manager */ protected $manager; /** @var int */ protected $recursionLimit = 10; /** @var string|\League\Fractal\Serializer\SerializerAbstract */ protected $serializer; /** @var string|callable|\League\Fractal\TransformerAbstract */ protected $transformer; /** @var \League\Fractal\Pagination\PaginatorInterface */ protected $paginator; /** @var \League\Fractal\Pagination\CursorInterface */ protected $cursor; /** @var array */ protected $includes = [];
To:
class Fractal implements JsonSerializable { protected Manager $manager; protected int $recursionLimit = 10; /** @var string|\League\Fractal\Serializer\SerializerAbstract */ protected SerializerAbstract $serializer; /** @var string|callable|\League\Fractal\TransformerAbstract */ protected $transformer; protected PaginatorInterface $paginator; protected CursorInterface $cursor; protected array $includes = [];
Would it also make sense to drop PHP 7.4 support for this and add union types where necessary?
Happy to work on the PR for this!
Sure, feel free to send a PR 👍
Hey, I was wondering if the docblocks in
Fractal.php
can be replaced with typehints. Example:Change:
To:
Would it also make sense to drop PHP 7.4 support for this and add union types where necessary?
Happy to work on the PR for this!