for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <[email protected]>
* @copyright Copyright (c) 2021, Anatoly Nekhay
* @license https://github.com/sunrise-php/hydrator/blob/master/LICENSE
* @link https://github.com/sunrise-php/hydrator
*/
declare(strict_types=1);
namespace Sunrise\Hydrator\Annotation;
use Attribute;
* @Annotation
* @Target({"PROPERTY"})
* @NamedArgumentConstructor
* @Attributes({
* @Attribute("target", type="string", required=true),
* @Attribute("limit", type="integer", required=false),
* })
* @since 3.0.0
#[Attribute(Attribute::TARGET_PROPERTY)]
final class Relationship
{
* @var class-string
class-string
0
public string $target;
* @var int<1, max>|null
public ?int $limit;
* Constructor of the class
* @param class-string $target
* @param int<1, max>|null $limit
public function __construct(string $target, ?int $limit = null)
$this->target = $target;
$this->limit = $limit;
}