for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ApiPlatform\Core\Documentation;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
/**
* Generates the API documentation.
* @author Amrouche Hamza <[email protected]>
class Documentation
{
private $resourceNameCollection;
private $title;
private $description;
private $version;
private $mimeTypes = [];
public function __construct(string $title = '', string $description = '', string $version = '', array $formats = [])
$this->title = $title;
$this->description = $description;
$this->version = $version;
foreach ($formats as $format => $mimeTypes) {
foreach ($mimeTypes as $mimeType) {
$this->mimeTypes[] = $mimeType;
}
public function create($resourceNameCollection): Documentation {
$this->resourceNameCollection = $resourceNameCollection;
return $this;
public function getMimeTypes(): array
return $this->mimeTypes;
public function getVersion() : string
return $this->version;
public function getDescription(): string
return $this->description;
public function getTitle(): string
return $this->title;
public function getResourceNameCollection(): ResourceNameCollection {
return $this->resourceNameCollection;