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
113
vendor/league/csv/src/Query/Ordering/Column.php
vendored
Normal file
113
vendor/league/csv/src/Query/Ordering/Column.php
vendored
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* League.Csv (https://csv.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\Csv\Query\Ordering;
|
||||
|
||||
use ArrayIterator;
|
||||
use Closure;
|
||||
use Iterator;
|
||||
use League\Csv\Query\QueryException;
|
||||
use League\Csv\Query\Row;
|
||||
use League\Csv\Query\Sort;
|
||||
use OutOfBoundsException;
|
||||
use ReflectionException;
|
||||
|
||||
use function is_array;
|
||||
use function is_string;
|
||||
use function iterator_to_array;
|
||||
use function strtoupper;
|
||||
use function trim;
|
||||
|
||||
/**
|
||||
* Enable sorting a record based on the value of a one of its cell.
|
||||
*/
|
||||
final class Column implements Sort
|
||||
{
|
||||
private const ASCENDING = 'ASC';
|
||||
private const DESCENDING = 'DESC';
|
||||
|
||||
/**
|
||||
* @param Closure(mixed, mixed): int $callback
|
||||
*/
|
||||
private function __construct(
|
||||
public readonly string $direction,
|
||||
public readonly string|int $column,
|
||||
public readonly Closure $callback,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (callable(mixed, mixed): int)|(Closure(mixed, mixed): int)|null $callback
|
||||
*
|
||||
* @throws QueryException
|
||||
*/
|
||||
public static function sortOn(
|
||||
string|int $column,
|
||||
string|int $direction,
|
||||
Closure|callable|null $callback = null
|
||||
): self {
|
||||
|
||||
$operator = match (true) {
|
||||
SORT_ASC === $direction => self::ASCENDING,
|
||||
SORT_DESC === $direction => self::DESCENDING,
|
||||
is_string($direction) => match (strtoupper(trim($direction))) {
|
||||
'ASC', 'ASCENDING', 'UP' => self::ASCENDING,
|
||||
'DESC', 'DESCENDING', 'DOWN' => self::DESCENDING,
|
||||
default => throw new QueryException('Unknown or unsupported ordering operator value: '.$direction),
|
||||
},
|
||||
default => throw new QueryException('Unknown or unsupported ordering operator value: '.$direction),
|
||||
};
|
||||
|
||||
$callback = match (true) {
|
||||
null === $callback => static fn (mixed $first, mixed $second): int => $first <=> $second,
|
||||
$callback instanceof Closure => $callback,
|
||||
default => $callback(...),
|
||||
};
|
||||
|
||||
return new self($operator, $column, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ReflectionException
|
||||
* @throws QueryException
|
||||
*/
|
||||
public function __invoke(mixed $valueA, mixed $valueB): int
|
||||
{
|
||||
$first = Row::from($valueA)->value($this->column);
|
||||
$second = Row::from($valueB)->value($this->column);
|
||||
|
||||
return match ($this->direction) {
|
||||
self::ASCENDING => ($this->callback)($first, $second),
|
||||
default => ($this->callback)($second, $first),
|
||||
};
|
||||
}
|
||||
|
||||
public function sort(iterable $value): Iterator
|
||||
{
|
||||
$class = new class () extends ArrayIterator {
|
||||
public function seek(int $offset): void
|
||||
{
|
||||
try {
|
||||
parent::seek($offset);
|
||||
} catch (OutOfBoundsException) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$it = new $class(!is_array($value) ? iterator_to_array($value) : $value);
|
||||
$it->uasort($this);
|
||||
|
||||
return $it;
|
||||
}
|
||||
}
|
||||
115
vendor/league/csv/src/Query/Ordering/MultiSort.php
vendored
Normal file
115
vendor/league/csv/src/Query/Ordering/MultiSort.php
vendored
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* League.Csv (https://csv.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\Csv\Query\Ordering;
|
||||
|
||||
use ArrayIterator;
|
||||
use Closure;
|
||||
use Iterator;
|
||||
use League\Csv\MapIterator;
|
||||
use League\Csv\Query\Sort;
|
||||
use League\Csv\Query\SortCombinator;
|
||||
use OutOfBoundsException;
|
||||
|
||||
use function array_map;
|
||||
|
||||
/**
|
||||
* Enable sorting a record based on multiple column.
|
||||
*
|
||||
* The class can be used with PHP's usort and uasort functions.
|
||||
*
|
||||
* @phpstan-import-type Ordering from SortCombinator
|
||||
* @phpstan-import-type OrderingExtended from SortCombinator
|
||||
*/
|
||||
final class MultiSort implements SortCombinator
|
||||
{
|
||||
/** @var array<Ordering> */
|
||||
private readonly array $sorts;
|
||||
|
||||
/**
|
||||
* @param OrderingExtended ...$sorts
|
||||
*/
|
||||
private function __construct(Sort|Closure|callable ...$sorts)
|
||||
{
|
||||
$this->sorts = array_map(
|
||||
static fn (Sort|Closure|callable $sort): Sort|Closure => $sort instanceof Closure || $sort instanceof Sort ? $sort : $sort(...),
|
||||
$sorts
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderingExtended ...$sorts
|
||||
*/
|
||||
public static function all(Sort|Closure|callable ...$sorts): self
|
||||
{
|
||||
return new self(...$sorts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderingExtended ...$sorts
|
||||
*/
|
||||
public function append(Sort|Closure|callable ...$sorts): self
|
||||
{
|
||||
if ([] === $sorts) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
return new self(...$this->sorts, ...$sorts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderingExtended ...$sorts
|
||||
*/
|
||||
public function prepend(Sort|Closure|callable ...$sorts): self
|
||||
{
|
||||
if ([] === $sorts) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
return (new self(...$sorts))->append(...$this->sorts);
|
||||
}
|
||||
|
||||
public function __invoke(mixed $valueA, mixed $valueB): int
|
||||
{
|
||||
foreach ($this->sorts as $sort) {
|
||||
if (0 !== ($result = $sort($valueA, $valueB))) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return $result ?? 0;
|
||||
}
|
||||
|
||||
public function sort(iterable $value): Iterator
|
||||
{
|
||||
if ([] === $this->sorts) {
|
||||
return MapIterator::toIterator($value);
|
||||
}
|
||||
|
||||
$class = new class () extends ArrayIterator {
|
||||
public function seek(int $offset): void
|
||||
{
|
||||
try {
|
||||
parent::seek($offset);
|
||||
} catch (OutOfBoundsException) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$it = new $class(!is_array($value) ? iterator_to_array($value) : $value);
|
||||
$it->uasort($this);
|
||||
|
||||
return $it;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue