Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
203
vendor/league/uri-components/Components/Port.php
vendored
Normal file
203
vendor/league/uri-components/Components/Port.php
vendored
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* League.Uri (https://uri.thephpleague.com)
|
||||
*
|
||||
* (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace League\Uri\Components;
|
||||
|
||||
use BackedEnum;
|
||||
use Deprecated;
|
||||
use League\Uri\Contracts\AuthorityInterface;
|
||||
use League\Uri\Contracts\PortInterface;
|
||||
use League\Uri\Contracts\UriComponentInterface;
|
||||
use League\Uri\Contracts\UriException;
|
||||
use League\Uri\Contracts\UriInterface;
|
||||
use League\Uri\Exceptions\SyntaxError;
|
||||
use League\Uri\StringCoercionMode;
|
||||
use League\Uri\UriScheme;
|
||||
use Psr\Http\Message\UriInterface as Psr7UriInterface;
|
||||
use Stringable;
|
||||
use Uri\Rfc3986\Uri as Rfc3986Uri;
|
||||
use Uri\WhatWg\Url as WhatWgUrl;
|
||||
|
||||
use function array_map;
|
||||
use function filter_var;
|
||||
|
||||
use const FILTER_VALIDATE_INT;
|
||||
|
||||
final class Port extends Component implements PortInterface
|
||||
{
|
||||
private readonly ?int $port;
|
||||
private ?array $cachedDefaultSchemes = null;
|
||||
|
||||
/**
|
||||
* New instance.
|
||||
*/
|
||||
private function __construct(BackedEnum|Stringable|string|int|null $port = null)
|
||||
{
|
||||
$this->port = $this->validate($port);
|
||||
}
|
||||
|
||||
public static function new(BackedEnum|Stringable|string|int|null $value = null): self
|
||||
{
|
||||
return new self($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance from a string.or a stringable structure or returns null on failure.
|
||||
*/
|
||||
public static function tryNew(BackedEnum|Stringable|string|int|null $uri = null): ?self
|
||||
{
|
||||
try {
|
||||
return self::new($uri);
|
||||
} catch (UriException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance from a URI object.
|
||||
*/
|
||||
public static function fromUri(WhatWgUrl|Rfc3986Uri|BackedEnum|Stringable|string $uri): self
|
||||
{
|
||||
return new self(self::filterUri($uri)->getPort());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance from an Authority object.
|
||||
*/
|
||||
public static function fromAuthority(BackedEnum|Stringable|string|null $authority): self
|
||||
{
|
||||
return match (true) {
|
||||
$authority instanceof AuthorityInterface => new self($authority->getPort()),
|
||||
default => new self(Authority::new($authority)->getPort()),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a port.
|
||||
*
|
||||
* @throws SyntaxError if the port is invalid
|
||||
*/
|
||||
private function validate(BackedEnum|Stringable|int|string|null $port): ?int
|
||||
{
|
||||
$port = self::filterComponent($port);
|
||||
if (null === $port) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$fport = filter_var($port, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]);
|
||||
if (false !== $fport) {
|
||||
return $fport;
|
||||
}
|
||||
|
||||
throw new SyntaxError('Expected port to be a positive integer or 0; received '.$port.'.');
|
||||
}
|
||||
|
||||
public function value(): ?string
|
||||
{
|
||||
return match (null) {
|
||||
$this->port => $this->port,
|
||||
default => (string) $this->port,
|
||||
};
|
||||
}
|
||||
|
||||
public function equals(mixed $value): bool
|
||||
{
|
||||
if (!StringCoercionMode::Native->isCoercible($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$value instanceof UriComponentInterface) {
|
||||
$value = self::tryNew(StringCoercionMode::Native->coerce($value));
|
||||
if (null === $value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $value->getUriComponent() === $this->getUriComponent();
|
||||
}
|
||||
|
||||
public function getUriComponent(): string
|
||||
{
|
||||
return match (null) {
|
||||
$this->port => '',
|
||||
default => ':'.$this->value(),
|
||||
};
|
||||
}
|
||||
|
||||
public function toInt(): ?int
|
||||
{
|
||||
return $this->port;
|
||||
}
|
||||
|
||||
public function defaultScheme(): ?Scheme
|
||||
{
|
||||
return $this->defaultSchemes()[0] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<Scheme>
|
||||
*/
|
||||
public function defaultSchemes(): array
|
||||
{
|
||||
return $this->cachedDefaultSchemes ??= array_map(
|
||||
fn (UriScheme $schemePort): Scheme => Scheme::new($schemePort->value),
|
||||
UriScheme::fromPort($this->port)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATION WARNING! This method will be removed in the next major point release.
|
||||
*
|
||||
* @deprecated Since version 7.0.0
|
||||
* @see Port::fromUri()
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* Create a new instance from a URI object.
|
||||
*/
|
||||
#[Deprecated(message:'use League\Uri\Components\Port::fromUri() instead', since:'league/uri-components:7.0.0')]
|
||||
public static function createFromUri(Psr7UriInterface|UriInterface $uri): self
|
||||
{
|
||||
return self::fromUri($uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATION WARNING! This method will be removed in the next major point release.
|
||||
*
|
||||
* @deprecated Since version 7.0.0
|
||||
* @see Port::fromAuthority()
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* Create a new instance from an Authority object.
|
||||
*/
|
||||
#[Deprecated(message:'use League\Uri\Components\Port::fromAuthority() instead', since:'league/uri-components:7.0.0')]
|
||||
public static function createFromAuthority(AuthorityInterface|Stringable|string $authority): self
|
||||
{
|
||||
return self::fromAuthority($authority);
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATION WARNING! This method will be removed in the next major point release.
|
||||
*
|
||||
* @deprecated Since version 7.0.0
|
||||
* @see Port::new()
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
#[Deprecated(message:'use League\Uri\Components\Port::new() instead', since:'league/uri-components:7.0.0')]
|
||||
public static function fromInt(int $port): self
|
||||
{
|
||||
return self::new($port);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue