@@ -14,44 +14,44 @@ |
||
| 14 | 14 | class ExternalDocumentation extends AbstractObject |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - private $url; |
|
| 18 | - private $description; |
|
| 19 | - |
|
| 20 | - public function __construct(AbstractObject $parent, $url, $description = null) |
|
| 21 | - { |
|
| 22 | - parent::__construct($parent); |
|
| 23 | - $this->url = $url; |
|
| 24 | - $this->description = $description; |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * @param string $command |
|
| 29 | - * @param string $data |
|
| 30 | - * @return AbstractObject|boolean |
|
| 31 | - */ |
|
| 32 | - public function handleCommand($command, $data = null) |
|
| 33 | - { |
|
| 34 | - switch (strtolower($command)) { |
|
| 35 | - case 'url': |
|
| 36 | - case 'description': |
|
| 37 | - $this->$command = $data; |
|
| 38 | - return $this; |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - return parent::handleCommand($command, $data); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - public function toArray(): array |
|
| 45 | - { |
|
| 46 | - return self::arrayFilterNull(array_merge(array( |
|
| 47 | - 'url' => $this->url, |
|
| 48 | - 'description' => empty($this->description) ? null : $this->description, |
|
| 49 | - ), parent::toArray())); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - public function __toString() |
|
| 53 | - { |
|
| 54 | - return __CLASS__ . ' ' . $this->url; |
|
| 55 | - } |
|
| 17 | + private $url; |
|
| 18 | + private $description; |
|
| 19 | + |
|
| 20 | + public function __construct(AbstractObject $parent, $url, $description = null) |
|
| 21 | + { |
|
| 22 | + parent::__construct($parent); |
|
| 23 | + $this->url = $url; |
|
| 24 | + $this->description = $description; |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @param string $command |
|
| 29 | + * @param string $data |
|
| 30 | + * @return AbstractObject|boolean |
|
| 31 | + */ |
|
| 32 | + public function handleCommand($command, $data = null) |
|
| 33 | + { |
|
| 34 | + switch (strtolower($command)) { |
|
| 35 | + case 'url': |
|
| 36 | + case 'description': |
|
| 37 | + $this->$command = $data; |
|
| 38 | + return $this; |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + return parent::handleCommand($command, $data); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + public function toArray(): array |
|
| 45 | + { |
|
| 46 | + return self::arrayFilterNull(array_merge(array( |
|
| 47 | + 'url' => $this->url, |
|
| 48 | + 'description' => empty($this->description) ? null : $this->description, |
|
| 49 | + ), parent::toArray())); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + public function __toString() |
|
| 53 | + { |
|
| 54 | + return __CLASS__ . ' ' . $this->url; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |
@@ -16,82 +16,82 @@ |
||
| 16 | 16 | class Property extends AbstractObject |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Description of this property |
|
| 21 | - * @var string |
|
| 22 | - */ |
|
| 23 | - private $description; |
|
| 19 | + /** |
|
| 20 | + * Description of this property |
|
| 21 | + * @var string |
|
| 22 | + */ |
|
| 23 | + private $description; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Whether property is read only |
|
| 27 | - * @var bool |
|
| 28 | - */ |
|
| 29 | - private $readOnly; |
|
| 25 | + /** |
|
| 26 | + * Whether property is read only |
|
| 27 | + * @var bool |
|
| 28 | + */ |
|
| 29 | + private $readOnly; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Type definition of this property |
|
| 33 | - * @var AbstractType |
|
| 34 | - */ |
|
| 35 | - private $Type; |
|
| 31 | + /** |
|
| 32 | + * Type definition of this property |
|
| 33 | + * @var AbstractType |
|
| 34 | + */ |
|
| 35 | + private $Type; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Create a new property |
|
| 39 | - * @param AbstractObject $parent |
|
| 40 | - * @param string $definition Either a built-in type or a definition name |
|
| 41 | - * @param string $description description of the property |
|
| 42 | - * @param bool $readOnly Whether the property is read only |
|
| 43 | - * @throws Exception |
|
| 44 | - */ |
|
| 45 | - public function __construct(AbstractObject $parent, $definition, $description = null, $readOnly = null) |
|
| 46 | - { |
|
| 47 | - parent::__construct($parent); |
|
| 48 | - $this->Type = AbstractType::typeFactory($this, $definition, "Not a property: '%s'"); |
|
| 49 | - $this->description = $description; |
|
| 50 | - $this->readOnly = $readOnly; |
|
| 51 | - } |
|
| 37 | + /** |
|
| 38 | + * Create a new property |
|
| 39 | + * @param AbstractObject $parent |
|
| 40 | + * @param string $definition Either a built-in type or a definition name |
|
| 41 | + * @param string $description description of the property |
|
| 42 | + * @param bool $readOnly Whether the property is read only |
|
| 43 | + * @throws Exception |
|
| 44 | + */ |
|
| 45 | + public function __construct(AbstractObject $parent, $definition, $description = null, $readOnly = null) |
|
| 46 | + { |
|
| 47 | + parent::__construct($parent); |
|
| 48 | + $this->Type = AbstractType::typeFactory($this, $definition, "Not a property: '%s'"); |
|
| 49 | + $this->description = $description; |
|
| 50 | + $this->readOnly = $readOnly; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @param string $command The comment command |
|
| 55 | - * @param string $data Any data added after the command |
|
| 56 | - * @return self|boolean |
|
| 57 | - * @throws Exception |
|
| 58 | - */ |
|
| 59 | - public function handleCommand($command, $data = null) |
|
| 60 | - { |
|
| 61 | - // Pass through to Type |
|
| 62 | - if ($this->Type && $this->Type->handleCommand($command, $data)) { |
|
| 63 | - return $this; |
|
| 64 | - } |
|
| 53 | + /** |
|
| 54 | + * @param string $command The comment command |
|
| 55 | + * @param string $data Any data added after the command |
|
| 56 | + * @return self|boolean |
|
| 57 | + * @throws Exception |
|
| 58 | + */ |
|
| 59 | + public function handleCommand($command, $data = null) |
|
| 60 | + { |
|
| 61 | + // Pass through to Type |
|
| 62 | + if ($this->Type && $this->Type->handleCommand($command, $data)) { |
|
| 63 | + return $this; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - return parent::handleCommand($command, $data); |
|
| 67 | - } |
|
| 66 | + return parent::handleCommand($command, $data); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - public function toArray(): array |
|
| 70 | - { |
|
| 71 | - // Reference + readonly/description result in allOf construct |
|
| 72 | - // as it's semantically the same and that's what swagger tools |
|
| 73 | - // like swagger-ui can understand |
|
| 74 | - $requiresWrap = |
|
| 75 | - $this->Type instanceof ReferenceObjectType |
|
| 76 | - && (!empty($this->description) || !is_null($this->readOnly)); |
|
| 69 | + public function toArray(): array |
|
| 70 | + { |
|
| 71 | + // Reference + readonly/description result in allOf construct |
|
| 72 | + // as it's semantically the same and that's what swagger tools |
|
| 73 | + // like swagger-ui can understand |
|
| 74 | + $requiresWrap = |
|
| 75 | + $this->Type instanceof ReferenceObjectType |
|
| 76 | + && (!empty($this->description) || !is_null($this->readOnly)); |
|
| 77 | 77 | |
| 78 | - $valueType = $this->Type->toArray(); |
|
| 78 | + $valueType = $this->Type->toArray(); |
|
| 79 | 79 | |
| 80 | - if ($requiresWrap) { |
|
| 81 | - $valueType = array( |
|
| 82 | - 'allOf' => array($valueType), |
|
| 83 | - ); |
|
| 84 | - } |
|
| 80 | + if ($requiresWrap) { |
|
| 81 | + $valueType = array( |
|
| 82 | + 'allOf' => array($valueType), |
|
| 83 | + ); |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - return self::arrayFilterNull(array_merge($valueType, array( |
|
| 87 | - 'description' => empty($this->description) ? null : $this->description, |
|
| 88 | - 'readOnly' => $this->readOnly |
|
| 89 | - ), parent::toArray())); |
|
| 90 | - } |
|
| 86 | + return self::arrayFilterNull(array_merge($valueType, array( |
|
| 87 | + 'description' => empty($this->description) ? null : $this->description, |
|
| 88 | + 'readOnly' => $this->readOnly |
|
| 89 | + ), parent::toArray())); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - public function __toString() |
|
| 93 | - { |
|
| 94 | - return __CLASS__; |
|
| 95 | - } |
|
| 92 | + public function __toString() |
|
| 93 | + { |
|
| 94 | + return __CLASS__; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | 97 | } |
@@ -13,47 +13,47 @@ |
||
| 13 | 13 | class Tag extends AbstractDocumentableObject |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - private $name; |
|
| 17 | - private $description; |
|
| 18 | - |
|
| 19 | - public function __construct(AbstractObject $parent, $name, $description = null) |
|
| 20 | - { |
|
| 21 | - parent::__construct($parent); |
|
| 22 | - $this->name = $name; |
|
| 23 | - $this->description = $description; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * @param string $command |
|
| 28 | - * @param string $data |
|
| 29 | - * @return AbstractObject|boolean |
|
| 30 | - */ |
|
| 31 | - public function handleCommand($command, $data = null) |
|
| 32 | - { |
|
| 33 | - if (strtolower($command) === 'description') { |
|
| 34 | - $this->description = $data; |
|
| 35 | - return $this; |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - return parent::handleCommand($command, $data); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function toArray(): array |
|
| 42 | - { |
|
| 43 | - return self::arrayFilterNull(array_merge(array( |
|
| 44 | - 'name' => $this->name, |
|
| 45 | - 'description' => empty($this->description) ? null : $this->description, |
|
| 46 | - ), parent::toArray())); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - public function getName() |
|
| 50 | - { |
|
| 51 | - return $this->name; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - public function __toString() |
|
| 55 | - { |
|
| 56 | - return __CLASS__ . ' ' . $this->name; |
|
| 57 | - } |
|
| 16 | + private $name; |
|
| 17 | + private $description; |
|
| 18 | + |
|
| 19 | + public function __construct(AbstractObject $parent, $name, $description = null) |
|
| 20 | + { |
|
| 21 | + parent::__construct($parent); |
|
| 22 | + $this->name = $name; |
|
| 23 | + $this->description = $description; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * @param string $command |
|
| 28 | + * @param string $data |
|
| 29 | + * @return AbstractObject|boolean |
|
| 30 | + */ |
|
| 31 | + public function handleCommand($command, $data = null) |
|
| 32 | + { |
|
| 33 | + if (strtolower($command) === 'description') { |
|
| 34 | + $this->description = $data; |
|
| 35 | + return $this; |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + return parent::handleCommand($command, $data); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function toArray(): array |
|
| 42 | + { |
|
| 43 | + return self::arrayFilterNull(array_merge(array( |
|
| 44 | + 'name' => $this->name, |
|
| 45 | + 'description' => empty($this->description) ? null : $this->description, |
|
| 46 | + ), parent::toArray())); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + public function getName() |
|
| 50 | + { |
|
| 51 | + return $this->name; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + public function __toString() |
|
| 55 | + { |
|
| 56 | + return __CLASS__ . ' ' . $this->name; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | } |
@@ -15,50 +15,50 @@ |
||
| 15 | 15 | class Header extends AbstractObject |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - private $type; |
|
| 19 | - private $description; |
|
| 18 | + private $type; |
|
| 19 | + private $description; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * @throws Exception |
|
| 23 | - */ |
|
| 24 | - public function __construct(AbstractObject $parent, $type, $description = null) |
|
| 25 | - { |
|
| 26 | - parent::__construct($parent); |
|
| 21 | + /** |
|
| 22 | + * @throws Exception |
|
| 23 | + */ |
|
| 24 | + public function __construct(AbstractObject $parent, $type, $description = null) |
|
| 25 | + { |
|
| 26 | + parent::__construct($parent); |
|
| 27 | 27 | |
| 28 | - $this->type = strtolower($type); |
|
| 29 | - if (!in_array($this->type, array('string', 'number', 'integer', 'boolean', 'array'))) { |
|
| 30 | - throw new Exception('Header type not valid: \'' . $type . '\''); |
|
| 31 | - } |
|
| 28 | + $this->type = strtolower($type); |
|
| 29 | + if (!in_array($this->type, array('string', 'number', 'integer', 'boolean', 'array'))) { |
|
| 30 | + throw new Exception('Header type not valid: \'' . $type . '\''); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - $this->description = $description; |
|
| 34 | - } |
|
| 33 | + $this->description = $description; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @param string $command |
|
| 38 | - * @param string $data |
|
| 39 | - * @return AbstractObject|boolean |
|
| 40 | - */ |
|
| 41 | - public function handleCommand($command, $data = null) |
|
| 42 | - { |
|
| 43 | - if (strtolower($command) === 'description') { |
|
| 44 | - $this->description = $data; |
|
| 45 | - return $this; |
|
| 46 | - } |
|
| 36 | + /** |
|
| 37 | + * @param string $command |
|
| 38 | + * @param string $data |
|
| 39 | + * @return AbstractObject|boolean |
|
| 40 | + */ |
|
| 41 | + public function handleCommand($command, $data = null) |
|
| 42 | + { |
|
| 43 | + if (strtolower($command) === 'description') { |
|
| 44 | + $this->description = $data; |
|
| 45 | + return $this; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - return parent::handleCommand($command, $data); |
|
| 49 | - } |
|
| 48 | + return parent::handleCommand($command, $data); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - public function toArray(): array |
|
| 52 | - { |
|
| 53 | - return self::arrayFilterNull(array_merge(array( |
|
| 54 | - 'type' => $this->type, |
|
| 55 | - 'description' => empty($this->description) ? null : $this->description, |
|
| 56 | - ), parent::toArray())); |
|
| 57 | - } |
|
| 51 | + public function toArray(): array |
|
| 52 | + { |
|
| 53 | + return self::arrayFilterNull(array_merge(array( |
|
| 54 | + 'type' => $this->type, |
|
| 55 | + 'description' => empty($this->description) ? null : $this->description, |
|
| 56 | + ), parent::toArray())); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - public function __toString() |
|
| 60 | - { |
|
| 61 | - return __CLASS__ . ' ' . $this->type; |
|
| 62 | - } |
|
| 59 | + public function __toString() |
|
| 60 | + { |
|
| 61 | + return __CLASS__ . ' ' . $this->type; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | } |
@@ -13,25 +13,25 @@ |
||
| 13 | 13 | class ResponseReference extends AbstractObject |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - private $reference; |
|
| 17 | - |
|
| 18 | - public function __construct(AbstractObject $parent, $reference) |
|
| 19 | - { |
|
| 20 | - parent::__construct($parent); |
|
| 21 | - |
|
| 22 | - $this->reference = $reference; |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - public function toArray(): array |
|
| 26 | - { |
|
| 27 | - return self::arrayFilterNull(array( |
|
| 28 | - '$ref' => '#/responses/' . $this->reference, |
|
| 29 | - )); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public function __toString() |
|
| 33 | - { |
|
| 34 | - return __CLASS__ . ' `' . $this->reference . '`'; |
|
| 35 | - } |
|
| 16 | + private $reference; |
|
| 17 | + |
|
| 18 | + public function __construct(AbstractObject $parent, $reference) |
|
| 19 | + { |
|
| 20 | + parent::__construct($parent); |
|
| 21 | + |
|
| 22 | + $this->reference = $reference; |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + public function toArray(): array |
|
| 26 | + { |
|
| 27 | + return self::arrayFilterNull(array( |
|
| 28 | + '$ref' => '#/responses/' . $this->reference, |
|
| 29 | + )); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + public function __toString() |
|
| 33 | + { |
|
| 34 | + return __CLASS__ . ' `' . $this->reference . '`'; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | 37 | } |
@@ -14,94 +14,94 @@ |
||
| 14 | 14 | class License extends AbstractObject |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - // @todo make this a separate resource file? (licenseUrls.json) |
|
| 18 | - private static $licenses = array( |
|
| 19 | - 'artistic-1.0' => 'http://opensource.org/licenses/artistic-license-1.0', |
|
| 20 | - 'artistic-1' => 'http://opensource.org/licenses/artistic-license-1.0', |
|
| 21 | - 'artistic-2.0' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 22 | - 'artistic-2' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 23 | - 'artistic' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 24 | - 'bsd-new' => 'https://opensource.org/licenses/BSD-3-Clause', |
|
| 25 | - 'bsd-3' => 'https://opensource.org/licenses/BSD-3-Clause', |
|
| 26 | - 'bsd-2' => 'https://opensource.org/licenses/BSD-2-Clause', |
|
| 27 | - 'bsd' => 'https://opensource.org/licenses/BSD-2-Clause', |
|
| 28 | - 'epl-1.0' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 29 | - 'epl-1' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 30 | - 'epl' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 31 | - 'apache-2.0' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 32 | - 'apache-2' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 33 | - 'apache' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 34 | - 'gpl-1.0' => 'https://www.gnu.org/licenses/gpl-1.0.html', |
|
| 35 | - 'gpl-1' => 'https://www.gnu.org/licenses/gpl-1.0.html', |
|
| 36 | - 'gpl-2.0' => 'https://www.gnu.org/licenses/gpl-2.0.html', |
|
| 37 | - 'gpl-2' => 'https://www.gnu.org/licenses/gpl-2.0.html', |
|
| 38 | - 'gpl-3.0' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 39 | - 'gpl-3' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 40 | - 'gpl' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 41 | - 'lgpl-2.0' => 'http://www.gnu.org/licenses/lgpl-2.0.html', |
|
| 42 | - 'lgpl-2.1' => 'http://www.gnu.org/licenses/lgpl-2.1.html', |
|
| 43 | - 'lgpl-2' => 'http://www.gnu.org/licenses/lgpl-2.1.html', |
|
| 44 | - 'lgpl-3.0' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 45 | - 'lgpl-3' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 46 | - 'lgpl' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 47 | - 'mit' => 'http://opensource.org/licenses/MIT', |
|
| 48 | - 'mpl-1.1' => 'https://www.mozilla.org/en-US/MPL/1.1/', |
|
| 49 | - 'mpl-1' => 'https://www.mozilla.org/en-US/MPL/1.1/', |
|
| 50 | - 'mpl-2.0' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 51 | - 'mpl-2' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 52 | - 'mpl' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 53 | - 'mspl' => 'https://msdn.microsoft.com/en-us/library/ff648068.aspx', |
|
| 54 | - ); |
|
| 55 | - private $name; |
|
| 56 | - private $url; |
|
| 17 | + // @todo make this a separate resource file? (licenseUrls.json) |
|
| 18 | + private static $licenses = array( |
|
| 19 | + 'artistic-1.0' => 'http://opensource.org/licenses/artistic-license-1.0', |
|
| 20 | + 'artistic-1' => 'http://opensource.org/licenses/artistic-license-1.0', |
|
| 21 | + 'artistic-2.0' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 22 | + 'artistic-2' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 23 | + 'artistic' => 'http://opensource.org/licenses/artistic-license-2.0', |
|
| 24 | + 'bsd-new' => 'https://opensource.org/licenses/BSD-3-Clause', |
|
| 25 | + 'bsd-3' => 'https://opensource.org/licenses/BSD-3-Clause', |
|
| 26 | + 'bsd-2' => 'https://opensource.org/licenses/BSD-2-Clause', |
|
| 27 | + 'bsd' => 'https://opensource.org/licenses/BSD-2-Clause', |
|
| 28 | + 'epl-1.0' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 29 | + 'epl-1' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 30 | + 'epl' => 'http://www.eclipse.org/legal/epl-v10.html', |
|
| 31 | + 'apache-2.0' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 32 | + 'apache-2' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 33 | + 'apache' => 'http://www.apache.org/licenses/LICENSE-2.0.html', |
|
| 34 | + 'gpl-1.0' => 'https://www.gnu.org/licenses/gpl-1.0.html', |
|
| 35 | + 'gpl-1' => 'https://www.gnu.org/licenses/gpl-1.0.html', |
|
| 36 | + 'gpl-2.0' => 'https://www.gnu.org/licenses/gpl-2.0.html', |
|
| 37 | + 'gpl-2' => 'https://www.gnu.org/licenses/gpl-2.0.html', |
|
| 38 | + 'gpl-3.0' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 39 | + 'gpl-3' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 40 | + 'gpl' => 'http://www.gnu.org/licenses/gpl-3.0.html', |
|
| 41 | + 'lgpl-2.0' => 'http://www.gnu.org/licenses/lgpl-2.0.html', |
|
| 42 | + 'lgpl-2.1' => 'http://www.gnu.org/licenses/lgpl-2.1.html', |
|
| 43 | + 'lgpl-2' => 'http://www.gnu.org/licenses/lgpl-2.1.html', |
|
| 44 | + 'lgpl-3.0' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 45 | + 'lgpl-3' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 46 | + 'lgpl' => 'http://www.gnu.org/licenses/lgpl-3.0.html', |
|
| 47 | + 'mit' => 'http://opensource.org/licenses/MIT', |
|
| 48 | + 'mpl-1.1' => 'https://www.mozilla.org/en-US/MPL/1.1/', |
|
| 49 | + 'mpl-1' => 'https://www.mozilla.org/en-US/MPL/1.1/', |
|
| 50 | + 'mpl-2.0' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 51 | + 'mpl-2' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 52 | + 'mpl' => 'https://www.mozilla.org/en-US/MPL/', |
|
| 53 | + 'mspl' => 'https://msdn.microsoft.com/en-us/library/ff648068.aspx', |
|
| 54 | + ); |
|
| 55 | + private $name; |
|
| 56 | + private $url; |
|
| 57 | 57 | |
| 58 | - public function __construct(AbstractObject $parent, $name, $url = null) |
|
| 59 | - { |
|
| 60 | - parent::__construct($parent); |
|
| 58 | + public function __construct(AbstractObject $parent, $name, $url = null) |
|
| 59 | + { |
|
| 60 | + parent::__construct($parent); |
|
| 61 | 61 | |
| 62 | - $this->name = empty($name) ? null : $name; |
|
| 62 | + $this->name = empty($name) ? null : $name; |
|
| 63 | 63 | |
| 64 | - if (!empty($url)) { |
|
| 65 | - $this->url = $url; |
|
| 66 | - } elseif (!empty(self::$licenses[strtolower($name)])) { |
|
| 67 | - $this->url = self::$licenses[strtolower($name)]; |
|
| 68 | - } |
|
| 69 | - } |
|
| 64 | + if (!empty($url)) { |
|
| 65 | + $this->url = $url; |
|
| 66 | + } elseif (!empty(self::$licenses[strtolower($name)])) { |
|
| 67 | + $this->url = self::$licenses[strtolower($name)]; |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * @param string $command |
|
| 73 | - * @param string $data |
|
| 74 | - * @return AbstractObject|boolean |
|
| 75 | - */ |
|
| 76 | - public function handleCommand($command, $data = null) |
|
| 77 | - { |
|
| 78 | - switch (strtolower($command)) { |
|
| 79 | - case 'name': |
|
| 80 | - $this->name = $data; |
|
| 81 | - if (empty($this->url) && !empty(self::$licenses[strtolower($data)])) { |
|
| 82 | - $this->url = self::$licenses[strtolower($data)]; |
|
| 83 | - } |
|
| 84 | - return $this; |
|
| 71 | + /** |
|
| 72 | + * @param string $command |
|
| 73 | + * @param string $data |
|
| 74 | + * @return AbstractObject|boolean |
|
| 75 | + */ |
|
| 76 | + public function handleCommand($command, $data = null) |
|
| 77 | + { |
|
| 78 | + switch (strtolower($command)) { |
|
| 79 | + case 'name': |
|
| 80 | + $this->name = $data; |
|
| 81 | + if (empty($this->url) && !empty(self::$licenses[strtolower($data)])) { |
|
| 82 | + $this->url = self::$licenses[strtolower($data)]; |
|
| 83 | + } |
|
| 84 | + return $this; |
|
| 85 | 85 | |
| 86 | - case 'url': |
|
| 87 | - $this->url = $data; |
|
| 88 | - return $this; |
|
| 89 | - } |
|
| 86 | + case 'url': |
|
| 87 | + $this->url = $data; |
|
| 88 | + return $this; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - return parent::handleCommand($command, $data); |
|
| 92 | - } |
|
| 91 | + return parent::handleCommand($command, $data); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - public function toArray(): array |
|
| 95 | - { |
|
| 96 | - return self::arrayFilterNull(array_merge(array( |
|
| 97 | - 'name' => $this->name, |
|
| 98 | - 'url' => $this->url, |
|
| 99 | - ), parent::toArray())); |
|
| 100 | - } |
|
| 94 | + public function toArray(): array |
|
| 95 | + { |
|
| 96 | + return self::arrayFilterNull(array_merge(array( |
|
| 97 | + 'name' => $this->name, |
|
| 98 | + 'url' => $this->url, |
|
| 99 | + ), parent::toArray())); |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - public function __toString() |
|
| 103 | - { |
|
| 104 | - return __CLASS__ . " {$this->name}, {$this->url}"; |
|
| 105 | - } |
|
| 102 | + public function __toString() |
|
| 103 | + { |
|
| 104 | + return __CLASS__ . " {$this->name}, {$this->url}"; |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | 107 | } |
@@ -13,30 +13,30 @@ |
||
| 13 | 13 | class ParameterReference extends AbstractObject implements IParameter |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - private $reference; |
|
| 17 | - |
|
| 18 | - public function __construct(AbstractObject $parent, $reference) |
|
| 19 | - { |
|
| 20 | - parent::__construct($parent); |
|
| 21 | - |
|
| 22 | - $this->reference = $reference; |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - public function toArray(): array |
|
| 26 | - { |
|
| 27 | - return self::arrayFilterNull(array( |
|
| 28 | - '$ref' => '#/parameters/' . $this->reference, |
|
| 29 | - )); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public function __toString() |
|
| 33 | - { |
|
| 34 | - return __CLASS__ . ' `' . $this->reference . '`'; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public function getName() |
|
| 38 | - { |
|
| 39 | - return $this->reference; |
|
| 40 | - } |
|
| 16 | + private $reference; |
|
| 17 | + |
|
| 18 | + public function __construct(AbstractObject $parent, $reference) |
|
| 19 | + { |
|
| 20 | + parent::__construct($parent); |
|
| 21 | + |
|
| 22 | + $this->reference = $reference; |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + public function toArray(): array |
|
| 26 | + { |
|
| 27 | + return self::arrayFilterNull(array( |
|
| 28 | + '$ref' => '#/parameters/' . $this->reference, |
|
| 29 | + )); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + public function __toString() |
|
| 33 | + { |
|
| 34 | + return __CLASS__ . ' `' . $this->reference . '`'; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public function getName() |
|
| 38 | + { |
|
| 39 | + return $this->reference; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | } |
@@ -14,49 +14,49 @@ |
||
| 14 | 14 | class Contact extends AbstractObject |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - private $name; |
|
| 18 | - private $url; |
|
| 19 | - private $email; |
|
| 20 | - |
|
| 21 | - public function __construct(AbstractObject $parent, $name = null, $url = null, $email = null) |
|
| 22 | - { |
|
| 23 | - parent::__construct($parent); |
|
| 24 | - |
|
| 25 | - $this->name = empty($name) ? null : $name; |
|
| 26 | - $this->url = empty($url) ? null : $url; |
|
| 27 | - $this->email = empty($email) ? null : $email; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * @param string $command |
|
| 32 | - * @param string $data |
|
| 33 | - * @return AbstractObject|boolean |
|
| 34 | - */ |
|
| 35 | - public function handleCommand($command, $data = null) |
|
| 36 | - { |
|
| 37 | - switch (strtolower($command)) { |
|
| 38 | - case 'name': |
|
| 39 | - case 'url': |
|
| 40 | - case 'email': |
|
| 41 | - $this->$command = $data; |
|
| 42 | - return $this; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - return parent::handleCommand($command, $data); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function toArray(): array |
|
| 49 | - { |
|
| 50 | - return self::arrayFilterNull(array_merge(array( |
|
| 51 | - 'name' => $this->name, |
|
| 52 | - 'url' => $this->url, |
|
| 53 | - 'email' => $this->email, |
|
| 54 | - ), parent::toArray())); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - public function __toString() |
|
| 58 | - { |
|
| 59 | - return __CLASS__ . " {$this->name} <{$this->email}>, {$this->url}"; |
|
| 60 | - } |
|
| 17 | + private $name; |
|
| 18 | + private $url; |
|
| 19 | + private $email; |
|
| 20 | + |
|
| 21 | + public function __construct(AbstractObject $parent, $name = null, $url = null, $email = null) |
|
| 22 | + { |
|
| 23 | + parent::__construct($parent); |
|
| 24 | + |
|
| 25 | + $this->name = empty($name) ? null : $name; |
|
| 26 | + $this->url = empty($url) ? null : $url; |
|
| 27 | + $this->email = empty($email) ? null : $email; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * @param string $command |
|
| 32 | + * @param string $data |
|
| 33 | + * @return AbstractObject|boolean |
|
| 34 | + */ |
|
| 35 | + public function handleCommand($command, $data = null) |
|
| 36 | + { |
|
| 37 | + switch (strtolower($command)) { |
|
| 38 | + case 'name': |
|
| 39 | + case 'url': |
|
| 40 | + case 'email': |
|
| 41 | + $this->$command = $data; |
|
| 42 | + return $this; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + return parent::handleCommand($command, $data); |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + public function toArray(): array |
|
| 49 | + { |
|
| 50 | + return self::arrayFilterNull(array_merge(array( |
|
| 51 | + 'name' => $this->name, |
|
| 52 | + 'url' => $this->url, |
|
| 53 | + 'email' => $this->email, |
|
| 54 | + ), parent::toArray())); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + public function __toString() |
|
| 58 | + { |
|
| 59 | + return __CLASS__ . " {$this->name} <{$this->email}>, {$this->url}"; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | } |
@@ -6,42 +6,42 @@ discard block |
||
| 6 | 6 | class PreprocessorTest extends TestCase |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | - /** |
|
| 10 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::__construct |
|
| 11 | - */ |
|
| 12 | - public function testConstructor_Empty() |
|
| 13 | - { |
|
| 14 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 15 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::__construct |
|
| 20 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::getPrefix |
|
| 21 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::setPrefix |
|
| 22 | - */ |
|
| 23 | - public function testConstructor_Prefix() |
|
| 24 | - { |
|
| 25 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 26 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 27 | - $this->assertEquals('rest', $object->getPrefix()); |
|
| 28 | - |
|
| 29 | - $object = new \SwaggerGen\Parser\Php\Preprocessor('foo'); |
|
| 30 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 31 | - $this->assertEquals('foo', $object->getPrefix()); |
|
| 32 | - |
|
| 33 | - $object->setPrefix('bar'); |
|
| 34 | - $this->assertEquals('bar', $object->getPrefix()); |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 39 | - */ |
|
| 40 | - public function testPreprocess_Ifdef_NotDefined() |
|
| 41 | - { |
|
| 42 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 43 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 44 | - $out = $object->preprocess('<?php |
|
| 9 | + /** |
|
| 10 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::__construct |
|
| 11 | + */ |
|
| 12 | + public function testConstructor_Empty() |
|
| 13 | + { |
|
| 14 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 15 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::__construct |
|
| 20 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::getPrefix |
|
| 21 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::setPrefix |
|
| 22 | + */ |
|
| 23 | + public function testConstructor_Prefix() |
|
| 24 | + { |
|
| 25 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 26 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 27 | + $this->assertEquals('rest', $object->getPrefix()); |
|
| 28 | + |
|
| 29 | + $object = new \SwaggerGen\Parser\Php\Preprocessor('foo'); |
|
| 30 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 31 | + $this->assertEquals('foo', $object->getPrefix()); |
|
| 32 | + |
|
| 33 | + $object->setPrefix('bar'); |
|
| 34 | + $this->assertEquals('bar', $object->getPrefix()); |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 39 | + */ |
|
| 40 | + public function testPreprocess_Ifdef_NotDefined() |
|
| 41 | + { |
|
| 42 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 43 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 44 | + $out = $object->preprocess('<?php |
|
| 45 | 45 | /** |
| 46 | 46 | * @rest\ifdef test |
| 47 | 47 | * @rest\whatever |
@@ -49,25 +49,25 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | '); |
| 51 | 51 | |
| 52 | - $this->assertEquals('<?php |
|
| 52 | + $this->assertEquals('<?php |
|
| 53 | 53 | /** |
| 54 | 54 | * @!rest\ifdef test |
| 55 | 55 | * @!rest\whatever |
| 56 | 56 | * @!rest\endif |
| 57 | 57 | */ |
| 58 | 58 | ', $out); |
| 59 | - } |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 63 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 64 | - */ |
|
| 65 | - public function testPreprocess_Ifdef_Defined() |
|
| 66 | - { |
|
| 67 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 68 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 69 | - $object->define('test'); |
|
| 70 | - $out = $object->preprocess('<?php |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 63 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 64 | + */ |
|
| 65 | + public function testPreprocess_Ifdef_Defined() |
|
| 66 | + { |
|
| 67 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 68 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 69 | + $object->define('test'); |
|
| 70 | + $out = $object->preprocess('<?php |
|
| 71 | 71 | /** |
| 72 | 72 | * @rest\ifdef test |
| 73 | 73 | * @rest\whatever |
@@ -75,23 +75,23 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | '); |
| 77 | 77 | |
| 78 | - $this->assertEquals('<?php |
|
| 78 | + $this->assertEquals('<?php |
|
| 79 | 79 | /** |
| 80 | 80 | * @!rest\ifdef test |
| 81 | 81 | * @rest\whatever |
| 82 | 82 | * @!rest\endif |
| 83 | 83 | */ |
| 84 | 84 | ', $out); |
| 85 | - } |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 89 | - */ |
|
| 90 | - public function testPreprocess_Ifndef_NotDefined() |
|
| 91 | - { |
|
| 92 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 93 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 94 | - $out = $object->preprocess('<?php |
|
| 87 | + /** |
|
| 88 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 89 | + */ |
|
| 90 | + public function testPreprocess_Ifndef_NotDefined() |
|
| 91 | + { |
|
| 92 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 93 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 94 | + $out = $object->preprocess('<?php |
|
| 95 | 95 | /** |
| 96 | 96 | * @rest\ifndef test |
| 97 | 97 | * @rest\whatever |
@@ -99,25 +99,25 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | '); |
| 101 | 101 | |
| 102 | - $this->assertEquals('<?php |
|
| 102 | + $this->assertEquals('<?php |
|
| 103 | 103 | /** |
| 104 | 104 | * @!rest\ifndef test |
| 105 | 105 | * @rest\whatever |
| 106 | 106 | * @!rest\endif |
| 107 | 107 | */ |
| 108 | 108 | ', $out); |
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 113 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 114 | - */ |
|
| 115 | - public function testPreprocess_Ifndef_Defined() |
|
| 116 | - { |
|
| 117 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 118 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 119 | - $object->define('test'); |
|
| 120 | - $out = $object->preprocess('<?php |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 113 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 114 | + */ |
|
| 115 | + public function testPreprocess_Ifndef_Defined() |
|
| 116 | + { |
|
| 117 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 118 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 119 | + $object->define('test'); |
|
| 120 | + $out = $object->preprocess('<?php |
|
| 121 | 121 | /** |
| 122 | 122 | * @rest\ifndef test |
| 123 | 123 | * @rest\whatever |
@@ -125,23 +125,23 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | '); |
| 127 | 127 | |
| 128 | - $this->assertEquals('<?php |
|
| 128 | + $this->assertEquals('<?php |
|
| 129 | 129 | /** |
| 130 | 130 | * @!rest\ifndef test |
| 131 | 131 | * @!rest\whatever |
| 132 | 132 | * @!rest\endif |
| 133 | 133 | */ |
| 134 | 134 | ', $out); |
| 135 | - } |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - /** |
|
| 138 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 139 | - */ |
|
| 140 | - public function testPreprocess_Define() |
|
| 141 | - { |
|
| 142 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 143 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 144 | - $out = $object->preprocess('<?php |
|
| 137 | + /** |
|
| 138 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 139 | + */ |
|
| 140 | + public function testPreprocess_Define() |
|
| 141 | + { |
|
| 142 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 143 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 144 | + $out = $object->preprocess('<?php |
|
| 145 | 145 | /** |
| 146 | 146 | * @rest\define test |
| 147 | 147 | * @rest\ifndef test |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | '); |
| 152 | 152 | |
| 153 | - $this->assertEquals('<?php |
|
| 153 | + $this->assertEquals('<?php |
|
| 154 | 154 | /** |
| 155 | 155 | * @!rest\define test |
| 156 | 156 | * @!rest\ifndef test |
@@ -158,16 +158,16 @@ discard block |
||
| 158 | 158 | * @!rest\endif |
| 159 | 159 | */ |
| 160 | 160 | ', $out); |
| 161 | - } |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | - /** |
|
| 164 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 165 | - */ |
|
| 166 | - public function testPreprocess_Undef() |
|
| 167 | - { |
|
| 168 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 169 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 170 | - $out = $object->preprocess('<?php |
|
| 163 | + /** |
|
| 164 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 165 | + */ |
|
| 166 | + public function testPreprocess_Undef() |
|
| 167 | + { |
|
| 168 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 169 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 170 | + $out = $object->preprocess('<?php |
|
| 171 | 171 | /** |
| 172 | 172 | * @rest\define test |
| 173 | 173 | * @rest\undef test |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | '); |
| 179 | 179 | |
| 180 | - $this->assertEquals('<?php |
|
| 180 | + $this->assertEquals('<?php |
|
| 181 | 181 | /** |
| 182 | 182 | * @!rest\define test |
| 183 | 183 | * @!rest\undef test |
@@ -186,16 +186,16 @@ discard block |
||
| 186 | 186 | * @!rest\endif |
| 187 | 187 | */ |
| 188 | 188 | ', $out); |
| 189 | - } |
|
| 189 | + } |
|
| 190 | 190 | |
| 191 | - /** |
|
| 192 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 193 | - */ |
|
| 194 | - public function testPreprocess_If_NotDefined() |
|
| 195 | - { |
|
| 196 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 197 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 198 | - $out = $object->preprocess('<?php |
|
| 191 | + /** |
|
| 192 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 193 | + */ |
|
| 194 | + public function testPreprocess_If_NotDefined() |
|
| 195 | + { |
|
| 196 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 197 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 198 | + $out = $object->preprocess('<?php |
|
| 199 | 199 | /** |
| 200 | 200 | * @rest\if test red |
| 201 | 201 | * @rest\whatever |
@@ -203,25 +203,25 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | '); |
| 205 | 205 | |
| 206 | - $this->assertEquals('<?php |
|
| 206 | + $this->assertEquals('<?php |
|
| 207 | 207 | /** |
| 208 | 208 | * @!rest\if test red |
| 209 | 209 | * @!rest\whatever |
| 210 | 210 | * @!rest\endif |
| 211 | 211 | */ |
| 212 | 212 | ', $out); |
| 213 | - } |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 217 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 218 | - */ |
|
| 219 | - public function testPreprocess_If_AnyValue() |
|
| 220 | - { |
|
| 221 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 222 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 223 | - $object->define('test', 'green'); |
|
| 224 | - $out = $object->preprocess('<?php |
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 217 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 218 | + */ |
|
| 219 | + public function testPreprocess_If_AnyValue() |
|
| 220 | + { |
|
| 221 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 222 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 223 | + $object->define('test', 'green'); |
|
| 224 | + $out = $object->preprocess('<?php |
|
| 225 | 225 | /** |
| 226 | 226 | * @rest\if test |
| 227 | 227 | * @rest\whatever |
@@ -229,25 +229,25 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | '); |
| 231 | 231 | |
| 232 | - $this->assertEquals('<?php |
|
| 232 | + $this->assertEquals('<?php |
|
| 233 | 233 | /** |
| 234 | 234 | * @!rest\if test |
| 235 | 235 | * @rest\whatever |
| 236 | 236 | * @!rest\endif |
| 237 | 237 | */ |
| 238 | 238 | ', $out); |
| 239 | - } |
|
| 240 | - |
|
| 241 | - /** |
|
| 242 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 243 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 244 | - */ |
|
| 245 | - public function testPreprocess_If_NoValue() |
|
| 246 | - { |
|
| 247 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 248 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 249 | - $object->define('test'); |
|
| 250 | - $out = $object->preprocess('<?php |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + /** |
|
| 242 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 243 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 244 | + */ |
|
| 245 | + public function testPreprocess_If_NoValue() |
|
| 246 | + { |
|
| 247 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 248 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 249 | + $object->define('test'); |
|
| 250 | + $out = $object->preprocess('<?php |
|
| 251 | 251 | /** |
| 252 | 252 | * @rest\if test red |
| 253 | 253 | * @rest\whatever |
@@ -255,25 +255,25 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | '); |
| 257 | 257 | |
| 258 | - $this->assertEquals('<?php |
|
| 258 | + $this->assertEquals('<?php |
|
| 259 | 259 | /** |
| 260 | 260 | * @!rest\if test red |
| 261 | 261 | * @!rest\whatever |
| 262 | 262 | * @!rest\endif |
| 263 | 263 | */ |
| 264 | 264 | ', $out); |
| 265 | - } |
|
| 266 | - |
|
| 267 | - /** |
|
| 268 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 269 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 270 | - */ |
|
| 271 | - public function testPreprocess_If_Mismatch() |
|
| 272 | - { |
|
| 273 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 274 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 275 | - $object->define('test', 'green'); |
|
| 276 | - $out = $object->preprocess('<?php |
|
| 265 | + } |
|
| 266 | + |
|
| 267 | + /** |
|
| 268 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 269 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 270 | + */ |
|
| 271 | + public function testPreprocess_If_Mismatch() |
|
| 272 | + { |
|
| 273 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 274 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 275 | + $object->define('test', 'green'); |
|
| 276 | + $out = $object->preprocess('<?php |
|
| 277 | 277 | /** |
| 278 | 278 | * @rest\if test red |
| 279 | 279 | * @rest\whatever |
@@ -281,25 +281,25 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | '); |
| 283 | 283 | |
| 284 | - $this->assertEquals('<?php |
|
| 284 | + $this->assertEquals('<?php |
|
| 285 | 285 | /** |
| 286 | 286 | * @!rest\if test red |
| 287 | 287 | * @!rest\whatever |
| 288 | 288 | * @!rest\endif |
| 289 | 289 | */ |
| 290 | 290 | ', $out); |
| 291 | - } |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 295 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 296 | - */ |
|
| 297 | - public function testPreprocess_If_Match() |
|
| 298 | - { |
|
| 299 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 300 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 301 | - $object->define('test', 'red'); |
|
| 302 | - $out = $object->preprocess('<?php |
|
| 291 | + } |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 295 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 296 | + */ |
|
| 297 | + public function testPreprocess_If_Match() |
|
| 298 | + { |
|
| 299 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 300 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 301 | + $object->define('test', 'red'); |
|
| 302 | + $out = $object->preprocess('<?php |
|
| 303 | 303 | /** |
| 304 | 304 | * @rest\if test red |
| 305 | 305 | * @rest\whatever |
@@ -307,25 +307,25 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | '); |
| 309 | 309 | |
| 310 | - $this->assertEquals('<?php |
|
| 310 | + $this->assertEquals('<?php |
|
| 311 | 311 | /** |
| 312 | 312 | * @!rest\if test red |
| 313 | 313 | * @rest\whatever |
| 314 | 314 | * @!rest\endif |
| 315 | 315 | */ |
| 316 | 316 | ', $out); |
| 317 | - } |
|
| 318 | - |
|
| 319 | - /** |
|
| 320 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 321 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 322 | - */ |
|
| 323 | - public function testPreprocess_Else_Match() |
|
| 324 | - { |
|
| 325 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 326 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 327 | - $object->define('test', 'blue'); |
|
| 328 | - $out = $object->preprocess('<?php |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + /** |
|
| 320 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 321 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 322 | + */ |
|
| 323 | + public function testPreprocess_Else_Match() |
|
| 324 | + { |
|
| 325 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 326 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 327 | + $object->define('test', 'blue'); |
|
| 328 | + $out = $object->preprocess('<?php |
|
| 329 | 329 | /** |
| 330 | 330 | * @rest\if test red |
| 331 | 331 | * @rest\whatever |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | '); |
| 337 | 337 | |
| 338 | - $this->assertEquals('<?php |
|
| 338 | + $this->assertEquals('<?php |
|
| 339 | 339 | /** |
| 340 | 340 | * @!rest\if test red |
| 341 | 341 | * @!rest\whatever |
@@ -344,18 +344,18 @@ discard block |
||
| 344 | 344 | * @!rest\endif |
| 345 | 345 | */ |
| 346 | 346 | ', $out); |
| 347 | - } |
|
| 348 | - |
|
| 349 | - /** |
|
| 350 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 351 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 352 | - */ |
|
| 353 | - public function testPreprocess_Elif_Match() |
|
| 354 | - { |
|
| 355 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 356 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 357 | - $object->define('test', 'blue'); |
|
| 358 | - $out = $object->preprocess('<?php |
|
| 347 | + } |
|
| 348 | + |
|
| 349 | + /** |
|
| 350 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 351 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 352 | + */ |
|
| 353 | + public function testPreprocess_Elif_Match() |
|
| 354 | + { |
|
| 355 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 356 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 357 | + $object->define('test', 'blue'); |
|
| 358 | + $out = $object->preprocess('<?php |
|
| 359 | 359 | /** |
| 360 | 360 | * @rest\if test red |
| 361 | 361 | * @rest\whatever |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | */ |
| 368 | 368 | '); |
| 369 | 369 | |
| 370 | - $this->assertEquals('<?php |
|
| 370 | + $this->assertEquals('<?php |
|
| 371 | 371 | /** |
| 372 | 372 | * @!rest\if test red |
| 373 | 373 | * @!rest\whatever |
@@ -378,18 +378,18 @@ discard block |
||
| 378 | 378 | * @!rest\endif |
| 379 | 379 | */ |
| 380 | 380 | ', $out); |
| 381 | - } |
|
| 382 | - |
|
| 383 | - /** |
|
| 384 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 385 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 386 | - */ |
|
| 387 | - public function testPreprocess_Elif_NoValue() |
|
| 388 | - { |
|
| 389 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 390 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 391 | - $object->define('test', 'blue'); |
|
| 392 | - $out = $object->preprocess('<?php |
|
| 381 | + } |
|
| 382 | + |
|
| 383 | + /** |
|
| 384 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 385 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 386 | + */ |
|
| 387 | + public function testPreprocess_Elif_NoValue() |
|
| 388 | + { |
|
| 389 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 390 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 391 | + $object->define('test', 'blue'); |
|
| 392 | + $out = $object->preprocess('<?php |
|
| 393 | 393 | /** |
| 394 | 394 | * @rest\if test red |
| 395 | 395 | * @rest\whatever |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | '); |
| 403 | 403 | |
| 404 | - $this->assertEquals('<?php |
|
| 404 | + $this->assertEquals('<?php |
|
| 405 | 405 | /** |
| 406 | 406 | * @!rest\if test red |
| 407 | 407 | * @!rest\whatever |
@@ -412,16 +412,16 @@ discard block |
||
| 412 | 412 | * @!rest\endif |
| 413 | 413 | */ |
| 414 | 414 | ', $out); |
| 415 | - } |
|
| 415 | + } |
|
| 416 | 416 | |
| 417 | - /** |
|
| 418 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 419 | - */ |
|
| 420 | - public function testPreprocess_Ifdef_AffectPrefixedOnly() |
|
| 421 | - { |
|
| 422 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 423 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 424 | - $out = $object->preprocess('<?php |
|
| 417 | + /** |
|
| 418 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 419 | + */ |
|
| 420 | + public function testPreprocess_Ifdef_AffectPrefixedOnly() |
|
| 421 | + { |
|
| 422 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 423 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 424 | + $out = $object->preprocess('<?php |
|
| 425 | 425 | /** |
| 426 | 426 | * @rest\ifdef test |
| 427 | 427 | * @rest\whatever |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | */ |
| 433 | 433 | '); |
| 434 | 434 | |
| 435 | - $this->assertEquals('<?php |
|
| 435 | + $this->assertEquals('<?php |
|
| 436 | 436 | /** |
| 437 | 437 | * @!rest\ifdef test |
| 438 | 438 | * @!rest\whatever |
@@ -442,20 +442,20 @@ discard block |
||
| 442 | 442 | * @!rest\endif |
| 443 | 443 | */ |
| 444 | 444 | ', $out); |
| 445 | - } |
|
| 446 | - |
|
| 447 | - /** |
|
| 448 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 449 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::undefine |
|
| 450 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 451 | - */ |
|
| 452 | - public function testPreprocess_Undefine() |
|
| 453 | - { |
|
| 454 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 455 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 456 | - $object->define('test'); |
|
| 457 | - $object->undefine('test'); |
|
| 458 | - $out = $object->preprocess('<?php |
|
| 445 | + } |
|
| 446 | + |
|
| 447 | + /** |
|
| 448 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 449 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::undefine |
|
| 450 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 451 | + */ |
|
| 452 | + public function testPreprocess_Undefine() |
|
| 453 | + { |
|
| 454 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 455 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 456 | + $object->define('test'); |
|
| 457 | + $object->undefine('test'); |
|
| 458 | + $out = $object->preprocess('<?php |
|
| 459 | 459 | /** |
| 460 | 460 | * @rest\ifdef test |
| 461 | 461 | * @rest\whatever |
@@ -463,27 +463,27 @@ discard block |
||
| 463 | 463 | */ |
| 464 | 464 | '); |
| 465 | 465 | |
| 466 | - $this->assertEquals('<?php |
|
| 466 | + $this->assertEquals('<?php |
|
| 467 | 467 | /** |
| 468 | 468 | * @!rest\ifdef test |
| 469 | 469 | * @!rest\whatever |
| 470 | 470 | * @!rest\endif |
| 471 | 471 | */ |
| 472 | 472 | ', $out); |
| 473 | - } |
|
| 474 | - |
|
| 475 | - /** |
|
| 476 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 477 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::resetDefines |
|
| 478 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 479 | - */ |
|
| 480 | - public function testPreprocess_ResetDefines() |
|
| 481 | - { |
|
| 482 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 483 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 484 | - $object->define('test'); |
|
| 485 | - $object->resetDefines(); |
|
| 486 | - $out = $object->preprocess('<?php |
|
| 473 | + } |
|
| 474 | + |
|
| 475 | + /** |
|
| 476 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 477 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::resetDefines |
|
| 478 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 479 | + */ |
|
| 480 | + public function testPreprocess_ResetDefines() |
|
| 481 | + { |
|
| 482 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 483 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 484 | + $object->define('test'); |
|
| 485 | + $object->resetDefines(); |
|
| 486 | + $out = $object->preprocess('<?php |
|
| 487 | 487 | /** |
| 488 | 488 | * @rest\ifdef test |
| 489 | 489 | * @rest\whatever |
@@ -491,25 +491,25 @@ discard block |
||
| 491 | 491 | */ |
| 492 | 492 | '); |
| 493 | 493 | |
| 494 | - $this->assertEquals('<?php |
|
| 494 | + $this->assertEquals('<?php |
|
| 495 | 495 | /** |
| 496 | 496 | * @!rest\ifdef test |
| 497 | 497 | * @!rest\whatever |
| 498 | 498 | * @!rest\endif |
| 499 | 499 | */ |
| 500 | 500 | ', $out); |
| 501 | - } |
|
| 502 | - |
|
| 503 | - /** |
|
| 504 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::addDefines |
|
| 505 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 506 | - */ |
|
| 507 | - public function testPreprocess_AddDefines() |
|
| 508 | - { |
|
| 509 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 510 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 511 | - $object->addDefines(array('test' => true)); |
|
| 512 | - $out = $object->preprocess('<?php |
|
| 501 | + } |
|
| 502 | + |
|
| 503 | + /** |
|
| 504 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::addDefines |
|
| 505 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 506 | + */ |
|
| 507 | + public function testPreprocess_AddDefines() |
|
| 508 | + { |
|
| 509 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 510 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 511 | + $object->addDefines(array('test' => true)); |
|
| 512 | + $out = $object->preprocess('<?php |
|
| 513 | 513 | /** |
| 514 | 514 | * @rest\ifdef test |
| 515 | 515 | * @rest\whatever |
@@ -517,23 +517,23 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | '); |
| 519 | 519 | |
| 520 | - $this->assertEquals('<?php |
|
| 520 | + $this->assertEquals('<?php |
|
| 521 | 521 | /** |
| 522 | 522 | * @!rest\ifdef test |
| 523 | 523 | * @rest\whatever |
| 524 | 524 | * @!rest\endif |
| 525 | 525 | */ |
| 526 | 526 | ', $out); |
| 527 | - } |
|
| 527 | + } |
|
| 528 | 528 | |
| 529 | - /** |
|
| 530 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 531 | - */ |
|
| 532 | - public function testPreprocess_AlternativePrefix() |
|
| 533 | - { |
|
| 534 | - $object = new \SwaggerGen\Parser\Php\Preprocessor('foo'); |
|
| 535 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 536 | - $out = $object->preprocess('<?php |
|
| 529 | + /** |
|
| 530 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocess |
|
| 531 | + */ |
|
| 532 | + public function testPreprocess_AlternativePrefix() |
|
| 533 | + { |
|
| 534 | + $object = new \SwaggerGen\Parser\Php\Preprocessor('foo'); |
|
| 535 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 536 | + $out = $object->preprocess('<?php |
|
| 537 | 537 | /** |
| 538 | 538 | * @foo\ifdef test |
| 539 | 539 | * @foo\whatever |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | */ |
| 543 | 543 | '); |
| 544 | 544 | |
| 545 | - $this->assertEquals('<?php |
|
| 545 | + $this->assertEquals('<?php |
|
| 546 | 546 | /** |
| 547 | 547 | * @!foo\ifdef test |
| 548 | 548 | * @!foo\whatever |
@@ -550,31 +550,31 @@ discard block |
||
| 550 | 550 | * @!foo\endif |
| 551 | 551 | */ |
| 552 | 552 | ', $out); |
| 553 | - } |
|
| 553 | + } |
|
| 554 | 554 | |
| 555 | - /** |
|
| 556 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 557 | - * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocessFile |
|
| 558 | - */ |
|
| 559 | - public function testPreprocessFile() |
|
| 560 | - { |
|
| 561 | - $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 562 | - $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 563 | - $object->define('test'); |
|
| 555 | + /** |
|
| 556 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::define |
|
| 557 | + * @covers \SwaggerGen\Parser\Php\Preprocessor::preprocessFile |
|
| 558 | + */ |
|
| 559 | + public function testPreprocessFile() |
|
| 560 | + { |
|
| 561 | + $object = new \SwaggerGen\Parser\Php\Preprocessor(); |
|
| 562 | + $this->assertInstanceOf('\SwaggerGen\Parser\Php\Preprocessor', $object); |
|
| 563 | + $object->define('test'); |
|
| 564 | 564 | |
| 565 | - $out = $object->preprocessFile(__DIR__ . '/PreprocessorTest/testPreprocessFile.php'); |
|
| 565 | + $out = $object->preprocessFile(__DIR__ . '/PreprocessorTest/testPreprocessFile.php'); |
|
| 566 | 566 | |
| 567 | - $this->assertEquals('<?php |
|
| 567 | + $this->assertEquals('<?php |
|
| 568 | 568 | |
| 569 | 569 | /** |
| 570 | 570 | * @!rest\ifdef test |
| 571 | 571 | * @rest\whatever |
| 572 | 572 | * @!rest\endif |
| 573 | 573 | */', $out); |
| 574 | - } |
|
| 574 | + } |
|
| 575 | 575 | |
| 576 | - //@todo preprocess($content) -> mingle with other PHP code |
|
| 577 | - //@todo preprocess($content) -> Condition within comment |
|
| 578 | - //@todo preprocess($content) -> Condition over comments |
|
| 579 | - //@todo preprocess($content) -> Condition over code |
|
| 576 | + //@todo preprocess($content) -> mingle with other PHP code |
|
| 577 | + //@todo preprocess($content) -> Condition within comment |
|
| 578 | + //@todo preprocess($content) -> Condition over comments |
|
| 579 | + //@todo preprocess($content) -> Condition over code |
|
| 580 | 580 | } |