OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
zzXpress
/
vendor
/
aws
/
aws-sdk-php
/
build
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
Burgomaster.php
13.48 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
ClassAnnotationUpdater.php
3.3 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
ClientAnnotator.php
4.57 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
JsonCompiler.php
2.48 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
PhpFileLinterTrait.php
1.44 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
ServiceBuilder.php
1.85 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
annotate-client-locator.php
1.04 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
annotate-clients.php
2.74 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
aws-clear-cache.php
91 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
build-manifest.php
3.57 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
build-redirect-map.php
343 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
build-service.php
1015 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📁
changelog
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
compile-json.php
447 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📁
docs
-
11/13/2024 02:26:56 PM
rwxr-xr-x
📄
docs.php
1.72 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
gh-release.php
6.01 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
normalize-docs-files.php
7.74 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
option-docs.php
1.21 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
packager.php
2.2 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
phar-test-runner.php
161 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
remove-method-annotations.php
1.4 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
test-phar.php
1.05 KB
05/19/2025 10:07:24 AM
rw-r--r--
Editing: ClassAnnotationUpdater.php
Close
<?php /** * Adds and removes annotations to a class. * * @internal */ class ClassAnnotationUpdater { use PhpFileLinterTrait; /** @var ReflectionClass */ private $reflection; /** @var string[] */ private $linesToAppend; /** @var string */ private $defaultDocBlock; /** @var string */ private $removeMatching; public function __construct( ReflectionClass $reflection, array $linesToAppend, $defaultDocBlock, $removeMatching = '' ) { $this->reflection = $reflection; $this->linesToAppend = $linesToAppend; $this->defaultDocBlock = $defaultDocBlock; $this->removeMatching = $removeMatching; } /** * Performs update on class file and lints the output. If the output fails * linting, the change is reverted. * * @return bool TRUE on success, FALSE on failure */ public function update() { // copy the code into memory $backup = file($this->reflection->getFileName()); list($preamble, $class) = $this->splitClassFile($backup); $preamble = $this->stripOutExistingDocBlock($preamble); $preamble .= $this->buildUpdatedDocBlock(); if ($this->writeClassFile(implode(PHP_EOL, [$preamble, $class])) && $this->commandLineLint($this->reflection->getFileName()) ) { return true; } $this->writeClassFile(implode('', $backup)); return false; } private function splitClassFile(array $lines) { $classLineOffset = $this->reflection->getStartLine() - 1; return [ implode('', array_slice($lines, 0, $classLineOffset)), implode('', array_slice($lines, $classLineOffset)), ]; } private function stripOutExistingDocBlock($preamble) { if ($this->reflection->getDocComment()) { return str_replace( $this->reflection->getDocComment() . PHP_EOL, '', $preamble ); } return $preamble; } private function buildUpdatedDocBlock() { $docBlockLines = explode( PHP_EOL, $this->reflection->getDocComment() ?: $this->defaultDocBlock ); // remove lines matching exclusion patterns if ($this->removeMatching) { $docBlockLines = array_filter($docBlockLines, function ($line) { return !preg_match($this->removeMatching, trim($line)); }); } // hold on to the closing line $lastLine = array_pop($docBlockLines); // add a padding line if needed if (' *' !== end($docBlockLines)) { $docLines []= ' *'; } // append API @method annotations $docBlockLines = array_merge($docBlockLines, $this->linesToAppend); // add back the closing line $docBlockLines []= $lastLine; // send everything back as a string return implode(PHP_EOL, $docBlockLines); } private function writeClassFile($contents) { return (bool) file_put_contents( $this->reflection->getFileName(), $contents, LOCK_EX ); } }