ufo-tech / rpc-objects
Component for UFO-Tech RPC Library
Installs: 2 182
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 3
Open Issues: 0
Type:component
Requires
- php: >=8.3
- ext-intl: *
- symfony/http-client: *
- symfony/property-access: *
- symfony/serializer: *
- symfony/validator: ^7.0
- ufo-tech/rpc-exceptions: *
README
Component for UFO-Tech RPC Library
Example DTO with Assertions
namespace App\DTO; use Ufo\RpcObject\DTO\ArrayConstructibleTrait; use Ufo\RpcObject\DTO\ArrayConvertibleTrait; use Ufo\RpcObject\DTO\IArrayConstructible; use Ufo\RpcObject\DTO\IArrayConvertible; use Symfony\Component\Validator\Constraints as Assert; use Ufo\RpcObject\RPC; class CarDTO implements IArrayConvertible, IArrayConstructible { use ArrayConstructibleTrait, ArrayConvertibleTrait; public function __construct( #[RPC\Assertions([new Assert\NotBlank(), new Assert\Length(min: 2, max: 50)])] public string $brand, #[RPC\Assertions([new Assert\NotBlank(), new Assert\Length(min: 1, max: 50)])] public string $model, #[RPC\Assertions([new Assert\Range(min: 1886, max: 2100)])] public int $year, #[RPC\Assertions([new Assert\Range(min: 0)])] public int $mileage = 0 ) {} }