mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
14383f4ee5
* add zircore/swagger-php v4 to composer.json * fix incompatibilities * add compatibility with 3.2 * Apply fixes from StyleCI * mark SetsContextTrait as internal * Bump php version Co-authored-by: Alexey <alshenestky@icloud.com> Co-authored-by: Alexey Alshenetsky <alshenetsky@users.noreply.github.com> Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
23 lines
450 B
PHP
23 lines
450 B
PHP
<?php
|
|
|
|
namespace Nelmio\ApiDocBundle\Util;
|
|
|
|
use OpenApi\Context;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
trait SetsContextTrait
|
|
{
|
|
private function setContext(?Context $context): void
|
|
{
|
|
if (class_exists(\OpenApi\Analyser::class)) {
|
|
// zircote/swagger-php ^3.2
|
|
\OpenApi\Analyser::$context = $context;
|
|
} else {
|
|
/// zircote/swagger-php ^4.0
|
|
\OpenApi\Generator::$context = $context;
|
|
}
|
|
}
|
|
}
|