PHP code example of dawen / api-doc-property-bundle
1. Go to this page and download the library: Download dawen/api-doc-property-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dawen / api-doc-property-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Dawen\Bundle\ApiDocPropertyBundle\ApiDocPropertyBundle(),
);
}
@ApiDocProperty(type="string")
namespace Dawen\Bundle\ApiDocPropertyBundle;
use Dawen\Bundle\ApiDocPropertyBundle\Component\Annotation\ApiDocProperty;
class Dummy
{
/**
* @ApiDocProperty(type="string")
* @var string
*/
private $firstName;
/**
* @ApiDocProperty(type="string")
* @var string
*/
private $lastName;
/**
* @ApiDocProperty(type="int")
* @var int
*/
private $age = 0;
/**
* @ApiDocProperty(type="Dawen\Bundle\ApiDocPropertyBundle\Address")
* @var Dawen\Bundle\ApiDocPropertyBundle\Address
*/
private $address;
/**
* @ApiDocProperty(type="array<Dawen\Bundle\ApiDocPropertyBundle\Key>")
* @var array
*/
private $keys = [];
/**
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string $firstName
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
}
/**
* @return string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string $lastName
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
}
/**
* @return int
*/
public function getAge()
{
return $this->age;
}
/**
* @param int $age
*/
public function setAge($age)
{
$this->age = $age;
}
/**
* @return Dawen\Bundle\ApiDocPropertyBundle\Address
*/
public function getAddress()
{
return $this->address;
}
/**
* @param Dawen\Bundle\ApiDocPropertyBundle\Address $address
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return array
*/
public function getKeys()
{
return $this->keys;
}
/**
* @param array $keys
*/
public function setKeys($keys)
{
$this->keys = $keys;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.