Filip Benčo 9592c7ebfa
Fix nullable array properties (#1697)
* Fix nullable array properties

* Fix tests & Remove weird leftover dump

* Fix test

Co-authored-by: Filip Benčo <filip.benco@websupport.sk>
2020-08-06 10:22:59 +02:00

182 lines
3.0 KiB
PHP

<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
use OpenApi\Annotations as OA;
/**
* @author Guilhem N. <egetick@gmail.com>
*/
class User
{
/**
* @var int
*
* @OA\Property(description = "User id", readOnly = true, title = "userid", default = null)
*/
private $id;
/**
* @OA\Property(type="string", readOnly = false)
*/
private $email;
/**
* User Roles Comment.
*
* @var string[]
*
* @OA\Property(
* description = "User roles",
* title = "roles",
* example="[""ADMIN"",""SUPERUSER""]",
* default = {"user"},
* )
*/
private $roles;
/**
* User Location.
*
* @OA\Property(type = "string")
*/
private $location;
/**
* @var int
*
* @OA\Property(type = "string")
*/
private $friendsNumber;
/**
* @var float
* @OA\Property(default = 0.0)
*/
private $money;
/**
* @var \DateTime
* @OA\Property(property="creationDate")
*/
private $createdAt;
/**
* @var User[]
*/
private $users;
/**
* @var User|null
*/
private $friend;
/**
* @var User[]|null
*/
private $friends;
/**
* @var string
*
* @OA\Property(enum = {"disabled", "enabled"})
*/
private $status;
/**
* @var \DateTimeInterface
*/
private $dateAsInterface;
/**
* @param float $money
*/
public function setMoney(float $money)
{
$this->money = $money;
}
/**
* @param int $id
* @OA\Property(example=1)
*/
public function setId(int $id)
{
$this->id = $id;
}
public function setEmail($email)
{
$this->email = $email;
}
/**
* @param string[] $roles
*/
public function setRoles(array $roles)
{
$this->roles = $roles;
}
public function setLocation(string $location)
{
}
/**
* @param int $friendsNumber
*/
public function setFriendsNumber(int $friendsNumber)
{
$this->friendsNumber = $friendsNumber;
}
public function setCreatedAt(\DateTime $createAt)
{
}
public function setUsers(array $users)
{
}
public function setFriend(self $friend = null)
{
}
public function setFriends(array $friends = [])
{
}
public function setDummy(Dummy $dummy)
{
}
public function setStatus(string $status)
{
}
/**
* @return \DateTimeInterface
*/
public function getDateAsInterface(): \DateTimeInterface
{
return $this->dateAsInterface;
}
/**
* @param \DateTimeInterface $dateAsInterface
*/
public function setDateAsInterface(\DateTimeInterface $dateAsInterface)
{
$this->dateAsInterface = $dateAsInterface;
}
}