![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/zircote/swagger-php/src/Annotations/ |
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Annotations; /** * The description of an item in a Schema with type `array`. * * @Annotation */ class Items extends Schema { /** * @inheritdoc */ public static $_nested = [ Discriminator::class => 'discriminator', Items::class => 'items', Property::class => ['properties', 'property'], ExternalDocumentation::class => 'externalDocs', Xml::class => 'xml', AdditionalProperties::class => 'additionalProperties', Attachable::class => ['attachables'], ]; /** * @inheritdoc */ public static $_parents = [ Property::class, AdditionalProperties::class, Schema::class, JsonContent::class, XmlContent::class, Items::class, ]; /** * @inheritdoc */ public function validate(array $stack = [], array $skip = [], string $ref = '', $context = null): bool { if (in_array($this, $skip, true)) { return true; } $valid = parent::validate($stack, $skip, $ref, $context); $parent = end($stack); if ($parent instanceof Schema && $parent->type !== 'array') { $this->_context->logger->warning('@OA\\Items() parent type must be "array" in ' . $this->_context); $valid = false; } // @todo Additional validation when used inside a Header or Parameter context. return $valid; } }