From ec18a4fe0f2ae3542c8c465d79c1ccd3af0281e7 Mon Sep 17 00:00:00 2001 From: Joe Huss Date: Wed, 20 May 2026 00:50:50 -0400 Subject: [PATCH 1/2] chore: add .caliber/ to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6520838..e203881 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /coverage-report/ /coverage.xml /build/ +.caliber/ From 00d2f0b3032414c0fe5363afa794ba09e8ed6f76 Mon Sep 17 00:00:00 2001 From: Joe Huss Date: Wed, 20 May 2026 00:51:56 -0400 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20rename=20phlex=20=E2=86=92=20phlix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 24 ++++---- CHANGELOG.md | 48 +++++++-------- LICENSE | 2 +- README.md | 30 +++++----- composer.json | 8 +-- phpcs.xml.dist | 4 +- src/Arr/ArrClientFactory.php | 4 +- src/Arr/ArrClientInterface.php | 4 +- src/Arr/BazarrClient.php | 4 +- src/Arr/ProwlarrClient.php | 4 +- src/Arr/RadarrClient.php | 4 +- src/Arr/SonarrClient.php | 4 +- src/Arr/SyncResult.php | 4 +- src/Arr/TrashGuidesProvider.php | 6 +- src/Auth/AuthResult.php | 8 +-- src/Auth/JwtClaims.php | 16 ++--- src/Auth/ProviderInterface.php | 12 ++-- src/Auth/UserInfo.php | 8 +-- src/Events/AbstractEvent.php | 6 +- src/Events/Auth/UserCreated.php | 10 ++-- src/Events/Auth/UserLoggedIn.php | 10 ++-- src/Events/Auth/UserLoggedOut.php | 10 ++-- src/Events/Library/LibraryScanCompleted.php | 10 ++-- src/Events/Library/LibraryScanStarted.php | 10 ++-- src/Events/Library/MediaItemAdded.php | 10 ++-- src/Events/Library/MediaItemRemoved.php | 10 ++-- src/Events/Library/MediaItemUpdated.php | 12 ++-- src/Events/Playback/PlaybackPaused.php | 10 ++-- src/Events/Playback/PlaybackResumed.php | 10 ++-- src/Events/Playback/PlaybackStarted.php | 10 ++-- src/Events/Playback/PlaybackStopped.php | 12 ++-- src/Hub/ClaimRequest.php | 6 +- src/Hub/ClaimResponse.php | 4 +- src/Hub/HeartbeatDto.php | 4 +- src/Hub/ServerInfoDto.php | 4 +- src/Plugin/EventNameMap.php | 60 +++++++++---------- src/Plugin/LifecycleInterface.php | 12 ++-- src/Plugin/Manifest.php | 28 ++++----- src/Plugin/ManifestType.php | 8 +-- src/Plugin/ManifestValidationError.php | 12 ++-- src/Version.php | 8 +-- tests/Arr/ArrClientFactoryTest.php | 10 ++-- tests/Arr/BazarrClientTest.php | 6 +- tests/Arr/ProwlarrClientTest.php | 6 +- tests/Arr/RadarrClientTest.php | 6 +- tests/Arr/SonarrClientTest.php | 6 +- tests/Arr/TrashGuidesProviderTest.php | 20 +++---- tests/Auth/JwtClaimsTest.php | 30 +++++----- tests/Events/AbstractEventTest.php | 6 +- tests/Events/Auth/UserCreatedTest.php | 16 ++--- .../Library/LibraryScanCompletedTest.php | 24 ++++---- tests/Events/Playback/PlaybackStartedTest.php | 20 +++---- tests/Hub/ClaimRequestTest.php | 8 +-- tests/Hub/ClaimResponseTest.php | 6 +- tests/Hub/HeartbeatDtoTest.php | 6 +- tests/Hub/ServerInfoDtoTest.php | 6 +- tests/Plugin/EventNameMapTest.php | 56 ++++++++--------- tests/Plugin/LifecycleInterfaceTest.php | 4 +- tests/Plugin/ManifestTest.php | 28 ++++----- tests/Plugin/ManifestTypeTest.php | 6 +- tests/Plugin/ManifestValidationErrorTest.php | 6 +- tests/VersionTest.php | 6 +- 62 files changed, 376 insertions(+), 376 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b9817aa..46555fb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ -# AGENTS.md — detain/phlex-shared +# AGENTS.md — detain/phlix-shared -Agent brief for the `phlex-shared` package. This package is **pure +Agent brief for the `phlix-shared` package. This package is **pure interfaces and value objects**. Keep it that way. ## Conventions @@ -9,8 +9,8 @@ interfaces and value objects**. Keep it that way. first-class callable syntax, etc.) where they aid clarity. - **`declare(strict_types=1);`** at the top of every PHP file. - **PSR-12** coding standard, enforced by phpcs. -- **PSR-4 autoload** — `Phlex\Shared\` → `src/`, - `Phlex\Shared\Tests\` → `tests/`. Namespaces mirror directories. +- **PSR-4 autoload** — `Phlix\Shared\` → `src/`, + `Phlix\Shared\Tests\` → `tests/`. Namespaces mirror directories. - **Static analysis bar:** PHPStan level 9 and Psalm errorLevel 1, both green from day 1. No baselines. - **Zero I/O.** No filesystem reads, no network, no DB, no logging @@ -28,11 +28,11 @@ interfaces and value objects**. Keep it that way. ``` src/ - Plugin/ # Phlex\Shared\Plugin\* — lifecycle, manifest, types - Events/ # Phlex\Shared\Events\* — event name constants & DTOs - Auth/ # Phlex\Shared\Auth\* — token, identity, claim types - Hub/ # Phlex\Shared\Hub\* — phlex ↔ phlex-hub protocol types - Arr/ # Phlex\Shared\Arr\* — typed array helpers (PHPStan-friendly) + Plugin/ # Phlix\Shared\Plugin\* — lifecycle, manifest, types + Events/ # Phlix\Shared\Events\* — event name constants & DTOs + Auth/ # Phlix\Shared\Auth\* — token, identity, claim types + Hub/ # Phlix\Shared\Hub\* — phlix ↔ phlix-hub protocol types + Arr/ # Phlix\Shared\Arr\* — typed array helpers (PHPStan-friendly) Version.php tests/ (mirror of src/ — PHPUnit 10) @@ -44,10 +44,10 @@ Subdirectories materialise as B.3 lands real interfaces. ## Layout rationale See `plans/expansion/b.1-shared-design.md` in -[`detain/phlex`](https://github.com/detain/phlex) for the full WHAT +[`detain/phlix`](https://github.com/detain/phlix) for the full WHAT MOVES WHERE table and the design rationale for the namespace split. Do not re-litigate that design here — propose changes in a new plan -step against `detain/phlex` if needed. +step against `detain/phlix` if needed. ## Before committing @@ -64,5 +64,5 @@ If any tool emits warnings, fix the code — do not add to a baseline. ## Versioning [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Bump the -`Phlex\Shared\Version::VERSION` constant in lockstep with the git tag +`Phlix\Shared\Version::VERSION` constant in lockstep with the git tag and the `CHANGELOG.md` heading. diff --git a/CHANGELOG.md b/CHANGELOG.md index 966b706..a258d40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to `detain/phlex-shared` are documented here. +All notable changes to `detain/phlix-shared` are documented here. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). @@ -9,53 +9,53 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [0.4.0] — 2026-05-18 ### Added -- `Phlex\Shared\Arr\ArrClientInterface` — common interface for Sonarr/Radarr +- `Phlix\Shared\Arr\ArrClientInterface` — common interface for Sonarr/Radarr HTTP clients (queue, quality profiles, tags, test-connection). -- `Phlex\Shared\Arr\ArrClientFactory` — factory that instantiates Sonarr/Radarr +- `Phlix\Shared\Arr\ArrClientFactory` — factory that instantiates Sonarr/Radarr clients from instance config arrays. -- `Phlex\Shared\Arr\SyncResult` — immutable value object returned by sync flows. -- `Phlex\Shared\Arr\SonarrClient` — typed Sonarr v3 HTTP client. -- `Phlex\Shared\Arr\RadarrClient` — typed Radarr v3 HTTP client. -- `Phlex\Shared\Arr\BazarrClient` — typed Bazarr HTTP client. -- `Phlex\Shared\Arr\ProwlarrClient` — typed Prowlarr HTTP client. -- `Phlex\Shared\Arr\TrashGuidesProvider` — fetches TRaSH-Guides quality +- `Phlix\Shared\Arr\SyncResult` — immutable value object returned by sync flows. +- `Phlix\Shared\Arr\SonarrClient` — typed Sonarr v3 HTTP client. +- `Phlix\Shared\Arr\RadarrClient` — typed Radarr v3 HTTP client. +- `Phlix\Shared\Arr\BazarrClient` — typed Bazarr HTTP client. +- `Phlix\Shared\Arr\ProwlarrClient` — typed Prowlarr HTTP client. +- `Phlix\Shared\Arr\TrashGuidesProvider` — fetches TRaSH-Guides quality profile + custom format JSON. - `psr/log` runtime dependency to allow optional PSR-3 loggers on the arr - clients without pulling phlex-server's concrete `StructuredLogger`. + clients without pulling phlix-server's concrete `StructuredLogger`. ### Changed -- Arr classes now type-hint `Psr\Log\LoggerInterface` instead of phlex-server's +- Arr classes now type-hint `Psr\Log\LoggerInterface` instead of phlix-server's `StructuredLogger`, allowing the hub and any other PSR-3 consumer to inject its own logger. Required for Step K.1 (arr clients shared between - phlex-server and phlex-hub) and K.3 (hub-side request fulfillment). + phlix-server and phlix-hub) and K.3 (hub-side request fulfillment). ## [0.3.0] — 2026-05-17 ### Added -- `Phlex\Shared\Auth\ProviderInterface` — core interface for pluggable external +- `Phlix\Shared\Auth\ProviderInterface` — core interface for pluggable external authentication providers (OIDC, LDAP, SAML, passkeys). Zero I/O dependencies - so both phlex-server and phlex-hub can implement providers without pulling in + so both phlix-server and phlix-hub can implement providers without pulling in server/runtime dependencies. -- `Phlex\Shared\Auth\AuthResult` — immutable value object returned by +- `Phlix\Shared\Auth\AuthResult` — immutable value object returned by `ProviderInterface::authenticate()`. Captures success/failure, local userId, provider externalId, error code, and arbitrary attributes (email, name, avatarUrl …). -- `Phlex\Shared\Auth\UserInfo` — immutable value object returned by +- `Phlix\Shared\Auth\UserInfo` — immutable value object returned by `ProviderInterface::getUserInfo()`. Describes an external identity for account linking and profile display. ## [0.2.0] — 2026-05-17 ### Added -- `Phlex\Shared\Plugin\LifecycleInterface` — moved from `Phlex\Plugins\Contract\LifecycleInterface` in `phlex-server`. -- `Phlex\Shared\Plugin\{Manifest,ManifestType,ManifestValidationError,EventNameMap}` — moved from `Phlex\Plugins\*` in `phlex-server`. Validator logic stays in `phlex-server` (`Phlex\Plugins\Manifest\ManifestSchema`). -- `Phlex\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}` — moved from `Phlex\Common\Events\*` in `phlex-server` (the 12 readonly event DTOs). PSR-14 dispatcher wiring stays in `phlex-server`. -- `Phlex\Shared\Auth\JwtClaims` — new value object capturing the Phlex JWT payload shape; consumed by `phlex-hub` starting Phase C.5. -- `Phlex\Shared\Hub\{ClaimRequest,ClaimResponse,ServerInfoDto,HeartbeatDto}` — new placeholder DTOs for the hub claim/heartbeat protocol; consumed by `phlex-hub` starting Phase C.1. -- `Phlex\Shared\Arr\.gitkeep` — namespace reserved for Phase K.1's `Sonarr`/`Radarr`/etc. typed clients. +- `Phlix\Shared\Plugin\LifecycleInterface` — moved from `Phlix\Plugins\Contract\LifecycleInterface` in `phlix-server`. +- `Phlix\Shared\Plugin\{Manifest,ManifestType,ManifestValidationError,EventNameMap}` — moved from `Phlix\Plugins\*` in `phlix-server`. Validator logic stays in `phlix-server` (`Phlix\Plugins\Manifest\ManifestSchema`). +- `Phlix\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}` — moved from `Phlix\Common\Events\*` in `phlix-server` (the 12 readonly event DTOs). PSR-14 dispatcher wiring stays in `phlix-server`. +- `Phlix\Shared\Auth\JwtClaims` — new value object capturing the Phlix JWT payload shape; consumed by `phlix-hub` starting Phase C.5. +- `Phlix\Shared\Hub\{ClaimRequest,ClaimResponse,ServerInfoDto,HeartbeatDto}` — new placeholder DTOs for the hub claim/heartbeat protocol; consumed by `phlix-hub` starting Phase C.1. +- `Phlix\Shared\Arr\.gitkeep` — namespace reserved for Phase K.1's `Sonarr`/`Radarr`/etc. typed clients. ## [0.1.0] — 2026-05-17 ### Added -- Initial release: composer package scaffolding, `Phlex\Shared\Version` marker class, CI workflow. -- Real interfaces and DTOs land in v0.2.0 per `plans/expansion/b.1-shared-design.md` in `detain/phlex`. +- Initial release: composer package scaffolding, `Phlix\Shared\Version` marker class, CI workflow. +- Real interfaces and DTOs land in v0.2.0 per `plans/expansion/b.1-shared-design.md` in `detain/phlix`. diff --git a/LICENSE b/LICENSE index a003f83..cb068d2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 Joe Huss / Phlex Project +Copyright (c) 2026 Joe Huss / Phlix Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5d8f5eb..37324e0 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ -# detain/phlex-shared +# detain/phlix-shared Shared interfaces, DTOs, event names, and protocol types used by both -[`detain/phlex-server`](https://github.com/detain/phlex) (the media server) -and `detain/phlex-hub` (the multi-server hub, forthcoming). Composer-installable, +[`detain/phlix-server`](https://github.com/detain/phlix) (the media server) +and `detain/phlix-hub` (the multi-server hub, forthcoming). Composer-installable, PHP 8.3+, zero I/O — pure interfaces and value objects only. ## Status **v0.2.0 — Plugin / Events / Auth / Hub namespaces.** Shipped: -- `Phlex\Shared\Plugin\{LifecycleInterface, Manifest, ManifestType, ManifestValidationError, EventNameMap}` -- `Phlex\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}` — 12 event DTOs. -- `Phlex\Shared\Auth\JwtClaims` -- `Phlex\Shared\Hub\{ClaimRequest, ClaimResponse, ServerInfoDto, HeartbeatDto}` -- `Phlex\Shared\Arr\` — namespace reserved for Phase K.1. +- `Phlix\Shared\Plugin\{LifecycleInterface, Manifest, ManifestType, ManifestValidationError, EventNameMap}` +- `Phlix\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}` — 12 event DTOs. +- `Phlix\Shared\Auth\JwtClaims` +- `Phlix\Shared\Hub\{ClaimRequest, ClaimResponse, ServerInfoDto, HeartbeatDto}` +- `Phlix\Shared\Arr\` — namespace reserved for Phase K.1. The PSR-14 dispatcher wiring (Tukio) and the manifest JSON-Schema -validator stay in `phlex-server` and consume this package via Composer. +validator stay in `phlix-server` and consume this package via Composer. ## Requirements @@ -30,7 +30,7 @@ no Smarty. It is intended to be safely required by any PHP 8.3+ codebase. ## Installation -Until `detain/phlex-shared` is published to Packagist (planned post-v1.0), +Until `detain/phlix-shared` is published to Packagist (planned post-v1.0), consumers require it via a Composer VCS repository entry: ```json @@ -38,11 +38,11 @@ consumers require it via a Composer VCS repository entry: "repositories": [ { "type": "vcs", - "url": "git@github.com:detain/phlex-shared.git" + "url": "git@github.com:detain/phlix-shared.git" } ], "require": { - "detain/phlex-shared": "^0.2" + "detain/phlix-shared": "^0.2" } } ``` @@ -50,13 +50,13 @@ consumers require it via a Composer VCS repository entry: Then: ```bash -composer update detain/phlex-shared +composer update detain/phlix-shared ``` ## Related repositories -- [`detain/phlex`](https://github.com/detain/phlex) — the Phlex media server (consumes this package from B.3 onward). -- `detain/phlex-hub` — the multi-server hub (forthcoming, B.5+). +- [`detain/phlix`](https://github.com/detain/phlix) — the Phlix media server (consumes this package from B.3 onward). +- `detain/phlix-hub` — the multi-server hub (forthcoming, B.5+). ## Development diff --git a/composer.json b/composer.json index c711342..a056f26 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "detain/phlex-shared", - "description": "Shared interfaces, DTOs, event names, and protocol types used by both phlex-server and phlex-hub. Composer-installable, PHP 8.3+, zero I/O.", + "name": "detain/phlix-shared", + "description": "Shared interfaces, DTOs, event names, and protocol types used by both phlix-server and phlix-hub. Composer-installable, PHP 8.3+, zero I/O.", "type": "library", "license": "MIT", "require": { @@ -18,12 +18,12 @@ }, "autoload": { "psr-4": { - "Phlex\\Shared\\": "src/" + "Phlix\\Shared\\": "src/" } }, "autoload-dev": { "psr-4": { - "Phlex\\Shared\\Tests\\": "tests/" + "Phlix\\Shared\\Tests\\": "tests/" } }, "minimum-stability": "stable", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c8e6081..3103d78 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,6 +1,6 @@ - - PSR-12 coding standard for detain/phlex-shared. + + PSR-12 coding standard for detain/phlix-shared. src diff --git a/src/Arr/ArrClientFactory.php b/src/Arr/ArrClientFactory.php index 751991e..7666102 100644 --- a/src/Arr/ArrClientFactory.php +++ b/src/Arr/ArrClientFactory.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; /** * Factory for creating Sonarr/Radarr API clients from config. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class ArrClientFactory diff --git a/src/Arr/ArrClientInterface.php b/src/Arr/ArrClientInterface.php index b575d5d..cb69321 100644 --- a/src/Arr/ArrClientInterface.php +++ b/src/Arr/ArrClientInterface.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; /** * Common interface for Sonarr/Radarr API clients. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ interface ArrClientInterface diff --git a/src/Arr/BazarrClient.php b/src/Arr/BazarrClient.php index 6072110..31be85a 100644 --- a/src/Arr/BazarrClient.php +++ b/src/Arr/BazarrClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; use RuntimeException; @@ -10,7 +10,7 @@ /** * Bazarr API client for subtitle management. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class BazarrClient diff --git a/src/Arr/ProwlarrClient.php b/src/Arr/ProwlarrClient.php index f3d3768..31b7a9c 100644 --- a/src/Arr/ProwlarrClient.php +++ b/src/Arr/ProwlarrClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; use RuntimeException; @@ -10,7 +10,7 @@ /** * Prowlarr API client for indexer management. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class ProwlarrClient diff --git a/src/Arr/RadarrClient.php b/src/Arr/RadarrClient.php index 07070e9..31d283f 100644 --- a/src/Arr/RadarrClient.php +++ b/src/Arr/RadarrClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; use RuntimeException; @@ -10,7 +10,7 @@ /** * Radarr v3 API client for movie management. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class RadarrClient implements ArrClientInterface diff --git a/src/Arr/SonarrClient.php b/src/Arr/SonarrClient.php index 673a201..d11f7bd 100644 --- a/src/Arr/SonarrClient.php +++ b/src/Arr/SonarrClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; use RuntimeException; @@ -10,7 +10,7 @@ /** * Sonarr v3 API client for TV series management. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class SonarrClient implements ArrClientInterface diff --git a/src/Arr/SyncResult.php b/src/Arr/SyncResult.php index db35cc2..caf0263 100644 --- a/src/Arr/SyncResult.php +++ b/src/Arr/SyncResult.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use DateTimeImmutable; /** * Value object representing the result of a TRaSH-Guides sync operation. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class SyncResult diff --git a/src/Arr/TrashGuidesProvider.php b/src/Arr/TrashGuidesProvider.php index 5be8992..444eb6e 100644 --- a/src/Arr/TrashGuidesProvider.php +++ b/src/Arr/TrashGuidesProvider.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Arr; +namespace Phlix\Shared\Arr; use Psr\Log\LoggerInterface; use RuntimeException; @@ -10,7 +10,7 @@ /** * Fetches and parses TRaSH-Guides quality profiles and custom formats JSON. * - * @package Phlex\Shared\Arr + * @package Phlix\Shared\Arr * @since 0.12.0 */ class TrashGuidesProvider @@ -241,7 +241,7 @@ private function fetchUrl(string $url): string 'max_redirects' => 5, 'header' => [ 'Accept: application/json', - 'User-Agent: Phlex-Media-Server/0.12.0', + 'User-Agent: Phlix-Media-Server/0.12.0', ], ], ]); diff --git a/src/Auth/AuthResult.php b/src/Auth/AuthResult.php index 942dcfa..9f2e02c 100644 --- a/src/Auth/AuthResult.php +++ b/src/Auth/AuthResult.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Auth; +namespace Phlix\Shared\Auth; /** * Immutable value object returned by {@see ProviderInterface::authenticate()}. @@ -11,8 +11,8 @@ * provider. On success, the caller uses userId to issue a local JWT and * stores externalId on the user row for future lookups. * - * @package Phlex\Auth - * @author Phlex Team + * @package Phlix\Auth + * @author Phlix Team * @version 1.0.0 * @description Result of an external provider authentication attempt. * @@ -41,7 +41,7 @@ { /** * @param bool $success True when authentication succeeded. - * @param string|null $userId Local Phlex user UUID (null on failure). + * @param string|null $userId Local Phlix user UUID (null on failure). * @param string|null $externalId Provider-specific ID (null on failure). * @param string|null $error Machine-readable error code (null on success). * @param array $attributes Arbitrary provider-returned claims diff --git a/src/Auth/JwtClaims.php b/src/Auth/JwtClaims.php index b371e65..0c5b20c 100644 --- a/src/Auth/JwtClaims.php +++ b/src/Auth/JwtClaims.php @@ -2,28 +2,28 @@ declare(strict_types=1); -namespace Phlex\Shared\Auth; +namespace Phlix\Shared\Auth; use InvalidArgumentException; /** - * Immutable claim shape for Phlex JWTs (access and refresh). + * Immutable claim shape for Phlix JWTs (access and refresh). * - * Captures the payload `Phlex\Auth\JwtHandler::createAccessToken()` and + * Captures the payload `Phlix\Auth\JwtHandler::createAccessToken()` and * `createRefreshToken()` produce today, plus the additional `aud` and * `scope` fields the hub will emit starting in Phase C.5. * * Phase C.5 wires `JwtHandler::validateToken()` to deserialize the * decoded payload into this DTO so server and hub share one definition - * of "what's in a Phlex JWT". + * of "what's in a Phlix JWT". * - * @package Phlex\Shared\Auth + * @package Phlix\Shared\Auth * @since 0.2.0 */ final class JwtClaims { - public const ISS_PHLEX = 'phlex'; - public const ISS_PHLEX_HUB = 'phlex-hub'; + public const ISS_PHLIX = 'phlix'; + public const ISS_PHLIX_HUB = 'phlix-hub'; public const AUD_SERVER = 'server'; public const AUD_HUB = 'hub'; public const AUD_CLIENT = 'client'; @@ -31,7 +31,7 @@ final class JwtClaims public const TYPE_REFRESH = 'refresh'; /** - * @param string $iss Issuer. `phlex` for server-minted, `phlex-hub` for hub-minted. + * @param string $iss Issuer. `phlix` for server-minted, `phlix-hub` for hub-minted. * @param string $aud Audience. One of self::AUD_*. * @param string $sub Subject — user UUID. * @param int $iat Issued-at, UNIX seconds. diff --git a/src/Auth/ProviderInterface.php b/src/Auth/ProviderInterface.php index b6bf1b5..2c9be68 100644 --- a/src/Auth/ProviderInterface.php +++ b/src/Auth/ProviderInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Auth; +namespace Phlix\Shared\Auth; /** * Interface for external authentication providers. @@ -10,11 +10,11 @@ * This interface must be implemented by OIDC, LDAP, SAML, and passkey * auth providers. It has ZERO I/O dependencies — no HTTP calls, no DB, * no filesystem. All I/O is the responsibility of the concrete - * implementation (typically a thin adapter in phlex-server that + * implementation (typically a thin adapter in phlix-server that * delegates to an external library). * - * @package Phlex\Auth - * @author Phlex Team + * @package Phlix\Auth + * @author Phlix Team * @version 1.0.0 * @description Contract for pluggable external authentication providers. * @@ -86,14 +86,14 @@ public function authenticate(array $credentials): AuthResult; public function getUserInfo(string $externalId): ?UserInfo; /** - * Link an existing local Phlex user account to this provider. + * Link an existing local Phlix user account to this provider. * * Called when a user who already has a local account chooses to * connect it to an external identity (e.g. after first login via OIDC). * Implementations may store linkage metadata in $externalIds for later * use during authentication. * - * @param string $localUserId The local Phlex user UUID. + * @param string $localUserId The local Phlix user UUID. * @param array $externalIds Map of provider names to their external IDs. * @return void */ diff --git a/src/Auth/UserInfo.php b/src/Auth/UserInfo.php index 31a4af0..7f2cae0 100644 --- a/src/Auth/UserInfo.php +++ b/src/Auth/UserInfo.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Phlex\Shared\Auth; +namespace Phlix\Shared\Auth; /** * Immutable value object returned by {@see ProviderInterface::getUserInfo()}. * * Describes an external identity (email, display name, avatar, raw claims) - * independent of any local Phlex user record. Used for account linking + * independent of any local Phlix user record. Used for account linking * and profile display. * - * @package Phlex\Auth - * @author Phlex Team + * @package Phlix\Auth + * @author Phlix Team * @version 1.0.0 * @description User information from an external authentication provider. * diff --git a/src/Events/AbstractEvent.php b/src/Events/AbstractEvent.php index a82a373..bee58bf 100644 --- a/src/Events/AbstractEvent.php +++ b/src/Events/AbstractEvent.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Phlex\Shared\Events; +namespace Phlix\Shared\Events; /** - * Common base for all Phlex PSR-14 events. + * Common base for all Phlix PSR-14 events. * * Provides a single readonly `timestamp` (UNIX epoch seconds) captured at * construction time so listeners can correlate dispatch order without @@ -17,7 +17,7 @@ * populated. They MUST NOT add mutator methods or write to inherited * properties. * - * @package Phlex\Shared\Events + * @package Phlix\Shared\Events * @since 0.2.0 */ abstract class AbstractEvent diff --git a/src/Events/Auth/UserCreated.php b/src/Events/Auth/UserCreated.php index 43ccb6d..76112d6 100644 --- a/src/Events/Auth/UserCreated.php +++ b/src/Events/Auth/UserCreated.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Auth; +namespace Phlix\Shared\Events\Auth; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired immediately after a new user account is created. * - * Fired by: `\Phlex\Auth\AuthManager::register()` after the user row is + * Fired by: `\Phlix\Auth\AuthManager::register()` after the user row is * persisted and before the response JWT is generated. * Typical listener: welcome-email sender, audit-log writer, default- * library-permissions bootstrap, hub-side "user came from server X" * mirror. * - * Manifest alias: `phlex.user.created`. + * Manifest alias: `phlix.user.created`. * - * @package Phlex\Shared\Events\Auth + * @package Phlix\Shared\Events\Auth * @since 0.2.0 */ final class UserCreated extends AbstractEvent diff --git a/src/Events/Auth/UserLoggedIn.php b/src/Events/Auth/UserLoggedIn.php index 662b5f5..71506d4 100644 --- a/src/Events/Auth/UserLoggedIn.php +++ b/src/Events/Auth/UserLoggedIn.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Auth; +namespace Phlix\Shared\Events\Auth; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired after a successful login. * - * Fired by: `\Phlex\Auth\AuthManager::login()` after credential + * Fired by: `\Phlix\Auth\AuthManager::login()` after credential * verification succeeds and the audit-log entry is written. * Typical listener: presence integrations, security-anomaly detector * (new IP / new device alerts), device-registry updater, hub session * mirror. * - * Manifest alias: `phlex.user.logged_in`. + * Manifest alias: `phlix.user.logged_in`. * - * @package Phlex\Shared\Events\Auth + * @package Phlix\Shared\Events\Auth * @since 0.2.0 */ final class UserLoggedIn extends AbstractEvent diff --git a/src/Events/Auth/UserLoggedOut.php b/src/Events/Auth/UserLoggedOut.php index 9d7a58b..a650ea5 100644 --- a/src/Events/Auth/UserLoggedOut.php +++ b/src/Events/Auth/UserLoggedOut.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Auth; +namespace Phlix\Shared\Events\Auth; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a user session ends. * - * Fired by: explicit logout handler in `\Phlex\Auth\AuthManager`, plus + * Fired by: explicit logout handler in `\Phlix\Auth\AuthManager`, plus * the session-expiry / token-revocation paths added in subsequent * phases. The `reason` field disambiguates the three paths so listeners * can react appropriately (e.g., only notify the user on "revoked"). @@ -17,9 +17,9 @@ * writer, security-alert notifier ("your session was revoked"), hub-side * session mirror. * - * Manifest alias: `phlex.user.logged_out`. + * Manifest alias: `phlix.user.logged_out`. * - * @package Phlex\Shared\Events\Auth + * @package Phlix\Shared\Events\Auth * @since 0.2.0 */ final class UserLoggedOut extends AbstractEvent diff --git a/src/Events/Library/LibraryScanCompleted.php b/src/Events/Library/LibraryScanCompleted.php index b175de4..dedfdd7 100644 --- a/src/Events/Library/LibraryScanCompleted.php +++ b/src/Events/Library/LibraryScanCompleted.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Library; +namespace Phlix\Shared\Events\Library; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a library scan finishes. * - * Fired by: `\Phlex\Media\Library\MediaScanner::scan()` after the + * Fired by: `\Phlix\Media\Library\MediaScanner::scan()` after the * recursive walk completes, with the final tally of added / updated / * removed items and the wall-clock duration. * Typical listener: webhook notification framework ("scan complete"), * dashboard refreshers, recommendation cache invalidators, "what's new" * digest mailers. * - * Manifest alias: `phlex.library.scan.completed`. + * Manifest alias: `phlix.library.scan.completed`. * - * @package Phlex\Shared\Events\Library + * @package Phlix\Shared\Events\Library * @since 0.2.0 */ final class LibraryScanCompleted extends AbstractEvent diff --git a/src/Events/Library/LibraryScanStarted.php b/src/Events/Library/LibraryScanStarted.php index 4827d94..fe6fdfa 100644 --- a/src/Events/Library/LibraryScanStarted.php +++ b/src/Events/Library/LibraryScanStarted.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Library; +namespace Phlix\Shared\Events\Library; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a library scan begins. * - * Fired by: `\Phlex\Media\Library\MediaScanner::scan()` at the top of + * Fired by: `\Phlix\Media\Library\MediaScanner::scan()` at the top of * the scan, after path validation. * Typical listener: progress dashboard (start spinner), webhook * notification framework (notify "scan started"), maintenance window * coordinator (pause other heavy jobs). * - * Manifest alias: `phlex.library.scan.started`. + * Manifest alias: `phlix.library.scan.started`. * - * @package Phlex\Shared\Events\Library + * @package Phlix\Shared\Events\Library * @since 0.2.0 */ final class LibraryScanStarted extends AbstractEvent diff --git a/src/Events/Library/MediaItemAdded.php b/src/Events/Library/MediaItemAdded.php index ca61df3..34f0c3f 100644 --- a/src/Events/Library/MediaItemAdded.php +++ b/src/Events/Library/MediaItemAdded.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Library; +namespace Phlix\Shared\Events\Library; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a new media item is added to a library. * - * Fired by: `\Phlex\Media\Library\MediaScanner::processFile()` after a + * Fired by: `\Phlix\Media\Library\MediaScanner::processFile()` after a * previously-unseen file is successfully persisted via `ItemRepository`. * Typical listener: metadata-refresh queue worker (kick off TMDb / * MusicBrainz lookup), "what's new" notifier, recommendation index * updater, intro-detection job queuer. * - * Manifest alias: `phlex.library.item.added`. + * Manifest alias: `phlix.library.item.added`. * - * @package Phlex\Shared\Events\Library + * @package Phlix\Shared\Events\Library * @since 0.2.0 */ final class MediaItemAdded extends AbstractEvent diff --git a/src/Events/Library/MediaItemRemoved.php b/src/Events/Library/MediaItemRemoved.php index afa46ff..b923afd 100644 --- a/src/Events/Library/MediaItemRemoved.php +++ b/src/Events/Library/MediaItemRemoved.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Library; +namespace Phlix\Shared\Events\Library; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a media item is removed from a library. * - * Fired by: cleanup passes inside `\Phlex\Media\Library\ItemRepository` + * Fired by: cleanup passes inside `\Phlix\Media\Library\ItemRepository` * and `MediaScanner` when the backing file is gone. * Typical listener: search-index cleaner, "your file is gone" notifier, * watch-history archiver, recommendation cache invalidator. * - * Manifest alias: `phlex.library.item.removed`. + * Manifest alias: `phlix.library.item.removed`. * - * @package Phlex\Shared\Events\Library + * @package Phlix\Shared\Events\Library * @since 0.2.0 */ final class MediaItemRemoved extends AbstractEvent diff --git a/src/Events/Library/MediaItemUpdated.php b/src/Events/Library/MediaItemUpdated.php index 9ae8cb7..2136329 100644 --- a/src/Events/Library/MediaItemUpdated.php +++ b/src/Events/Library/MediaItemUpdated.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Library; +namespace Phlix\Shared\Events\Library; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when an existing media item's metadata changes. * * Fired by: metadata-refresh writes inside - * `\Phlex\Media\Library\ItemRepository`. + * `\Phlix\Media\Library\ItemRepository`. * Typical listener: search-index re-indexer, recommendation cache * invalidator, "updated metadata" notifier, integrations that mirror - * Phlex metadata into another tool (Notion, Airtable, etc.). + * Phlix metadata into another tool (Notion, Airtable, etc.). * - * Manifest alias: `phlex.library.item.updated`. + * Manifest alias: `phlix.library.item.updated`. * - * @package Phlex\Shared\Events\Library + * @package Phlix\Shared\Events\Library * @since 0.2.0 */ final class MediaItemUpdated extends AbstractEvent diff --git a/src/Events/Playback/PlaybackPaused.php b/src/Events/Playback/PlaybackPaused.php index 724e206..4f9d155 100644 --- a/src/Events/Playback/PlaybackPaused.php +++ b/src/Events/Playback/PlaybackPaused.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Playback; +namespace Phlix\Shared\Events\Playback; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when an active playback session transitions to the paused state. * - * Fired by: `\Phlex\Session\PlaybackController::reportProgress()` when + * Fired by: `\Phlix\Session\PlaybackController::reportProgress()` when * the reported `isPaused` flag flips from false to true for an existing * session. * Typical listener: scrobble plugins (mark "stopped" mid-stream so they * can resume), now-playing dashboard updaters, away-from-keyboard * presence integrations. * - * Manifest alias: `phlex.playback.paused`. + * Manifest alias: `phlix.playback.paused`. * - * @package Phlex\Shared\Events\Playback + * @package Phlix\Shared\Events\Playback * @since 0.2.0 */ final class PlaybackPaused extends AbstractEvent diff --git a/src/Events/Playback/PlaybackResumed.php b/src/Events/Playback/PlaybackResumed.php index c16919b..19eb82f 100644 --- a/src/Events/Playback/PlaybackResumed.php +++ b/src/Events/Playback/PlaybackResumed.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Playback; +namespace Phlix\Shared\Events\Playback; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a previously paused playback session resumes playing. * - * Fired by: `\Phlex\Session\PlaybackController::reportProgress()` when + * Fired by: `\Phlix\Session\PlaybackController::reportProgress()` when * the reported `isPaused` flag flips from true to false for an existing * session. * Typical listener: scrobble plugins (re-start the scrobble timer), now- * playing dashboard updaters, smart-bulb / "movie mode" integrations. * - * Manifest alias: `phlex.playback.resumed`. + * Manifest alias: `phlix.playback.resumed`. * - * @package Phlex\Shared\Events\Playback + * @package Phlix\Shared\Events\Playback * @since 0.2.0 */ final class PlaybackResumed extends AbstractEvent diff --git a/src/Events/Playback/PlaybackStarted.php b/src/Events/Playback/PlaybackStarted.php index 872b726..196eb33 100644 --- a/src/Events/Playback/PlaybackStarted.php +++ b/src/Events/Playback/PlaybackStarted.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Playback; +namespace Phlix\Shared\Events\Playback; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a user begins playback of a media item. * - * Fired by: `\Phlex\Session\PlaybackController::reportProgress()` the + * Fired by: `\Phlix\Session\PlaybackController::reportProgress()` the * first time progress is recorded for a `(sessionId, mediaItemId)` pair. * Typical listener: scrobble plugins (Trakt, Last.fm), analytics * collectors, presence integrations (Discord rich presence), watch-history * recorders, parental-control auditors. * - * Manifest alias: `phlex.playback.started`. + * Manifest alias: `phlix.playback.started`. * - * @package Phlex\Shared\Events\Playback + * @package Phlix\Shared\Events\Playback * @since 0.2.0 */ final class PlaybackStarted extends AbstractEvent diff --git a/src/Events/Playback/PlaybackStopped.php b/src/Events/Playback/PlaybackStopped.php index 2f03a64..5c9277c 100644 --- a/src/Events/Playback/PlaybackStopped.php +++ b/src/Events/Playback/PlaybackStopped.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Events\Playback; +namespace Phlix\Shared\Events\Playback; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; /** * Fired when a playback session ends, either at user request or end-of-media. * - * Fired by: `\Phlex\Session\PlaybackController::markAsWatched()` and the + * Fired by: `\Phlix\Session\PlaybackController::markAsWatched()` and the * `clearProgress()` lifecycle hook. * Typical listener: scrobble plugins (final scrobble), watch-history * "complete" markers, recommendation refreshers, post-credits skip * removers, smart-home "movie mode" deactivators. * - * Manifest alias: `phlex.playback.stopped`. + * Manifest alias: `phlix.playback.stopped`. * - * @package Phlex\Shared\Events\Playback + * @package Phlix\Shared\Events\Playback * @since 0.2.0 */ final class PlaybackStopped extends AbstractEvent @@ -31,7 +31,7 @@ final class PlaybackStopped extends AbstractEvent * session ended, in 100-ns ticks. * @param bool $reachedEnd True when the listener should treat * the item as fully watched (>= 90 % - * per Phlex convention); false when + * per Phlix convention); false when * the user stopped mid-stream. */ public function __construct( diff --git a/src/Hub/ClaimRequest.php b/src/Hub/ClaimRequest.php index 7c49fa8..285b2b9 100644 --- a/src/Hub/ClaimRequest.php +++ b/src/Hub/ClaimRequest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Hub; +namespace Phlix\Shared\Hub; use InvalidArgumentException; @@ -12,7 +12,7 @@ * Master plan §6 step 2. Shipped in v0.2.0 with the locked field shape; * actually wired in Phase C.1 (hub registry) / C.2 (server's HubClient). * - * @package Phlex\Shared\Hub + * @package Phlix\Shared\Hub * @since 0.2.0 */ final class ClaimRequest @@ -25,7 +25,7 @@ final class ClaimRequest * @param list $hostnameCandidates Hostnames/IPs the server thinks it's reachable at * (for relay-or-direct decisions). * @param string $protocolVersion Spec version — start at "v1"; check via - * Accept-Phlex-Protocol header. + * Accept-Phlix-Protocol header. */ public function __construct( public readonly string $serverName, diff --git a/src/Hub/ClaimResponse.php b/src/Hub/ClaimResponse.php index 065899c..f8cc5e8 100644 --- a/src/Hub/ClaimResponse.php +++ b/src/Hub/ClaimResponse.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Hub; +namespace Phlix\Shared\Hub; use InvalidArgumentException; @@ -11,7 +11,7 @@ * * Master plan §6 step 2. * - * @package Phlex\Shared\Hub + * @package Phlix\Shared\Hub * @since 0.2.0 */ final class ClaimResponse diff --git a/src/Hub/HeartbeatDto.php b/src/Hub/HeartbeatDto.php index a33ec15..9fa9376 100644 --- a/src/Hub/HeartbeatDto.php +++ b/src/Hub/HeartbeatDto.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Hub; +namespace Phlix\Shared\Hub; use InvalidArgumentException; @@ -11,7 +11,7 @@ * * Master plan §6 step 5. * - * @package Phlex\Shared\Hub + * @package Phlix\Shared\Hub * @since 0.2.0 */ final class HeartbeatDto diff --git a/src/Hub/ServerInfoDto.php b/src/Hub/ServerInfoDto.php index 7d6e9b8..e0e2697 100644 --- a/src/Hub/ServerInfoDto.php +++ b/src/Hub/ServerInfoDto.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Hub; +namespace Phlix\Shared\Hub; use InvalidArgumentException; @@ -10,7 +10,7 @@ * Hub-side projection of an enrolled server, returned from * `GET /api/v1/users/{id}/servers` (Phase C.4 dashboard). * - * @package Phlex\Shared\Hub + * @package Phlix\Shared\Hub * @since 0.2.0 */ final class ServerInfoDto diff --git a/src/Plugin/EventNameMap.php b/src/Plugin/EventNameMap.php index d57ba31..c04259c 100644 --- a/src/Plugin/EventNameMap.php +++ b/src/Plugin/EventNameMap.php @@ -2,37 +2,37 @@ declare(strict_types=1); -namespace Phlex\Shared\Plugin; +namespace Phlix\Shared\Plugin; -use Phlex\Shared\Events\Auth\UserCreated; -use Phlex\Shared\Events\Auth\UserLoggedIn; -use Phlex\Shared\Events\Auth\UserLoggedOut; -use Phlex\Shared\Events\Library\LibraryScanCompleted; -use Phlex\Shared\Events\Library\LibraryScanStarted; -use Phlex\Shared\Events\Library\MediaItemAdded; -use Phlex\Shared\Events\Library\MediaItemRemoved; -use Phlex\Shared\Events\Library\MediaItemUpdated; -use Phlex\Shared\Events\Playback\PlaybackPaused; -use Phlex\Shared\Events\Playback\PlaybackResumed; -use Phlex\Shared\Events\Playback\PlaybackStarted; -use Phlex\Shared\Events\Playback\PlaybackStopped; +use Phlix\Shared\Events\Auth\UserCreated; +use Phlix\Shared\Events\Auth\UserLoggedIn; +use Phlix\Shared\Events\Auth\UserLoggedOut; +use Phlix\Shared\Events\Library\LibraryScanCompleted; +use Phlix\Shared\Events\Library\LibraryScanStarted; +use Phlix\Shared\Events\Library\MediaItemAdded; +use Phlix\Shared\Events\Library\MediaItemRemoved; +use Phlix\Shared\Events\Library\MediaItemUpdated; +use Phlix\Shared\Events\Playback\PlaybackPaused; +use Phlix\Shared\Events\Playback\PlaybackResumed; +use Phlix\Shared\Events\Playback\PlaybackStarted; +use Phlix\Shared\Events\Playback\PlaybackStopped; /** * Static lookup table between manifest event aliases and concrete * event-class FQCNs. * * The manifest format keeps event names short and stable (e.g. - * `phlex.playback.started`) so plugin authors don't have to type a + * `phlix.playback.started`) so plugin authors don't have to type a * fully-qualified PHP class name in JSON. At runtime, however, the * PSR-14 dispatcher keys subscriptions on the event class, so the * plugin loader translates each manifest alias to its FQCN via this * map before attaching listeners. * - * One entry per event class published by `phlex-shared` `src/Events/`. + * One entry per event class published by `phlix-shared` `src/Events/`. * The canonical list lives in `docs/dev/event-reference.md` shipped - * with `phlex-server` — keep this table and the doc in sync. + * with `phlix-server` — keep this table and the doc in sync. * - * @package Phlex\Shared\Plugin + * @package Phlix\Shared\Plugin * @since 0.2.0 */ final class EventNameMap @@ -43,18 +43,18 @@ final class EventNameMap * @var array */ private const ALIAS_TO_FQCN = [ - 'phlex.playback.started' => PlaybackStarted::class, - 'phlex.playback.paused' => PlaybackPaused::class, - 'phlex.playback.resumed' => PlaybackResumed::class, - 'phlex.playback.stopped' => PlaybackStopped::class, - 'phlex.library.scan.started' => LibraryScanStarted::class, - 'phlex.library.scan.completed' => LibraryScanCompleted::class, - 'phlex.library.item.added' => MediaItemAdded::class, - 'phlex.library.item.updated' => MediaItemUpdated::class, - 'phlex.library.item.removed' => MediaItemRemoved::class, - 'phlex.user.created' => UserCreated::class, - 'phlex.user.logged_in' => UserLoggedIn::class, - 'phlex.user.logged_out' => UserLoggedOut::class, + 'phlix.playback.started' => PlaybackStarted::class, + 'phlix.playback.paused' => PlaybackPaused::class, + 'phlix.playback.resumed' => PlaybackResumed::class, + 'phlix.playback.stopped' => PlaybackStopped::class, + 'phlix.library.scan.started' => LibraryScanStarted::class, + 'phlix.library.scan.completed' => LibraryScanCompleted::class, + 'phlix.library.item.added' => MediaItemAdded::class, + 'phlix.library.item.updated' => MediaItemUpdated::class, + 'phlix.library.item.removed' => MediaItemRemoved::class, + 'phlix.user.created' => UserCreated::class, + 'phlix.user.logged_in' => UserLoggedIn::class, + 'phlix.user.logged_out' => UserLoggedOut::class, ]; /** @@ -67,7 +67,7 @@ private function __construct() /** * Resolve the event class FQCN for the given manifest alias. * - * @param string $alias Manifest alias such as `phlex.playback.started`. + * @param string $alias Manifest alias such as `phlix.playback.started`. * * @return class-string|null FQCN when the alias is known, null otherwise. * diff --git a/src/Plugin/LifecycleInterface.php b/src/Plugin/LifecycleInterface.php index 3089966..ee56d56 100644 --- a/src/Plugin/LifecycleInterface.php +++ b/src/Plugin/LifecycleInterface.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Phlex\Shared\Plugin; +namespace Phlix\Shared\Plugin; use Psr\Container\ContainerInterface; /** - * Contract every Phlex plugin entry class implements. + * Contract every Phlix plugin entry class implements. * * The entry class is whatever FQCN appears in `plugin.json#/entry`. The * loader instantiates it through the host PSR-11 container — so the @@ -35,7 +35,7 @@ * ## Subscribed events * * {@see self::subscribedEvents()} returns a map keyed by **event FQCN** - * (e.g. `\Phlex\Shared\Events\Playback\PlaybackStarted::class`) to + * (e.g. `\Phlix\Shared\Events\Playback\PlaybackStarted::class`) to * either: * * - A PHP `callable` (closure, `[$plugin, 'methodName']`, invokable @@ -43,11 +43,11 @@ * - A method name (string), which the loader binds as * `[$pluginInstance, $methodName]` for convenience. * - * The loader translates manifest aliases (`phlex.playback.started`) to - * FQCNs via {@see \Phlex\Shared\Plugin\EventNameMap} before calling this + * The loader translates manifest aliases (`phlix.playback.started`) to + * FQCNs via {@see \Phlix\Shared\Plugin\EventNameMap} before calling this * method, so plugin authors deal exclusively with FQCNs at runtime. * - * @package Phlex\Shared\Plugin + * @package Phlix\Shared\Plugin * @since 0.2.0 */ interface LifecycleInterface diff --git a/src/Plugin/Manifest.php b/src/Plugin/Manifest.php index 7b2441c..66e7555 100644 --- a/src/Plugin/Manifest.php +++ b/src/Plugin/Manifest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Phlex\Shared\Plugin; +namespace Phlix\Shared\Plugin; use JsonException; use RuntimeException; @@ -18,8 +18,8 @@ * including unknown {@see ManifestType} values and missing required * fields, are deferred so the caller sees every problem at once via * a separate validator pass. - * 2. Validation is performed by `Phlex\Plugins\Manifest\ManifestSchema` - * in `phlex-server` (which owns the JSON Schema file). The validator + * 2. Validation is performed by `Phlix\Plugins\Manifest\ManifestSchema` + * in `phlix-server` (which owns the JSON Schema file). The validator * consumes a `Manifest` via {@see self::getRawData()} and * {@see self::getUnknownFields()} and emits a list of * {@see ManifestValidationError}. @@ -30,12 +30,12 @@ * * ## Subclassing * - * This class is **not** `final` so the `phlex-server` deprecation - * wrapper at `Phlex\Plugins\Manifest` can extend it for one release. + * This class is **not** `final` so the `phlix-server` deprecation + * wrapper at `Phlix\Plugins\Manifest` can extend it for one release. * Other callers should not subclass — treat the class as effectively * final. * - * @package Phlex\Shared\Plugin + * @package Phlix\Shared\Plugin * @since 0.2.0 */ class Manifest @@ -49,7 +49,7 @@ class Manifest public const array KNOWN_TOP_LEVEL_KEYS = [ 'name', 'version', - 'phlex_min_server_version', + 'phlix_min_server_version', 'type', 'entry', 'events', @@ -58,9 +58,9 @@ class Manifest ]; /** - * @param string $name Plugin identifier, kebab-case, prefixed `phlex-plugin-`. + * @param string $name Plugin identifier, kebab-case, prefixed `phlix-plugin-`. * @param string $version Plugin semver. - * @param string $phlexMinServerVersion Minimum Phlex server semver. + * @param string $phlixMinServerVersion Minimum Phlix server semver. * @param string $type Raw type string. Resolve via {@see self::manifestType()}. * @param string $entry Fully-qualified entry-class name. * @param list $events Manifest event aliases. @@ -73,7 +73,7 @@ class Manifest final protected function __construct( public readonly string $name, public readonly string $version, - public readonly string $phlexMinServerVersion, + public readonly string $phlixMinServerVersion, public readonly string $type, public readonly string $entry, public readonly array $events, @@ -126,8 +126,8 @@ public static function fromArray(array $data): static $name = is_string($data['name'] ?? null) ? (string) $data['name'] : ''; $version = is_string($data['version'] ?? null) ? (string) $data['version'] : ''; - $minVersion = is_string($data['phlex_min_server_version'] ?? null) - ? (string) $data['phlex_min_server_version'] + $minVersion = is_string($data['phlix_min_server_version'] ?? null) + ? (string) $data['phlix_min_server_version'] : ''; $entry = is_string($data['entry'] ?? null) ? (string) $data['entry'] : ''; @@ -167,7 +167,7 @@ public static function fromArray(array $data): static return new static( name: $name, version: $version, - phlexMinServerVersion: $minVersion, + phlixMinServerVersion: $minVersion, type: $rawType, entry: $entry, events: $events, @@ -205,7 +205,7 @@ public function toArray(): array /** * Access the original decoded manifest payload. Used by the - * `phlex-server` validator (`Phlex\Plugins\Manifest\ManifestSchema`) + * `phlix-server` validator (`Phlix\Plugins\Manifest\ManifestSchema`) * to feed the JSON Schema engine. * * @return array diff --git a/src/Plugin/ManifestType.php b/src/Plugin/ManifestType.php index 60ece1e..335a1bb 100644 --- a/src/Plugin/ManifestType.php +++ b/src/Plugin/ManifestType.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Phlex\Shared\Plugin; +namespace Phlix\Shared\Plugin; /** * Enumeration of supported plugin categories. * * Each case maps to one of the eleven plugin types listed in - * `PHLEX_EXPANSION_PLAN.md` §5. The string `value` is the kebab-case form + * `PHLIX_EXPANSION_PLAN.md` §5. The string `value` is the kebab-case form * that appears in `plugin.json` and in `docs/plugins/manifest.schema.json` - * shipped with `phlex-server`. + * shipped with `phlix-server`. * - * @package Phlex\Shared\Plugin + * @package Phlix\Shared\Plugin * @since 0.2.0 */ enum ManifestType: string diff --git a/src/Plugin/ManifestValidationError.php b/src/Plugin/ManifestValidationError.php index 0f6bbf7..5580ec7 100644 --- a/src/Plugin/ManifestValidationError.php +++ b/src/Plugin/ManifestValidationError.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Phlex\Shared\Plugin; +namespace Phlix\Shared\Plugin; /** * Immutable DTO describing a single validation problem found while * checking a parsed {@see Manifest} against the JSON Schema at - * `docs/plugins/manifest.schema.json` shipped with `phlex-server` (or + * `docs/plugins/manifest.schema.json` shipped with `phlix-server` (or * against any soft rule, such as "unknown field", that the schema * cannot express). * @@ -16,12 +16,12 @@ * `type`, `unknown_field`, …). `message` is the human-readable * description suitable for surfacing in admin UI tooltips. * - * The validator producing these objects lives in `phlex-server` as - * `Phlex\Plugins\Manifest\ManifestSchema`; the DTO itself is shared so - * that future tooling (e.g. `phlex-hub` plugin auditing) can interpret + * The validator producing these objects lives in `phlix-server` as + * `Phlix\Plugins\Manifest\ManifestSchema`; the DTO itself is shared so + * that future tooling (e.g. `phlix-hub` plugin auditing) can interpret * validation results without depending on the server's schema file. * - * @package Phlex\Shared\Plugin + * @package Phlix\Shared\Plugin * @since 0.2.0 */ final class ManifestValidationError diff --git a/src/Version.php b/src/Version.php index e263982..8ac68d4 100644 --- a/src/Version.php +++ b/src/Version.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Phlex\Shared; +namespace Phlix\Shared; /** * Compile-time-constant package version marker. * - * This class exists so `phlex-shared` v0.1.0 has a non-empty src/ + * This class exists so `phlix-shared` v0.1.0 has a non-empty src/ * tree — every CI tool, PHPStan, Psalm, and PHPUnit needs at least * one source file to chew on. Real interfaces and DTOs land in - * v0.2.0 (Step B.3 of PHLEX_EXPANSION_PLAN.md). + * v0.2.0 (Step B.3 of PHLIX_EXPANSION_PLAN.md). * * Keep this in sync with the git tag and the CHANGELOG entry. * - * @package Phlex\Shared + * @package Phlix\Shared * @since 0.1.0 */ final class Version diff --git a/tests/Arr/ArrClientFactoryTest.php b/tests/Arr/ArrClientFactoryTest.php index da0f847..98e802e 100644 --- a/tests/Arr/ArrClientFactoryTest.php +++ b/tests/Arr/ArrClientFactoryTest.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\ArrClientFactory; -use Phlex\Shared\Arr\SonarrClient; -use Phlex\Shared\Arr\RadarrClient; +use Phlix\Shared\Arr\ArrClientFactory; +use Phlix\Shared\Arr\SonarrClient; +use Phlix\Shared\Arr\RadarrClient; /** * Unit tests for ArrClientFactory. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class ArrClientFactoryTest extends TestCase diff --git a/tests/Arr/BazarrClientTest.php b/tests/Arr/BazarrClientTest.php index d21e54a..a835f2e 100644 --- a/tests/Arr/BazarrClientTest.php +++ b/tests/Arr/BazarrClientTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\BazarrClient; +use Phlix\Shared\Arr\BazarrClient; /** * Unit tests for BazarrClient. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class BazarrClientTest extends TestCase diff --git a/tests/Arr/ProwlarrClientTest.php b/tests/Arr/ProwlarrClientTest.php index caba7bf..1bc9547 100644 --- a/tests/Arr/ProwlarrClientTest.php +++ b/tests/Arr/ProwlarrClientTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\ProwlarrClient; +use Phlix\Shared\Arr\ProwlarrClient; /** * Unit tests for ProwlarrClient. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class ProwlarrClientTest extends TestCase diff --git a/tests/Arr/RadarrClientTest.php b/tests/Arr/RadarrClientTest.php index 3d61bd1..1d0280a 100644 --- a/tests/Arr/RadarrClientTest.php +++ b/tests/Arr/RadarrClientTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\RadarrClient; +use Phlix\Shared\Arr\RadarrClient; /** * Unit tests for RadarrClient. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class RadarrClientTest extends TestCase diff --git a/tests/Arr/SonarrClientTest.php b/tests/Arr/SonarrClientTest.php index 5d29690..220db31 100644 --- a/tests/Arr/SonarrClientTest.php +++ b/tests/Arr/SonarrClientTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\SonarrClient; +use Phlix\Shared\Arr\SonarrClient; /** * Unit tests for SonarrClient. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class SonarrClientTest extends TestCase diff --git a/tests/Arr/TrashGuidesProviderTest.php b/tests/Arr/TrashGuidesProviderTest.php index 993f3bf..f182991 100644 --- a/tests/Arr/TrashGuidesProviderTest.php +++ b/tests/Arr/TrashGuidesProviderTest.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Arr; +namespace Phlix\Shared\Tests\Arr; use PHPUnit\Framework\TestCase; -use Phlex\Shared\Arr\TrashGuidesProvider; +use Phlix\Shared\Arr\TrashGuidesProvider; use Psr\Log\LoggerInterface; /** * Unit tests for TrashGuidesProvider. * - * @package Phlex\Tests\Unit\Arr + * @package Phlix\Tests\Unit\Arr * @since 0.12.0 */ class TrashGuidesProviderTest extends TestCase @@ -34,7 +34,7 @@ public function testConstructorWithoutLogger(): void public function testSyncResultConstructor(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 5, customFormatsUpdated: 2, qualityProfilesAdded: 1, @@ -52,7 +52,7 @@ public function testSyncResultConstructor(): void public function testSyncResultGetTotalChanges(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 5, customFormatsUpdated: 2, qualityProfilesAdded: 1, @@ -66,7 +66,7 @@ public function testSyncResultGetTotalChanges(): void public function testSyncResultGetTotalCustomFormatsChanged(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 5, customFormatsUpdated: 2, qualityProfilesAdded: 0, @@ -80,7 +80,7 @@ public function testSyncResultGetTotalCustomFormatsChanged(): void public function testSyncResultGetTotalQualityProfilesChanged(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 0, customFormatsUpdated: 0, qualityProfilesAdded: 3, @@ -94,7 +94,7 @@ public function testSyncResultGetTotalQualityProfilesChanged(): void public function testSyncResultIsEmptyWhenNoChanges(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 0, customFormatsUpdated: 0, qualityProfilesAdded: 0, @@ -108,7 +108,7 @@ public function testSyncResultIsEmptyWhenNoChanges(): void public function testSyncResultIsNotEmptyWhenChanges(): void { - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 1, customFormatsUpdated: 0, qualityProfilesAdded: 0, @@ -123,7 +123,7 @@ public function testSyncResultIsNotEmptyWhenChanges(): void public function testSyncResultToArray(): void { $syncedAt = new \DateTimeImmutable('2024-01-15 12:00:00'); - $result = new \Phlex\Shared\Arr\SyncResult( + $result = new \Phlix\Shared\Arr\SyncResult( customFormatsAdded: 5, customFormatsUpdated: 2, qualityProfilesAdded: 1, diff --git a/tests/Auth/JwtClaimsTest.php b/tests/Auth/JwtClaimsTest.php index ec447f6..46c2599 100644 --- a/tests/Auth/JwtClaimsTest.php +++ b/tests/Auth/JwtClaimsTest.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Auth; +namespace Phlix\Shared\Tests\Auth; use InvalidArgumentException; -use Phlex\Shared\Auth\JwtClaims; +use Phlix\Shared\Auth\JwtClaims; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Auth\JwtClaims + * @covers \Phlix\Shared\Auth\JwtClaims */ final class JwtClaimsTest extends TestCase { public function test_fromPayload_with_full_payload_roundtrips(): void { $payload = [ - 'iss' => JwtClaims::ISS_PHLEX_HUB, + 'iss' => JwtClaims::ISS_PHLIX_HUB, 'aud' => JwtClaims::AUD_CLIENT, 'sub' => 'user-uuid', 'iat' => 1700000000, @@ -35,7 +35,7 @@ public function test_fromPayload_with_full_payload_roundtrips(): void public function test_fromPayload_with_minimal_legacy_payload(): void { $claims = JwtClaims::fromPayload([ - 'iss' => JwtClaims::ISS_PHLEX, + 'iss' => JwtClaims::ISS_PHLIX, 'sub' => 'user-uuid', 'iat' => 1700000000, 'exp' => 1700003600, @@ -63,7 +63,7 @@ public function test_fromPayload_wrong_type_iat_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "iat" must be an integer.'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 'not-int', 'exp' => 2, 'type' => 'access', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 'not-int', 'exp' => 2, 'type' => 'access', ]); } @@ -72,7 +72,7 @@ public function test_fromPayload_invalid_aud_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "aud" must be a string.'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'aud' => 42, 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', + 'iss' => 'phlix', 'aud' => 42, 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', ]); } @@ -81,7 +81,7 @@ public function test_fromPayload_invalid_nbf_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "nbf"'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'nbf' => 'oops', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'nbf' => 'oops', ]); } @@ -90,7 +90,7 @@ public function test_fromPayload_invalid_jti_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "jti"'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'jti' => 42, + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'jti' => 42, ]); } @@ -99,7 +99,7 @@ public function test_fromPayload_invalid_scope_shape_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "scope"'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'scope' => 'oops', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'scope' => 'oops', ]); } @@ -108,7 +108,7 @@ public function test_fromPayload_invalid_scope_entry_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('only strings'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'scope' => ['ok', 42], + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'scope' => ['ok', 42], ]); } @@ -117,14 +117,14 @@ public function test_fromPayload_invalid_serverId_throws(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('JWT claim "serverId"'); JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'serverId' => 99, + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', 'serverId' => 99, ]); } public function test_isExpired_compares_exp_to_now(): void { $claims = JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 100, 'type' => 'access', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 100, 'type' => 'access', ]); $this->assertTrue($claims->isExpired(200)); @@ -136,7 +136,7 @@ public function test_isExpired_compares_exp_to_now(): void public function test_hasScope_true_when_scope_present(): void { $claims = JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 200, 'type' => 'access', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 200, 'type' => 'access', 'scope' => ['library:read'], ]); @@ -147,7 +147,7 @@ public function test_hasScope_true_when_scope_present(): void public function test_toPayload_omits_optional_null_fields(): void { $claims = JwtClaims::fromPayload([ - 'iss' => 'phlex', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', + 'iss' => 'phlix', 'sub' => 'u', 'iat' => 1, 'exp' => 2, 'type' => 'access', ]); $payload = $claims->toPayload(); diff --git a/tests/Events/AbstractEventTest.php b/tests/Events/AbstractEventTest.php index 098656f..b442050 100644 --- a/tests/Events/AbstractEventTest.php +++ b/tests/Events/AbstractEventTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Events; +namespace Phlix\Shared\Tests\Events; -use Phlex\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\AbstractEvent; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Events\AbstractEvent + * @covers \Phlix\Shared\Events\AbstractEvent */ final class AbstractEventTest extends TestCase { diff --git a/tests/Events/Auth/UserCreatedTest.php b/tests/Events/Auth/UserCreatedTest.php index c69208c..1b72ab0 100644 --- a/tests/Events/Auth/UserCreatedTest.php +++ b/tests/Events/Auth/UserCreatedTest.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Events\Auth; +namespace Phlix\Shared\Tests\Events\Auth; -use Phlex\Shared\Events\AbstractEvent; -use Phlex\Shared\Events\Auth\UserCreated; -use Phlex\Shared\Events\Auth\UserLoggedIn; -use Phlex\Shared\Events\Auth\UserLoggedOut; +use Phlix\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\Auth\UserCreated; +use Phlix\Shared\Events\Auth\UserLoggedIn; +use Phlix\Shared\Events\Auth\UserLoggedOut; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Events\Auth\UserCreated - * @covers \Phlex\Shared\Events\Auth\UserLoggedIn - * @covers \Phlex\Shared\Events\Auth\UserLoggedOut + * @covers \Phlix\Shared\Events\Auth\UserCreated + * @covers \Phlix\Shared\Events\Auth\UserLoggedIn + * @covers \Phlix\Shared\Events\Auth\UserLoggedOut */ final class UserCreatedTest extends TestCase { diff --git a/tests/Events/Library/LibraryScanCompletedTest.php b/tests/Events/Library/LibraryScanCompletedTest.php index 2dd0e02..9bc0ad9 100644 --- a/tests/Events/Library/LibraryScanCompletedTest.php +++ b/tests/Events/Library/LibraryScanCompletedTest.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Events\Library; +namespace Phlix\Shared\Tests\Events\Library; -use Phlex\Shared\Events\AbstractEvent; -use Phlex\Shared\Events\Library\LibraryScanCompleted; -use Phlex\Shared\Events\Library\LibraryScanStarted; -use Phlex\Shared\Events\Library\MediaItemAdded; -use Phlex\Shared\Events\Library\MediaItemRemoved; -use Phlex\Shared\Events\Library\MediaItemUpdated; +use Phlix\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\Library\LibraryScanCompleted; +use Phlix\Shared\Events\Library\LibraryScanStarted; +use Phlix\Shared\Events\Library\MediaItemAdded; +use Phlix\Shared\Events\Library\MediaItemRemoved; +use Phlix\Shared\Events\Library\MediaItemUpdated; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Events\Library\LibraryScanCompleted - * @covers \Phlex\Shared\Events\Library\LibraryScanStarted - * @covers \Phlex\Shared\Events\Library\MediaItemAdded - * @covers \Phlex\Shared\Events\Library\MediaItemUpdated - * @covers \Phlex\Shared\Events\Library\MediaItemRemoved + * @covers \Phlix\Shared\Events\Library\LibraryScanCompleted + * @covers \Phlix\Shared\Events\Library\LibraryScanStarted + * @covers \Phlix\Shared\Events\Library\MediaItemAdded + * @covers \Phlix\Shared\Events\Library\MediaItemUpdated + * @covers \Phlix\Shared\Events\Library\MediaItemRemoved */ final class LibraryScanCompletedTest extends TestCase { diff --git a/tests/Events/Playback/PlaybackStartedTest.php b/tests/Events/Playback/PlaybackStartedTest.php index 9fc152c..3183b8b 100644 --- a/tests/Events/Playback/PlaybackStartedTest.php +++ b/tests/Events/Playback/PlaybackStartedTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Events\Playback; +namespace Phlix\Shared\Tests\Events\Playback; -use Phlex\Shared\Events\AbstractEvent; -use Phlex\Shared\Events\Playback\PlaybackPaused; -use Phlex\Shared\Events\Playback\PlaybackResumed; -use Phlex\Shared\Events\Playback\PlaybackStarted; -use Phlex\Shared\Events\Playback\PlaybackStopped; +use Phlix\Shared\Events\AbstractEvent; +use Phlix\Shared\Events\Playback\PlaybackPaused; +use Phlix\Shared\Events\Playback\PlaybackResumed; +use Phlix\Shared\Events\Playback\PlaybackStarted; +use Phlix\Shared\Events\Playback\PlaybackStopped; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Events\Playback\PlaybackStarted - * @covers \Phlex\Shared\Events\Playback\PlaybackPaused - * @covers \Phlex\Shared\Events\Playback\PlaybackResumed - * @covers \Phlex\Shared\Events\Playback\PlaybackStopped + * @covers \Phlix\Shared\Events\Playback\PlaybackStarted + * @covers \Phlix\Shared\Events\Playback\PlaybackPaused + * @covers \Phlix\Shared\Events\Playback\PlaybackResumed + * @covers \Phlix\Shared\Events\Playback\PlaybackStopped */ final class PlaybackStartedTest extends TestCase { diff --git a/tests/Hub/ClaimRequestTest.php b/tests/Hub/ClaimRequestTest.php index 581a493..00dbe7e 100644 --- a/tests/Hub/ClaimRequestTest.php +++ b/tests/Hub/ClaimRequestTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Hub; +namespace Phlix\Shared\Tests\Hub; use InvalidArgumentException; -use Phlex\Shared\Hub\ClaimRequest; +use Phlix\Shared\Hub\ClaimRequest; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Hub\ClaimRequest + * @covers \Phlix\Shared\Hub\ClaimRequest */ final class ClaimRequestTest extends TestCase { @@ -22,7 +22,7 @@ private static function full(): array 'serverName' => "Alice's NAS", 'version' => '0.11.0', 'publicKeysJwk' => ['keys' => []], - 'hostnameCandidates' => ['10.0.0.5', 'phlex.local'], + 'hostnameCandidates' => ['10.0.0.5', 'phlix.local'], 'protocolVersion' => 'v1', ]; } diff --git a/tests/Hub/ClaimResponseTest.php b/tests/Hub/ClaimResponseTest.php index 5b11646..eb220c3 100644 --- a/tests/Hub/ClaimResponseTest.php +++ b/tests/Hub/ClaimResponseTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Hub; +namespace Phlix\Shared\Tests\Hub; use InvalidArgumentException; -use Phlex\Shared\Hub\ClaimResponse; +use Phlix\Shared\Hub\ClaimResponse; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Hub\ClaimResponse + * @covers \Phlix\Shared\Hub\ClaimResponse */ final class ClaimResponseTest extends TestCase { diff --git a/tests/Hub/HeartbeatDtoTest.php b/tests/Hub/HeartbeatDtoTest.php index a02d644..a74018b 100644 --- a/tests/Hub/HeartbeatDtoTest.php +++ b/tests/Hub/HeartbeatDtoTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Hub; +namespace Phlix\Shared\Tests\Hub; use InvalidArgumentException; -use Phlex\Shared\Hub\HeartbeatDto; +use Phlix\Shared\Hub\HeartbeatDto; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Hub\HeartbeatDto + * @covers \Phlix\Shared\Hub\HeartbeatDto */ final class HeartbeatDtoTest extends TestCase { diff --git a/tests/Hub/ServerInfoDtoTest.php b/tests/Hub/ServerInfoDtoTest.php index 1615696..facb797 100644 --- a/tests/Hub/ServerInfoDtoTest.php +++ b/tests/Hub/ServerInfoDtoTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Hub; +namespace Phlix\Shared\Tests\Hub; use InvalidArgumentException; -use Phlex\Shared\Hub\ServerInfoDto; +use Phlix\Shared\Hub\ServerInfoDto; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Hub\ServerInfoDto + * @covers \Phlix\Shared\Hub\ServerInfoDto */ final class ServerInfoDtoTest extends TestCase { diff --git a/tests/Plugin/EventNameMapTest.php b/tests/Plugin/EventNameMapTest.php index 694bd68..7d06d55 100644 --- a/tests/Plugin/EventNameMapTest.php +++ b/tests/Plugin/EventNameMapTest.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Plugin; +namespace Phlix\Shared\Tests\Plugin; -use Phlex\Shared\Events\Auth\UserCreated; -use Phlex\Shared\Events\Auth\UserLoggedIn; -use Phlex\Shared\Events\Auth\UserLoggedOut; -use Phlex\Shared\Events\Library\LibraryScanCompleted; -use Phlex\Shared\Events\Library\LibraryScanStarted; -use Phlex\Shared\Events\Library\MediaItemAdded; -use Phlex\Shared\Events\Library\MediaItemRemoved; -use Phlex\Shared\Events\Library\MediaItemUpdated; -use Phlex\Shared\Events\Playback\PlaybackPaused; -use Phlex\Shared\Events\Playback\PlaybackResumed; -use Phlex\Shared\Events\Playback\PlaybackStarted; -use Phlex\Shared\Events\Playback\PlaybackStopped; -use Phlex\Shared\Plugin\EventNameMap; +use Phlix\Shared\Events\Auth\UserCreated; +use Phlix\Shared\Events\Auth\UserLoggedIn; +use Phlix\Shared\Events\Auth\UserLoggedOut; +use Phlix\Shared\Events\Library\LibraryScanCompleted; +use Phlix\Shared\Events\Library\LibraryScanStarted; +use Phlix\Shared\Events\Library\MediaItemAdded; +use Phlix\Shared\Events\Library\MediaItemRemoved; +use Phlix\Shared\Events\Library\MediaItemUpdated; +use Phlix\Shared\Events\Playback\PlaybackPaused; +use Phlix\Shared\Events\Playback\PlaybackResumed; +use Phlix\Shared\Events\Playback\PlaybackStarted; +use Phlix\Shared\Events\Playback\PlaybackStopped; +use Phlix\Shared\Plugin\EventNameMap; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Plugin\EventNameMap + * @covers \Phlix\Shared\Plugin\EventNameMap */ final class EventNameMapTest extends TestCase { @@ -30,18 +30,18 @@ final class EventNameMapTest extends TestCase public static function aliasProvider(): array { return [ - ['phlex.playback.started', PlaybackStarted::class], - ['phlex.playback.paused', PlaybackPaused::class], - ['phlex.playback.resumed', PlaybackResumed::class], - ['phlex.playback.stopped', PlaybackStopped::class], - ['phlex.library.scan.started', LibraryScanStarted::class], - ['phlex.library.scan.completed', LibraryScanCompleted::class], - ['phlex.library.item.added', MediaItemAdded::class], - ['phlex.library.item.updated', MediaItemUpdated::class], - ['phlex.library.item.removed', MediaItemRemoved::class], - ['phlex.user.created', UserCreated::class], - ['phlex.user.logged_in', UserLoggedIn::class], - ['phlex.user.logged_out', UserLoggedOut::class], + ['phlix.playback.started', PlaybackStarted::class], + ['phlix.playback.paused', PlaybackPaused::class], + ['phlix.playback.resumed', PlaybackResumed::class], + ['phlix.playback.stopped', PlaybackStopped::class], + ['phlix.library.scan.started', LibraryScanStarted::class], + ['phlix.library.scan.completed', LibraryScanCompleted::class], + ['phlix.library.item.added', MediaItemAdded::class], + ['phlix.library.item.updated', MediaItemUpdated::class], + ['phlix.library.item.removed', MediaItemRemoved::class], + ['phlix.user.created', UserCreated::class], + ['phlix.user.logged_in', UserLoggedIn::class], + ['phlix.user.logged_out', UserLoggedOut::class], ]; } @@ -65,7 +65,7 @@ public function test_toAlias_returns_alias(string $alias, string $fqcn): void public function test_fromAlias_returns_null_for_unknown_alias(): void { - $this->assertNull(EventNameMap::fromAlias('phlex.unknown')); + $this->assertNull(EventNameMap::fromAlias('phlix.unknown')); } public function test_toAlias_returns_null_for_unknown_fqcn(): void diff --git a/tests/Plugin/LifecycleInterfaceTest.php b/tests/Plugin/LifecycleInterfaceTest.php index da8bde4..e353aa7 100644 --- a/tests/Plugin/LifecycleInterfaceTest.php +++ b/tests/Plugin/LifecycleInterfaceTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Plugin; +namespace Phlix\Shared\Tests\Plugin; -use Phlex\Shared\Plugin\LifecycleInterface; +use Phlix\Shared\Plugin\LifecycleInterface; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use ReflectionClass; diff --git a/tests/Plugin/ManifestTest.php b/tests/Plugin/ManifestTest.php index e951d62..33c3438 100644 --- a/tests/Plugin/ManifestTest.php +++ b/tests/Plugin/ManifestTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Plugin; +namespace Phlix\Shared\Tests\Plugin; -use Phlex\Shared\Plugin\Manifest; -use Phlex\Shared\Plugin\ManifestType; +use Phlix\Shared\Plugin\Manifest; +use Phlix\Shared\Plugin\ManifestType; use PHPUnit\Framework\TestCase; use RuntimeException; /** - * @covers \Phlex\Shared\Plugin\Manifest + * @covers \Phlix\Shared\Plugin\Manifest */ final class ManifestTest extends TestCase { @@ -31,24 +31,24 @@ public function test_fromJson_throws_on_non_object_root(): void public function test_fromArray_populates_readonly_props(): void { $manifest = Manifest::fromArray([ - 'name' => 'phlex-plugin-example', + 'name' => 'phlix-plugin-example', 'version' => '1.0.0', - 'phlex_min_server_version' => '0.10.0', + 'phlix_min_server_version' => '0.10.0', 'type' => 'notifier', 'entry' => 'Acme\\Plugin\\Entry', - 'events' => ['phlex.playback.started', 'phlex.user.created'], + 'events' => ['phlix.playback.started', 'phlix.user.created'], 'settings' => [ 'api_key' => ['type' => 'string', 'required' => true, 'secret' => true], ], 'signature' => 'sha256:deadbeef', ]); - $this->assertSame('phlex-plugin-example', $manifest->name); + $this->assertSame('phlix-plugin-example', $manifest->name); $this->assertSame('1.0.0', $manifest->version); - $this->assertSame('0.10.0', $manifest->phlexMinServerVersion); + $this->assertSame('0.10.0', $manifest->phlixMinServerVersion); $this->assertSame('notifier', $manifest->type); $this->assertSame('Acme\\Plugin\\Entry', $manifest->entry); - $this->assertSame(['phlex.playback.started', 'phlex.user.created'], $manifest->events); + $this->assertSame(['phlix.playback.started', 'phlix.user.created'], $manifest->events); $this->assertSame( ['api_key' => ['type' => 'string', 'required' => true, 'secret' => true]], $manifest->settings, @@ -60,7 +60,7 @@ public function test_fromArray_populates_readonly_props(): void public function test_fromArray_records_unknown_fields(): void { $manifest = Manifest::fromArray([ - 'name' => 'phlex-plugin-x', + 'name' => 'phlix-plugin-x', 'extra' => 'unexpected', 'another' => 42, ]); @@ -95,7 +95,7 @@ public function test_manifestType_returns_null_when_type_empty(): void public function test_toArray_round_trips_raw_data(): void { $data = [ - 'name' => 'phlex-plugin-x', + 'name' => 'phlix-plugin-x', 'version' => '0.1.0', 'type' => 'notifier', ]; @@ -112,9 +112,9 @@ public function test_getRawData_returns_input(): void public function test_fromArray_ignores_non_string_events(): void { $manifest = Manifest::fromArray([ - 'events' => ['phlex.x', 42, true, 'phlex.y'], + 'events' => ['phlix.x', 42, true, 'phlix.y'], ]); - $this->assertSame(['phlex.x', 'phlex.y'], $manifest->events); + $this->assertSame(['phlix.x', 'phlix.y'], $manifest->events); } public function test_fromArray_ignores_non_array_settings_entries(): void diff --git a/tests/Plugin/ManifestTypeTest.php b/tests/Plugin/ManifestTypeTest.php index e7a24f8..99ac59a 100644 --- a/tests/Plugin/ManifestTypeTest.php +++ b/tests/Plugin/ManifestTypeTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Plugin; +namespace Phlix\Shared\Tests\Plugin; -use Phlex\Shared\Plugin\ManifestType; +use Phlix\Shared\Plugin\ManifestType; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Plugin\ManifestType + * @covers \Phlix\Shared\Plugin\ManifestType */ final class ManifestTypeTest extends TestCase { diff --git a/tests/Plugin/ManifestValidationErrorTest.php b/tests/Plugin/ManifestValidationErrorTest.php index f988cdc..820231d 100644 --- a/tests/Plugin/ManifestValidationErrorTest.php +++ b/tests/Plugin/ManifestValidationErrorTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests\Plugin; +namespace Phlix\Shared\Tests\Plugin; -use Phlex\Shared\Plugin\ManifestValidationError; +use Phlix\Shared\Plugin\ManifestValidationError; use PHPUnit\Framework\TestCase; /** - * @covers \Phlex\Shared\Plugin\ManifestValidationError + * @covers \Phlix\Shared\Plugin\ManifestValidationError */ final class ManifestValidationErrorTest extends TestCase { diff --git a/tests/VersionTest.php b/tests/VersionTest.php index 8d92d51..08299c1 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Phlex\Shared\Tests; +namespace Phlix\Shared\Tests; -use Phlex\Shared\Version; +use Phlix\Shared\Version; use PHPUnit\Framework\TestCase; use ReflectionClass; /** - * @covers \Phlex\Shared\Version + * @covers \Phlix\Shared\Version */ final class VersionTest extends TestCase {