for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace gossi\swagger;
use gossi\swagger\parts\ExtensionPart;
use gossi\swagger\parts\UrlPart;
use phootwork\collection\CollectionUtils;
use phootwork\lang\Arrayable;
class License extends AbstractModel implements Arrayable {
use UrlPart;
use ExtensionPart;
/** @var string */
private $name;
public function __construct($contents = []) {
$this->merge($contents);
}
public function merge($contents, $strategy = self::PREFER_ORIGINAL) {
$data = CollectionUtils::toMap($contents);
$this->mergeFields($this->name, $data->get('name'), $strategy);
// extensions
$this->parseUrl($data);
$this->parseExtensions($data);
public function toArray() {
return $this->export('name', 'url');
/**
*
* @return string
*/
public function getName() {
return $this->name;
* @param string $name
* @return $this
public function setName($name) {
$this->name = $name;
return $this;