BLUE
PHP 7.4.33
Path:
/var/www/multi-event-cfp.bitkit.dk/httpdocs/vendor/zircote/swagger-php/src/Analysers
Run
Logout
Edit File
Size: 2.30 KB
Close
/var/www/multi-event-cfp.bitkit.dk/httpdocs/vendor/zircote/swagger-php/src/Analysers/DocBlockParser.php
Text
Base64
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Analysers; use Doctrine\Common\Annotations\DocParser; use OpenApi\Context; use OpenApi\Generator; /** * Extract swagger-php annotations from a [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) using Doctrine's DocParser. */ class DocBlockParser { /** * @var DocParser */ protected $docParser; public function __construct(array $aliases = []) { $docParser = new DocParser(); $docParser->setIgnoreNotImportedAnnotations(true); $docParser->setImports($aliases); $this->docParser = $docParser; } public function setAliases(array $aliases): void { $this->docParser->setImports($aliases); } /** * Use doctrine to parse the comment block and return the detected annotations. * * @param string $comment a T_DOC_COMMENT * @param Context $context * * @return array Annotations */ public function fromComment(string $comment, Context $context): array { $context->comment = $comment; try { Generator::$context = $context; if ($context->is('annotations') === false) { $context->annotations = []; } return $this->docParser->parse($comment); } catch (\Exception $e) { if (preg_match('/^(.+) at position ([0-9]+) in ' . preg_quote((string) $context, '/') . '\.$/', $e->getMessage(), $matches)) { $errorMessage = $matches[1]; $errorPos = (int) $matches[2]; $atPos = strpos($comment, '@'); $context->line += substr_count($comment, "\n", 0, $atPos + $errorPos); $lines = explode("\n", substr($comment, $atPos, $errorPos)); $context->character = strlen(array_pop($lines)) + 1; // position starts at 0 character starts at 1 $context->logger->error($errorMessage . ' in ' . $context, ['exception' => $e]); } else { $context->logger->error( $e->getMessage() . ($context->filename ? ('; file=' . $context->filename) : ''), ['exception' => $e] ); } return []; } finally { Generator::$context = null; } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AnalyserInterface.php
332 B
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AnnotationFactoryInterface.php
318 B
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AttributeAnnotationFactory.php
4.76 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ComposerAutoloaderScanner.php
1.13 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DocBlockAnnotationFactory.php
1.68 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DocBlockParser.php
2.30 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReflectionAnalyser.php
6.91 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TokenAnalyser.php
23.13 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TokenScanner.php
11.18 KB
lrw-rw-r--
2022-04-17 01:42:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).