One Hat Cyber Team
Your IP:
216.73.216.176
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
proc
/
self
/
root
/
proc
/
thread-self
/
cwd
/
Edit File:
Builder.tar
DegradedUuidBuilder.php 0000644 00000004114 15110774145 0011117 0 ustar 00 <?php /** * This file is part of the ramsey/uuid library * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT */ declare(strict_types=1); namespace Ramsey\Uuid\Builder; use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Converter\NumberConverterInterface; use Ramsey\Uuid\Converter\Time\DegradedTimeConverter; use Ramsey\Uuid\Converter\TimeConverterInterface; use Ramsey\Uuid\DegradedUuid; use Ramsey\Uuid\Rfc4122\Fields as Rfc4122Fields; use Ramsey\Uuid\UuidInterface; /** * @deprecated DegradedUuid instances are no longer necessary to support 32-bit * systems. Transition to {@see DefaultUuidBuilder}. * * @psalm-immutable */ class DegradedUuidBuilder implements UuidBuilderInterface { private TimeConverterInterface $timeConverter; /** * @param NumberConverterInterface $numberConverter The number converter to * use when constructing the DegradedUuid * @param TimeConverterInterface|null $timeConverter The time converter to use * for converting timestamps extracted from a UUID to Unix timestamps */ public function __construct( private NumberConverterInterface $numberConverter, ?TimeConverterInterface $timeConverter = null ) { $this->timeConverter = $timeConverter ?: new DegradedTimeConverter(); } /** * Builds and returns a DegradedUuid * * @param CodecInterface $codec The codec to use for building this DegradedUuid instance * @param string $bytes The byte string from which to construct a UUID * * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid * * @psalm-pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { return new DegradedUuid( new Rfc4122Fields($bytes), $this->numberConverter, $codec, $this->timeConverter ); } } DefaultUuidBuilder.php 0000644 00000001070 15110774145 0011002 0 ustar 00 <?php /** * This file is part of the ramsey/uuid library * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT */ declare(strict_types=1); namespace Ramsey\Uuid\Builder; use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; /** * @deprecated Transition to {@see Rfc4122UuidBuilder}. * * @psalm-immutable */ class DefaultUuidBuilder extends Rfc4122UuidBuilder { } BuilderCollection.php 0000644 00000005336 15110774145 0010673 0 ustar 00 <?php /** * This file is part of the ramsey/uuid library * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT */ declare(strict_types=1); namespace Ramsey\Uuid\Builder; use Ramsey\Collection\AbstractCollection; use Ramsey\Uuid\Converter\Number\GenericNumberConverter; use Ramsey\Uuid\Converter\Time\GenericTimeConverter; use Ramsey\Uuid\Converter\Time\PhpTimeConverter; use Ramsey\Uuid\Guid\GuidBuilder; use Ramsey\Uuid\Math\BrickMathCalculator; use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; use Traversable; /** * A collection of UuidBuilderInterface objects * * @deprecated this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from * a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced * at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use * more generic types like `iterable<T>` instead. * * @extends AbstractCollection<UuidBuilderInterface> */ class BuilderCollection extends AbstractCollection { public function getType(): string { return UuidBuilderInterface::class; } /** * @psalm-mutation-free * @psalm-suppress ImpureMethodCall * @psalm-suppress InvalidTemplateParam */ public function getIterator(): Traversable { return parent::getIterator(); } /** * Re-constructs the object from its serialized form * * @param string $serialized The serialized PHP string to unserialize into * a UuidInterface instance * * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint * @psalm-suppress RedundantConditionGivenDocblockType */ public function unserialize($serialized): void { /** @var array<array-key, UuidBuilderInterface> $data */ $data = unserialize($serialized, [ 'allowed_classes' => [ BrickMathCalculator::class, GenericNumberConverter::class, GenericTimeConverter::class, GuidBuilder::class, NonstandardUuidBuilder::class, PhpTimeConverter::class, Rfc4122UuidBuilder::class, ], ]); $this->data = array_filter( $data, function ($unserialized): bool { return $unserialized instanceof UuidBuilderInterface; } ); } } FallbackBuilder.php 0000644 00000003555 15110774145 0010300 0 ustar 00 <?php /** * This file is part of the ramsey/uuid library * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT */ declare(strict_types=1); namespace Ramsey\Uuid\Builder; use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Exception\BuilderNotFoundException; use Ramsey\Uuid\Exception\UnableToBuildUuidException; use Ramsey\Uuid\UuidInterface; /** * FallbackBuilder builds a UUID by stepping through a list of UUID builders * until a UUID can be constructed without exceptions * * @psalm-immutable */ class FallbackBuilder implements UuidBuilderInterface { /** * @param iterable<UuidBuilderInterface> $builders An array of UUID builders */ public function __construct(private iterable $builders) { } /** * Builds and returns a UuidInterface instance using the first builder that * succeeds * * @param CodecInterface $codec The codec to use for building this instance * @param string $bytes The byte string from which to construct a UUID * * @return UuidInterface an instance of a UUID object * * @psalm-pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { $lastBuilderException = null; foreach ($this->builders as $builder) { try { return $builder->build($codec, $bytes); } catch (UnableToBuildUuidException $exception) { $lastBuilderException = $exception; continue; } } throw new BuilderNotFoundException( 'Could not find a suitable builder for the provided codec and fields', 0, $lastBuilderException ); } } UuidBuilderInterface.php 0000644 00000002017 15110774145 0011320 0 ustar 00 <?php /** * This file is part of the ramsey/uuid library * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> * @license http://opensource.org/licenses/MIT MIT */ declare(strict_types=1); namespace Ramsey\Uuid\Builder; use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\UuidInterface; /** * A UUID builder builds instances of UuidInterface * * @psalm-immutable */ interface UuidBuilderInterface { /** * Builds and returns a UuidInterface * * @param CodecInterface $codec The codec to use for building this UuidInterface instance * @param string $bytes The byte string from which to construct a UUID * * @return UuidInterface Implementations may choose to return more specific * instances of UUIDs that implement UuidInterface * * @psalm-pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface; } NodeBuilderInterface.php 0000644 00000004165 15111156460 0011300 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Builder; use Tree\Node\NodeInterface; /** * Interface that allows a fluent tree building. * * @author Nicolò Martini <nicmartnic@gmail.com> */ interface NodeBuilderInterface { /** * Set the node the builder will manage. * * @param NodeInterface $node * * @return NodeBuilderInterface The current instance */ public function setNode(NodeInterface $node); /** * Get the node the builder manages. * * @return NodeInterface */ public function getNode(); /** * Set the value of the underlaying node. * * @param mixed $value * * @return NodebuilderInterface The current instance */ public function value($value); /** * Add a leaf to the node. * * @param mixed $value The value of the leaf node * * @return NodeBuilderInterface The current instance */ public function leaf($value = null); /** * Add several leafs to the node. * * @param $value, ... An arbitrary long list of values * * @return NodeBuilderInterface The current instance */ public function leafs($value); /** * Add a child to the node enter in its scope. * * @param null $value * * @return NodeBuilderInterface A NodeBuilderInterface instance linked to the child node */ public function tree($value = null); /** * Goes up to the parent node context. * * @return null|NodeBuilderInterface A NodeBuilderInterface instanced linked to the parent node */ public function end(); /** * Return a node instance set with the given value. Implementation can follow their own logic * in choosing the NodeInterface implmentation taking into account the value. * * @param mixed $value * * @return NodeInterface */ public function nodeInstanceByValue($value = null); } NodeBuilder.php 0000644 00000004036 15111156460 0007454 0 ustar 00 <?php /** * Copyright (c) 2013-2020 Nicolò Martini * * For the full copyright and license information, please view * the LICENSE.md file that was distributed with this source code. * * @see https://github.com/nicmart/Tree */ namespace Tree\Builder; use Tree\Node\Node; use Tree\Node\NodeInterface; /** * Main implementation of the NodeBuilderInterface. */ class NodeBuilder implements NodeBuilderInterface { /** * @var NodeInterface[] */ private $nodeStack = []; public function __construct(?NodeInterface $node = null) { $this->setNode($node ?: $this->nodeInstanceByValue()); } public function setNode(NodeInterface $node) { $this ->emptyStack() ->pushNode($node); return $this; } public function getNode() { return $this->nodeStack[\count($this->nodeStack) - 1]; } public function leaf($value = null) { $this->getNode()->addChild( $this->nodeInstanceByValue($value) ); return $this; } public function leafs($value1 /*, $value2, ... */) { foreach (\func_get_args() as $value) { $this->leaf($value); } return $this; } public function tree($value = null) { $node = $this->nodeInstanceByValue($value); $this->getNode()->addChild($node); $this->pushNode($node); return $this; } public function end() { $this->popNode(); return $this; } public function nodeInstanceByValue($value = null) { return new Node($value); } public function value($value) { $this->getNode()->setValue($value); return $this; } private function emptyStack() { $this->nodeStack = []; return $this; } private function pushNode(NodeInterface $node) { \array_push($this->nodeStack, $node); return $this; } private function popNode() { return \array_pop($this->nodeStack); } } ResponseBuilder.php 0000644 00000007461 15111417003 0010363 0 ustar 00 <?php namespace Http\Message\Builder; use Psr\Http\Message\ResponseInterface; /** * Fills response object with values. */ class ResponseBuilder { /** * The response to be built. * * @var ResponseInterface */ protected $response; /** * Create builder for the given response. */ public function __construct(ResponseInterface $response) { $this->response = $response; } /** * Return response. * * @return ResponseInterface */ public function getResponse() { return $this->response; } /** * Add headers represented by an array of header lines. * * @param string[] $headers response headers as array of header lines * * @return $this * * @throws \UnexpectedValueException for invalid header values * @throws \InvalidArgumentException for invalid status code arguments */ public function setHeadersFromArray(array $headers) { $status = array_shift($headers); $this->setStatus($status); foreach ($headers as $headerLine) { $headerLine = trim($headerLine); if ('' === $headerLine) { continue; } $this->addHeader($headerLine); } return $this; } /** * Add headers represented by a single string. * * @param string $headers response headers as single string * * @return $this * * @throws \InvalidArgumentException if $headers is not a string on object with __toString() * @throws \UnexpectedValueException for invalid header values */ public function setHeadersFromString($headers) { if (!(is_string($headers) || (is_object($headers) && method_exists($headers, '__toString'))) ) { throw new \InvalidArgumentException( sprintf( '%s expects parameter 1 to be a string, %s given', __METHOD__, is_object($headers) ? get_class($headers) : gettype($headers) ) ); } $this->setHeadersFromArray(explode("\r\n", $headers)); return $this; } /** * Set response status from a status string. * * @param string $statusLine response status as a string * * @return $this * * @throws \InvalidArgumentException for invalid status line */ public function setStatus($statusLine) { $parts = explode(' ', $statusLine, 3); if (count($parts) < 2 || 0 !== strpos(strtolower($parts[0]), 'http/')) { throw new \InvalidArgumentException( sprintf('"%s" is not a valid HTTP status line', $statusLine) ); } $reasonPhrase = count($parts) > 2 ? $parts[2] : ''; $this->response = $this->response ->withStatus((int) $parts[1], $reasonPhrase) ->withProtocolVersion(substr($parts[0], 5)); return $this; } /** * Add header represented by a string. * * @param string $headerLine response header as a string * * @return $this * * @throws \InvalidArgumentException for invalid header names or values */ public function addHeader($headerLine) { $parts = explode(':', $headerLine, 2); if (2 !== count($parts)) { throw new \InvalidArgumentException( sprintf('"%s" is not a valid HTTP header line', $headerLine) ); } $name = trim($parts[0]); $value = trim($parts[1]); if ($this->response->hasHeader($name)) { $this->response = $this->response->withAddedHeader($name, $value); } else { $this->response = $this->response->withHeader($name, $value); } return $this; } }
Simpan