From 2dd5eedbff0ca681b49e4610a0f97004d246cc3a Mon Sep 17 00:00:00 2001 From: Matheus Martins Date: Mon, 20 Jul 2026 21:00:57 +0000 Subject: [PATCH 1/2] fix(collections): rename package to xphp-lang/collections Align the Composer package name (and the README title) with the plural GitHub repository slug, xphp-lang/collections. The PHP namespace XPHP\Collection is deliberately kept singular -- it is independent of the package name and renaming it would be a breaking API change. Metadata only; composer validate passes. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0937ace..5ea61f2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# xphp-lang/collection +# xphp-lang/collections Generic, immutable, variance-aware collections for PHP, built on [xphp](https://github.com/xphp-lang/xphp) monomorphization — real generics with declaration-site diff --git a/composer.json b/composer.json index b586cf1..3837b00 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "xphp-lang/collection", + "name": "xphp-lang/collections", "description": "Generic, immutable, variance-aware collections for PHP, powered by xphp monomorphization (real generics with declaration-site variance).", "license": "MIT", "type": "library", From 0868e22d53eab38f631caf3de858578e6ea83ee5 Mon Sep 17 00:00:00 2001 From: Matheus Martins Date: Mon, 20 Jul 2026 21:31:40 +0000 Subject: [PATCH 2/2] refactor(collections)!: rename namespace to XPHP\Collections Pluralize the PHP namespace root XPHP\Collection -> XPHP\Collections across src, tests, examples, the composer.json autoload prefixes, and ADR-0006/0008, aligning it with the plural package name and repository (xphp-lang/collections). The root class/interface `Collection` stays singular; only the namespace segment changes, and PSR-4 still maps the prefix to src/ + build/ (no directory move). Clean rebuild is green: check, 89 unit tests, PHPStan level 9, 100% MSI, demo. BREAKING CHANGE: consumers must update `use XPHP\Collection\...` to `use XPHP\Collections\...`. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 +- composer.json | 6 +++--- docs/adr/0006-namespace-layout.md | 12 ++++++------ docs/adr/0008-list-to-map-derivations.md | 2 +- examples/Book.xphp | 2 +- examples/ByName.xphp | 4 ++-- examples/Demo.xphp | 18 +++++++++--------- examples/Product.xphp | 2 +- src/Collection.xphp | 2 +- src/Comparator.xphp | 2 +- src/Lists/ImmutableGrouping.xphp | 4 ++-- src/Lists/ImmutableList.xphp | 10 +++++----- src/Lists/ImmutableReducing.xphp | 2 +- src/Lists/ImmutableZipping.xphp | 6 +++--- src/Lists/OrderedCollection.xphp | 4 ++-- src/Maps/Entry.xphp | 2 +- src/Maps/ImmutableMap.xphp | 6 +++--- src/Maps/Map.xphp | 4 ++-- src/Maps/Pair.xphp | 2 +- src/Sets/ImmutableSet.xphp | 4 ++-- src/Sets/Set.xphp | 4 ++-- src/Support/AbstractImmutableCollection.xphp | 4 ++-- src/Tuples/Couple.xphp | 2 +- src/Tuples/Tuple.xphp | 6 +++--- tests/ComparatorTest.xphp | 8 ++++---- tests/Fixtures/Book.xphp | 2 +- tests/Fixtures/ByName.xphp | 4 ++-- tests/Fixtures/Product.xphp | 2 +- tests/Lists/ImmutableGroupingTest.xphp | 12 ++++++------ tests/Lists/ImmutableListTest.xphp | 16 ++++++++-------- tests/Lists/ImmutableReducingTest.xphp | 10 +++++----- tests/Lists/ImmutableZippingTest.xphp | 14 +++++++------- tests/Maps/ImmutableMapTest.xphp | 12 ++++++------ tests/Maps/PairTest.xphp | 10 +++++----- tests/Sets/ImmutableSetTest.xphp | 12 ++++++------ tests/Tuples/CoupleTest.xphp | 10 +++++----- tests/bootstrap.php | 2 +- 37 files changed, 113 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 5ea61f2..19290d0 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Immutable concrete classes (`readonly`): | `Pair` | `Entry` | | `Couple` | `Tuple` (`readonly`; `component1()`/`component2()` destructuring) | -Types are grouped by concept under `XPHP\Collection`: the root `Collection`/`Comparator`, then `Lists\` +Types are grouped by concept under `XPHP\Collections`: the root `Collection`/`Comparator`, then `Lists\` (including the static `ImmutableGrouping`/`ImmutableZipping`/`ImmutableReducing` helpers), `Sets\`, `Maps\` (which holds `Map`/`Entry`/`ImmutableMap`/`Pair`), and `Tuples\` (`Tuple`/`Couple`), plus `Support\` for the internal base. The layout is frozen and additive-only — diff --git a/composer.json b/composer.json index 3837b00..5951b20 100644 --- a/composer.json +++ b/composer.json @@ -27,13 +27,13 @@ "autoload": { "psr-4": { "XPHP\\Generated\\": "cache/Generated/", - "XPHP\\Collection\\": ["src/", "build/"] + "XPHP\\Collections\\": ["src/", "build/"] } }, "autoload-dev": { "psr-4": { - "XPHP\\Collection\\Tests\\": "build/", - "XPHP\\Collection\\Example\\": "build/" + "XPHP\\Collections\\Tests\\": "build/", + "XPHP\\Collections\\Example\\": "build/" } }, "scripts": { diff --git a/docs/adr/0006-namespace-layout.md b/docs/adr/0006-namespace-layout.md index dc970fc..2b84ea0 100644 --- a/docs/adr/0006-namespace-layout.md +++ b/docs/adr/0006-namespace-layout.md @@ -9,7 +9,7 @@ survives xphp monomorphization — `class_alias()` is a runtime hack that does n template/variance machinery. So **relocating a type after release is a hard breaking change with no soft-migration path**. The layout must be decided before a stable release and then frozen. -A flat namespace (everything under `XPHP\Collection`) mixes the root abstraction with leaf and helper +A flat namespace (everything under `XPHP\Collections`) mixes the root abstraction with leaf and helper types (`Entry`/`Pair` sat beside `Collection`) and does not scale as the mutable tier and other data structures arrive. @@ -20,11 +20,11 @@ Group types by data-structure **concept**, one namespace per family, carrying th | Namespace | Types | |---|---| -| `XPHP\Collection` | `Collection` (root supertype), `Comparator` (root utility) | -| `XPHP\Collection\Lists` | `OrderedCollection`, `ImmutableList`, `ImmutableGrouping`, `ImmutableZipping` (later `MutableList`) | -| `XPHP\Collection\Sets` | `Set`, `ImmutableSet` (later `MutableSet`) | -| `XPHP\Collection\Maps` | `Map`, `Entry`, `ImmutableMap`, `Pair` (later `MutableMap`) | -| `XPHP\Collection\Support` | `AbstractImmutableCollection` (internal base) | +| `XPHP\Collections` | `Collection` (root supertype), `Comparator` (root utility) | +| `XPHP\Collections\Lists` | `OrderedCollection`, `ImmutableList`, `ImmutableGrouping`, `ImmutableZipping` (later `MutableList`) | +| `XPHP\Collections\Sets` | `Set`, `ImmutableSet` (later `MutableSet`) | +| `XPHP\Collections\Maps` | `Map`, `Entry`, `ImmutableMap`, `Pair` (later `MutableMap`) | +| `XPHP\Collections\Support` | `AbstractImmutableCollection` (internal base) | Family folders are **plural** (`Lists`/`Sets`/`Maps`) to dodge the reserved word `List`, which is illegal as a namespace segment (the same reason the ordered type is not named `List`). `Sequence` is diff --git a/docs/adr/0008-list-to-map-derivations.md b/docs/adr/0008-list-to-map-derivations.md index 5b92450..fafe3d6 100644 --- a/docs/adr/0008-list-to-map-derivations.md +++ b/docs/adr/0008-list-to-map-derivations.md @@ -26,7 +26,7 @@ runtime values are perfectly ordinary maps of lists; only the *static specializa ## Decision Host both derivations as **static generic methods on a plain, non-variant helper class**, -`XPHP\Collection\Lists\ImmutableGrouping`: +`XPHP\Collections\Lists\ImmutableGrouping`: ```php ImmutableGrouping::groupBy(OrderedCollection $list, callable $keyOf): ImmutableMap> diff --git a/examples/Book.xphp b/examples/Book.xphp index 9dff7a2..a862ca5 100644 --- a/examples/Book.xphp +++ b/examples/Book.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Example; +namespace XPHP\Collections\Example; final class Book extends Product { diff --git a/examples/ByName.xphp b/examples/ByName.xphp index db1dc9b..34e7eaa 100644 --- a/examples/ByName.xphp +++ b/examples/ByName.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Example; +namespace XPHP\Collections\Example; -use XPHP\Collection\Comparator; +use XPHP\Collections\Comparator; /** * A comparator over the supertype Product (so it can also order Books, by contravariance). diff --git a/examples/Demo.xphp b/examples/Demo.xphp index 423b4a3..d85cceb 100644 --- a/examples/Demo.xphp +++ b/examples/Demo.xphp @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace XPHP\Collection\Example; - -use XPHP\Collection\Lists\ImmutableGrouping; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Lists\ImmutableReducing; -use XPHP\Collection\Lists\ImmutableZipping; -use XPHP\Collection\Lists\OrderedCollection; -use XPHP\Collection\Maps\ImmutableMap; -use XPHP\Collection\Sets\ImmutableSet; +namespace XPHP\Collections\Example; + +use XPHP\Collections\Lists\ImmutableGrouping; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Lists\ImmutableReducing; +use XPHP\Collections\Lists\ImmutableZipping; +use XPHP\Collections\Lists\OrderedCollection; +use XPHP\Collections\Maps\ImmutableMap; +use XPHP\Collections\Sets\ImmutableSet; use function array_map; use function implode; diff --git a/examples/Product.xphp b/examples/Product.xphp index 58daf13..4c853db 100644 --- a/examples/Product.xphp +++ b/examples/Product.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Example; +namespace XPHP\Collections\Example; class Product { diff --git a/src/Collection.xphp b/src/Collection.xphp index 7662b7f..555825d 100644 --- a/src/Collection.xphp +++ b/src/Collection.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection; +namespace XPHP\Collections; use Countable; use IteratorAggregate; diff --git a/src/Comparator.xphp b/src/Comparator.xphp index 06043bf..a79b3bc 100644 --- a/src/Comparator.xphp +++ b/src/Comparator.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection; +namespace XPHP\Collections; /** * A comparison strategy over values of type `T`. diff --git a/src/Lists/ImmutableGrouping.xphp b/src/Lists/ImmutableGrouping.xphp index 3470c60..e4c1f88 100644 --- a/src/Lists/ImmutableGrouping.xphp +++ b/src/Lists/ImmutableGrouping.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Lists; +namespace XPHP\Collections\Lists; -use XPHP\Collection\Maps\ImmutableMap; +use XPHP\Collections\Maps\ImmutableMap; /** * List-to-map derivations: grouping and indexing. diff --git a/src/Lists/ImmutableList.xphp b/src/Lists/ImmutableList.xphp index c7258f1..962ff32 100644 --- a/src/Lists/ImmutableList.xphp +++ b/src/Lists/ImmutableList.xphp @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace XPHP\Collection\Lists; +namespace XPHP\Collections\Lists; -use XPHP\Collection\Comparator; -use XPHP\Collection\Support\AbstractImmutableCollection; -use XPHP\Collection\Tuples\Couple; -use XPHP\Collection\Tuples\Tuple; +use XPHP\Collections\Comparator; +use XPHP\Collections\Support\AbstractImmutableCollection; +use XPHP\Collections\Tuples\Couple; +use XPHP\Collections\Tuples\Tuple; use OutOfRangeException; diff --git a/src/Lists/ImmutableReducing.xphp b/src/Lists/ImmutableReducing.xphp index 0a9276e..b61ad8b 100644 --- a/src/Lists/ImmutableReducing.xphp +++ b/src/Lists/ImmutableReducing.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Lists; +namespace XPHP\Collections\Lists; /** * Widening reduction: fold a list into an accumulator whose type may be a supertype of the element. diff --git a/src/Lists/ImmutableZipping.xphp b/src/Lists/ImmutableZipping.xphp index 0b7ac3e..7c80e00 100644 --- a/src/Lists/ImmutableZipping.xphp +++ b/src/Lists/ImmutableZipping.xphp @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace XPHP\Collection\Lists; +namespace XPHP\Collections\Lists; -use XPHP\Collection\Tuples\Couple; -use XPHP\Collection\Tuples\Tuple; +use XPHP\Collections\Tuples\Couple; +use XPHP\Collections\Tuples\Tuple; use function count; use function min; diff --git a/src/Lists/OrderedCollection.xphp b/src/Lists/OrderedCollection.xphp index 132a860..876d75b 100644 --- a/src/Lists/OrderedCollection.xphp +++ b/src/Lists/OrderedCollection.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Lists; +namespace XPHP\Collections\Lists; -use XPHP\Collection\Collection; +use XPHP\Collections\Collection; /** * A read-only collection with a stable positional order and index access. diff --git a/src/Maps/Entry.xphp b/src/Maps/Entry.xphp index 71f1911..d7ef809 100644 --- a/src/Maps/Entry.xphp +++ b/src/Maps/Entry.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Maps; +namespace XPHP\Collections\Maps; /** * A read-only key/value pair — the element type of a {@see Map}. diff --git a/src/Maps/ImmutableMap.xphp b/src/Maps/ImmutableMap.xphp index 3da8594..48891b9 100644 --- a/src/Maps/ImmutableMap.xphp +++ b/src/Maps/ImmutableMap.xphp @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace XPHP\Collection\Maps; +namespace XPHP\Collections\Maps; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Lists\OrderedCollection; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Lists\OrderedCollection; use function array_key_exists; use function array_keys; diff --git a/src/Maps/Map.xphp b/src/Maps/Map.xphp index 8c3a702..cb25962 100644 --- a/src/Maps/Map.xphp +++ b/src/Maps/Map.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Maps; +namespace XPHP\Collections\Maps; -use XPHP\Collection\Lists\OrderedCollection; +use XPHP\Collections\Lists\OrderedCollection; /** * A read-only mapping from keys of type `K` to values of type `V`. diff --git a/src/Maps/Pair.xphp b/src/Maps/Pair.xphp index bce79f9..e646b11 100644 --- a/src/Maps/Pair.xphp +++ b/src/Maps/Pair.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Maps; +namespace XPHP\Collections\Maps; /** * The immutable concrete {@see Entry}. `readonly` enforces immutability; the key/value diff --git a/src/Sets/ImmutableSet.xphp b/src/Sets/ImmutableSet.xphp index 3dc0686..ab0d340 100644 --- a/src/Sets/ImmutableSet.xphp +++ b/src/Sets/ImmutableSet.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Sets; +namespace XPHP\Collections\Sets; -use XPHP\Collection\Support\AbstractImmutableCollection; +use XPHP\Collections\Support\AbstractImmutableCollection; use function array_filter; use function array_map; diff --git a/src/Sets/Set.xphp b/src/Sets/Set.xphp index baf6248..1003690 100644 --- a/src/Sets/Set.xphp +++ b/src/Sets/Set.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Sets; +namespace XPHP\Collections\Sets; -use XPHP\Collection\Collection; +use XPHP\Collections\Collection; /** * A read-only collection with no duplicate elements. Covariant in `E`. diff --git a/src/Support/AbstractImmutableCollection.xphp b/src/Support/AbstractImmutableCollection.xphp index bcb7f98..59a578f 100644 --- a/src/Support/AbstractImmutableCollection.xphp +++ b/src/Support/AbstractImmutableCollection.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Support; +namespace XPHP\Collections\Support; -use XPHP\Collection\Collection; +use XPHP\Collections\Collection; use ArrayIterator; use Traversable; diff --git a/src/Tuples/Couple.xphp b/src/Tuples/Couple.xphp index 7ba95f4..f079981 100644 --- a/src/Tuples/Couple.xphp +++ b/src/Tuples/Couple.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Tuples; +namespace XPHP\Collections\Tuples; /** * The immutable concrete {@see Tuple}. `readonly` enforces immutability; both slots are private so the diff --git a/src/Tuples/Tuple.xphp b/src/Tuples/Tuple.xphp index 6e4adbe..cf8dd5a 100644 --- a/src/Tuples/Tuple.xphp +++ b/src/Tuples/Tuple.xphp @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace XPHP\Collection\Tuples; +namespace XPHP\Collections\Tuples; /** * A fully covariant, positional 2-tuple — an ordered pair of read-only slots. * - * Distinct from {@see \XPHP\Collection\Maps\Entry} (the map entry, whose key `K` is invariant because a + * Distinct from {@see \XPHP\Collections\Maps\Entry} (the map entry, whose key `K` is invariant because a * `Map` consumes it in `get(K)`): a tuple is purely positional and read-only, so both slots are output-only * and the type is covariant in both (`out A`, `out B`) — Kotlin's `Pair`. Returned by positional - * operations such as {@see \XPHP\Collection\Lists\ImmutableList::partition()}. + * operations such as {@see \XPHP\Collections\Lists\ImmutableList::partition()}. */ interface Tuple { diff --git a/tests/ComparatorTest.xphp b/tests/ComparatorTest.xphp index 799face..4eb0e2f 100644 --- a/tests/ComparatorTest.xphp +++ b/tests/ComparatorTest.xphp @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests; +namespace XPHP\Collections\Tests; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Comparator; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\ByName; +use XPHP\Collections\Comparator; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\ByName; final class ComparatorTest extends TestCase { diff --git a/tests/Fixtures/Book.xphp b/tests/Fixtures/Book.xphp index 4d45621..dbe3f5b 100644 --- a/tests/Fixtures/Book.xphp +++ b/tests/Fixtures/Book.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Fixtures; +namespace XPHP\Collections\Tests\Fixtures; /** * Test fixture: a subtype of {@see Product}. Used as the single element type across the diff --git a/tests/Fixtures/ByName.xphp b/tests/Fixtures/ByName.xphp index 0a7a571..bfae209 100644 --- a/tests/Fixtures/ByName.xphp +++ b/tests/Fixtures/ByName.xphp @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Fixtures; +namespace XPHP\Collections\Tests\Fixtures; -use XPHP\Collection\Comparator; +use XPHP\Collections\Comparator; /** * Test fixture: a {@see Comparator} over the supertype {@see Product}, used to exercise diff --git a/tests/Fixtures/Product.xphp b/tests/Fixtures/Product.xphp index fd7c0e3..acedb32 100644 --- a/tests/Fixtures/Product.xphp +++ b/tests/Fixtures/Product.xphp @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Fixtures; +namespace XPHP\Collections\Tests\Fixtures; /** * Test fixture: a supertype used to exercise covariance. Declared in `.xphp` so the diff --git a/tests/Lists/ImmutableGroupingTest.xphp b/tests/Lists/ImmutableGroupingTest.xphp index b37c510..f80866d 100644 --- a/tests/Lists/ImmutableGroupingTest.xphp +++ b/tests/Lists/ImmutableGroupingTest.xphp @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Lists; +namespace XPHP\Collections\Tests\Lists; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Lists\ImmutableGrouping; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Maps\Map; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Lists\ImmutableGrouping; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Maps\Map; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class ImmutableGroupingTest extends TestCase { diff --git a/tests/Lists/ImmutableListTest.xphp b/tests/Lists/ImmutableListTest.xphp index 64ed3ba..ae878cd 100644 --- a/tests/Lists/ImmutableListTest.xphp +++ b/tests/Lists/ImmutableListTest.xphp @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Lists; +namespace XPHP\Collections\Tests\Lists; use OutOfRangeException; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Collection; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Lists\OrderedCollection; -use XPHP\Collection\Tuples\Tuple; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\ByName; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Collection; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Lists\OrderedCollection; +use XPHP\Collections\Tuples\Tuple; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\ByName; +use XPHP\Collections\Tests\Fixtures\Product; use function array_map; use function iterator_to_array; diff --git a/tests/Lists/ImmutableReducingTest.xphp b/tests/Lists/ImmutableReducingTest.xphp index e14196e..800473f 100644 --- a/tests/Lists/ImmutableReducingTest.xphp +++ b/tests/Lists/ImmutableReducingTest.xphp @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Lists; +namespace XPHP\Collections\Tests\Lists; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Lists\ImmutableReducing; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Lists\ImmutableReducing; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class ImmutableReducingTest extends TestCase { diff --git a/tests/Lists/ImmutableZippingTest.xphp b/tests/Lists/ImmutableZippingTest.xphp index c97c0c0..aa73e82 100644 --- a/tests/Lists/ImmutableZippingTest.xphp +++ b/tests/Lists/ImmutableZippingTest.xphp @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Lists; +namespace XPHP\Collections\Tests\Lists; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Lists\ImmutableList; -use XPHP\Collection\Lists\ImmutableZipping; -use XPHP\Collection\Lists\OrderedCollection; -use XPHP\Collection\Tuples\Tuple; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Lists\ImmutableList; +use XPHP\Collections\Lists\ImmutableZipping; +use XPHP\Collections\Lists\OrderedCollection; +use XPHP\Collections\Tuples\Tuple; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class ImmutableZippingTest extends TestCase { diff --git a/tests/Maps/ImmutableMapTest.xphp b/tests/Maps/ImmutableMapTest.xphp index 8de85c9..dd3fdc6 100644 --- a/tests/Maps/ImmutableMapTest.xphp +++ b/tests/Maps/ImmutableMapTest.xphp @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Maps; +namespace XPHP\Collections\Tests\Maps; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Maps\Entry; -use XPHP\Collection\Maps\ImmutableMap; -use XPHP\Collection\Maps\Map; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Maps\Entry; +use XPHP\Collections\Maps\ImmutableMap; +use XPHP\Collections\Maps\Map; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; use function array_map; diff --git a/tests/Maps/PairTest.xphp b/tests/Maps/PairTest.xphp index 7172e9b..fe3c67b 100644 --- a/tests/Maps/PairTest.xphp +++ b/tests/Maps/PairTest.xphp @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Maps; +namespace XPHP\Collections\Tests\Maps; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Maps\Entry; -use XPHP\Collection\Maps\Pair; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Maps\Entry; +use XPHP\Collections\Maps\Pair; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class PairTest extends TestCase { diff --git a/tests/Sets/ImmutableSetTest.xphp b/tests/Sets/ImmutableSetTest.xphp index b890ac7..5fef2ed 100644 --- a/tests/Sets/ImmutableSetTest.xphp +++ b/tests/Sets/ImmutableSetTest.xphp @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Sets; +namespace XPHP\Collections\Tests\Sets; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Collection; -use XPHP\Collection\Sets\ImmutableSet; -use XPHP\Collection\Sets\Set; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Collection; +use XPHP\Collections\Sets\ImmutableSet; +use XPHP\Collections\Sets\Set; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class ImmutableSetTest extends TestCase { diff --git a/tests/Tuples/CoupleTest.xphp b/tests/Tuples/CoupleTest.xphp index fb83eb0..fde0b63 100644 --- a/tests/Tuples/CoupleTest.xphp +++ b/tests/Tuples/CoupleTest.xphp @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace XPHP\Collection\Tests\Tuples; +namespace XPHP\Collections\Tests\Tuples; use PHPUnit\Framework\TestCase; -use XPHP\Collection\Tuples\Couple; -use XPHP\Collection\Tuples\Tuple; -use XPHP\Collection\Tests\Fixtures\Book; -use XPHP\Collection\Tests\Fixtures\Product; +use XPHP\Collections\Tuples\Couple; +use XPHP\Collections\Tuples\Tuple; +use XPHP\Collections\Tests\Fixtures\Book; +use XPHP\Collections\Tests\Fixtures\Product; final class CoupleTest extends TestCase { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6649700..178ed6d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,7 +6,7 @@ * PHPUnit / Infection bootstrap. * * The library + tests are compiled (via `xphp compile --config xphp.tests.json`) into - * build/ + cache/, which Composer's PSR-4 autoloader already maps (XPHP\Collection\ -> + * build/ + cache/, which Composer's PSR-4 autoloader already maps (XPHP\Collections\ -> * build/, XPHP\Generated\ -> cache/Generated/). So the standard autoloader resolves the * compiled test classes and the monomorphized specializations with no extra setup. */