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
57
vendor/ramsey/collection/src/Tool/TypeTrait.php
vendored
Normal file
57
vendor/ramsey/collection/src/Tool/TypeTrait.php
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/collection 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\Collection\Tool;
|
||||
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use function is_callable;
|
||||
use function is_float;
|
||||
use function is_int;
|
||||
use function is_numeric;
|
||||
use function is_object;
|
||||
use function is_resource;
|
||||
use function is_scalar;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
* Provides functionality to check values for specific types.
|
||||
*/
|
||||
trait TypeTrait
|
||||
{
|
||||
/**
|
||||
* Returns `true` if value is of the specified type.
|
||||
*
|
||||
* @param string $type The type to check the value against.
|
||||
* @param mixed $value The value to check.
|
||||
*/
|
||||
protected function checkType(string $type, mixed $value): bool
|
||||
{
|
||||
return match ($type) {
|
||||
'array' => is_array($value),
|
||||
'bool', 'boolean' => is_bool($value),
|
||||
'callable' => is_callable($value),
|
||||
'float', 'double' => is_float($value),
|
||||
'int', 'integer' => is_int($value),
|
||||
'null' => $value === null,
|
||||
'numeric' => is_numeric($value),
|
||||
'object' => is_object($value),
|
||||
'resource' => is_resource($value),
|
||||
'scalar' => is_scalar($value),
|
||||
'string' => is_string($value),
|
||||
'mixed' => true,
|
||||
default => $value instanceof $type,
|
||||
};
|
||||
}
|
||||
}
|
||||
100
vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php
vendored
Normal file
100
vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/collection 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\Collection\Tool;
|
||||
|
||||
use Ramsey\Collection\Exception\InvalidPropertyOrMethod;
|
||||
use Ramsey\Collection\Exception\UnsupportedOperationException;
|
||||
use ReflectionProperty;
|
||||
|
||||
use function is_array;
|
||||
use function is_object;
|
||||
use function method_exists;
|
||||
use function property_exists;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Provides functionality to extract the value of a property or method from an object.
|
||||
*/
|
||||
trait ValueExtractorTrait
|
||||
{
|
||||
/**
|
||||
* Returns the type associated with this collection.
|
||||
*/
|
||||
abstract public function getType(): string;
|
||||
|
||||
/**
|
||||
* Extracts the value of the given property, method, or array key from the
|
||||
* element.
|
||||
*
|
||||
* If `$propertyOrMethod` is `null`, we return the element as-is.
|
||||
*
|
||||
* @param mixed $element The element to extract the value from.
|
||||
* @param string | null $propertyOrMethod The property or method for which the
|
||||
* value should be extracted.
|
||||
*
|
||||
* @return mixed the value extracted from the specified property, method,
|
||||
* or array key, or the element itself.
|
||||
*
|
||||
* @throws InvalidPropertyOrMethod
|
||||
* @throws UnsupportedOperationException
|
||||
*/
|
||||
protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed
|
||||
{
|
||||
if ($propertyOrMethod === null) {
|
||||
return $element;
|
||||
}
|
||||
|
||||
if (!is_object($element) && !is_array($element)) {
|
||||
throw new UnsupportedOperationException(sprintf(
|
||||
'The collection type "%s" does not support the $propertyOrMethod parameter',
|
||||
$this->getType(),
|
||||
));
|
||||
}
|
||||
|
||||
if (is_array($element)) {
|
||||
return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf(
|
||||
'Key or index "%s" not found in collection elements',
|
||||
$propertyOrMethod,
|
||||
));
|
||||
}
|
||||
|
||||
if (property_exists($element, $propertyOrMethod) && method_exists($element, $propertyOrMethod)) {
|
||||
$reflectionProperty = new ReflectionProperty($element, $propertyOrMethod);
|
||||
if ($reflectionProperty->isPublic()) {
|
||||
return $element->$propertyOrMethod;
|
||||
}
|
||||
|
||||
return $element->{$propertyOrMethod}();
|
||||
}
|
||||
|
||||
if (property_exists($element, $propertyOrMethod)) {
|
||||
return $element->$propertyOrMethod;
|
||||
}
|
||||
|
||||
if (method_exists($element, $propertyOrMethod)) {
|
||||
return $element->{$propertyOrMethod}();
|
||||
}
|
||||
|
||||
if (isset($element->$propertyOrMethod)) {
|
||||
return $element->$propertyOrMethod;
|
||||
}
|
||||
|
||||
throw new InvalidPropertyOrMethod(sprintf(
|
||||
'Method or property "%s" not defined in %s',
|
||||
$propertyOrMethod,
|
||||
$element::class,
|
||||
));
|
||||
}
|
||||
}
|
||||
92
vendor/ramsey/collection/src/Tool/ValueToStringTrait.php
vendored
Normal file
92
vendor/ramsey/collection/src/Tool/ValueToStringTrait.php
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/collection 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\Collection\Tool;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
use function assert;
|
||||
use function get_resource_type;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use function is_callable;
|
||||
use function is_object;
|
||||
use function is_resource;
|
||||
use function is_scalar;
|
||||
|
||||
/**
|
||||
* Provides functionality to express a value as string
|
||||
*/
|
||||
trait ValueToStringTrait
|
||||
{
|
||||
/**
|
||||
* Returns a string representation of the value.
|
||||
*
|
||||
* - null value: `'NULL'`
|
||||
* - boolean: `'TRUE'`, `'FALSE'`
|
||||
* - array: `'Array'`
|
||||
* - scalar: converted-value
|
||||
* - resource: `'(type resource #number)'`
|
||||
* - object with `__toString()`: result of `__toString()`
|
||||
* - object DateTime: ISO 8601 date
|
||||
* - object: `'(className Object)'`
|
||||
* - anonymous function: same as object
|
||||
*
|
||||
* @param mixed $value the value to return as a string.
|
||||
*/
|
||||
protected function toolValueToString(mixed $value): string
|
||||
{
|
||||
// null
|
||||
if ($value === null) {
|
||||
return 'NULL';
|
||||
}
|
||||
|
||||
// boolean constants
|
||||
if (is_bool($value)) {
|
||||
return $value ? 'TRUE' : 'FALSE';
|
||||
}
|
||||
|
||||
// array
|
||||
if (is_array($value)) {
|
||||
return 'Array';
|
||||
}
|
||||
|
||||
// scalar types (integer, float, string)
|
||||
if (is_scalar($value)) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
// resource
|
||||
if (is_resource($value)) {
|
||||
return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')';
|
||||
}
|
||||
|
||||
// From here, $value should be an object.
|
||||
assert(is_object($value));
|
||||
|
||||
// __toString() is implemented
|
||||
if (is_callable([$value, '__toString'])) {
|
||||
/** @var string */
|
||||
return $value->__toString();
|
||||
}
|
||||
|
||||
// object of type \DateTime
|
||||
if ($value instanceof DateTimeInterface) {
|
||||
return $value->format('c');
|
||||
}
|
||||
|
||||
// unknown type
|
||||
return '(' . $value::class . ' Object)';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue