From 6edfc34caa2c2a14447a5e250c4724a677c41083 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 14 Apr 2026 10:02:20 +0200 Subject: update to 2.0.0 rename to php-pecl-ds2 run standard php test suite from extension sources instead of separate tests using phpunit drop ZTS build --- PHPINFO | 2 +- REFLECTION | 1320 ++++++++---------------------------------------------- composer.json | 2 +- php-pecl-ds.spec | 136 ++---- 4 files changed, 233 insertions(+), 1227 deletions(-) diff --git a/PHPINFO b/PHPINFO index 92c25c8..4deb055 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,4 +2,4 @@ ds ds support => enabled -ds version => 1.8.0 +ds version => 2.0.0 diff --git a/REFLECTION b/REFLECTION index 755545e..c37096c 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,43 +1,40 @@ -Extension [ extension #154 ds version 1.8.0 ] { +Extension [ extension #154 ds version 2.0.0 ] { - Dependencies { Dependency [ json (Required) ] Dependency [ spl (Required) ] } - - Classes [11] { - Interface [ interface Ds\Hashable ] { + - Functions { + Function [ function Ds\seq ] { - - Constants [0] { - } - - - Static properties [0] { + - Parameters [1] { + Parameter #0 [ $values = ] } + } + Function [ function Ds\map ] { - - Static methods [0] { + - Parameters [1] { + Parameter #0 [ $values = ] } + } + Function [ function Ds\set ] { - - Properties [0] { + - Parameters [1] { + Parameter #0 [ $values = ] } + } + Function [ function Ds\heap ] { - - Methods [2] { - Method [ abstract public method hash ] { - - - Parameters [0] { - } - } - - Method [ abstract public method equals ] { - - - Parameters [1] { - Parameter #0 [ $obj ] - } - - Return [ bool ] - } + - Parameters [2] { + Parameter #0 [ $values = ] + Parameter #1 [ ?callable $comparator = ] } } + } - Interface [ interface Ds\Collection extends IteratorAggregate, Traversable, Countable, JsonSerializable ] { + - Classes [6] { + Interface [ interface Ds\Key ] { - Constants [0] { } @@ -51,58 +48,24 @@ Extension [ extension #154 ds version 1.8.0 ] { - Properties [0] { } - - Methods [7] { - Method [ abstract public method clear ] { - - - Parameters [0] { - } - } - - Method [ abstract public method copy ] { + - Methods [2] { + Method [ abstract public method hash ] { - Parameters [0] { } - - Return [ Ds\Collection ] } - Method [ abstract public method isEmpty ] { + Method [ abstract public method equals ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $other ] } - Return [ bool ] } - - Method [ abstract public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ abstract public method getIterator ] { - - - Parameters [0] { - } - - Tentative return [ Traversable ] - } - - Method [ abstract public method count ] { - - - Parameters [0] { - } - - Tentative return [ int ] - } - - Method [ abstract public method jsonSerialize ] { - - - Parameters [0] { - } - - Tentative return [ mixed ] - } } } - Interface [ interface Ds\Sequence extends Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate, ArrayAccess ] { + Class [ final readonly class Ds\Pair implements JsonSerializable ] { - Constants [0] { } @@ -113,260 +76,51 @@ Extension [ extension #154 ds version 1.8.0 ] { - Static methods [0] { } - - Properties [0] { + - Properties [2] { + Property [ public protected(set) readonly mixed $key ] + Property [ public protected(set) readonly mixed $value ] } - - Methods [34] { - Method [ abstract public method allocate ] { - - - Parameters [1] { - Parameter #0 [ int $capacity ] - } - } - - Method [ abstract public method capacity ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ abstract public method contains ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - - Return [ bool ] - } - - Method [ abstract public method filter ] { - - - Parameters [1] { - Parameter #0 [ ?callable $callback = ] - } - - Return [ Ds\Sequence ] - } - - Method [ abstract public method find ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - } - - Method [ abstract public method first ] { - - - Parameters [0] { - } - } - - Method [ abstract public method get ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ abstract public method insert ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ...$values ] - } - } - - Method [ abstract public method join ] { - - - Parameters [1] { - Parameter #0 [ string $glue = ] - } - - Return [ string ] - } - - Method [ abstract public method last ] { - - - Parameters [0] { - } - } - - Method [ abstract public method map ] { - - - Parameters [1] { - Parameter #0 [ callable $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ abstract public method merge ] { - - - Parameters [1] { - Parameter #0 [ $values ] - } - - Return [ Ds\Sequence ] - } - - Method [ abstract public method pop ] { - - - Parameters [0] { - } - } - - Method [ abstract public method push ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ abstract public method reduce ] { - - - Parameters [2] { - Parameter #0 [ callable $callback ] - Parameter #1 [ $initial = ] - } - } - - Method [ abstract public method remove ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ abstract public method reverse ] { - - - Parameters [0] { - } - } - - Method [ abstract public method rotate ] { - - - Parameters [1] { - Parameter #0 [ int $rotations ] - } - } - - Method [ abstract public method set ] { + - Methods [5] { + Method [ public method __construct ] { - Parameters [2] { - Parameter #0 [ int $index ] + Parameter #0 [ $key ] Parameter #1 [ $value ] } } - Method [ abstract public method shift ] { - - - Parameters [0] { - } - } - - Method [ abstract public method slice ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ?int $length = ] - } - - Return [ Ds\Sequence ] - } - - Method [ abstract public method sort ] { - - - Parameters [1] { - Parameter #0 [ ?callable $comparator = ] - } - } - - Method [ abstract public method unshift ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ abstract public method clear ] { - - - Parameters [0] { - } - } - - Method [ abstract public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ abstract public method isEmpty ] { + Method [ public method jsonSerialize ] { - Parameters [0] { } - - Return [ bool ] + - Tentative return [ mixed ] } - Method [ abstract public method toArray ] { + Method [ public method toArray ] { - Parameters [0] { } - Return [ array ] } - Method [ abstract public method getIterator ] { - - - Parameters [0] { - } - - Tentative return [ Traversable ] - } - - Method [ abstract public method count ] { - - - Parameters [0] { - } - - Tentative return [ int ] - } - - Method [ abstract public method jsonSerialize ] { + Method [ public method __serialize ] { - Parameters [0] { } - - Tentative return [ mixed ] - } - - Method [ abstract public method offsetExists ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ bool ] - } - - Method [ abstract public method offsetGet ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ mixed ] - } - - Method [ abstract public method offsetSet ] { - - - Parameters [2] { - Parameter #0 [ mixed $offset ] - Parameter #1 [ mixed $value ] - } - - Tentative return [ void ] + - Return [ array ] } - Method [ abstract public method offsetUnset ] { + Method [ public method __unserialize ] { - Parameters [1] { - Parameter #0 [ mixed $offset ] + Parameter #0 [ $data ] } - - Tentative return [ void ] } } } - Class [ final class Ds\Vector implements Ds\Sequence, ArrayAccess, IteratorAggregate, Traversable, Countable, JsonSerializable, Ds\Collection ] { + Class [ final class Ds\Seq implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { Constant [ public int MIN_CAPACITY ] { 8 } @@ -375,731 +129,37 @@ Extension [ extension #154 ds version 1.8.0 ] { - Static properties [0] { } - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [41] { - Method [ public method __construct ] { - - - Parameters [1] { - Parameter #0 [ $values = ] - } - } - - Method [ public method getIterator ] { - - - Parameters [0] { - } - - Return [ Traversable ] - } - - Method [ public method allocate ] { - - - Parameters [1] { - Parameter #0 [ int $capacity ] - } - } - - Method [ public method apply ] { - - - Parameters [1] { - Parameter #0 [ callable $callback ] - } - } - - Method [ public method capacity ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ public method contains ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - - Return [ bool ] - } - - Method [ public method filter ] { - - - Parameters [1] { - Parameter #0 [ ?callable $callback = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method find ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - } - - Method [ public method first ] { - - - Parameters [0] { - } - } - - Method [ public method get ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ public method insert ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ...$values ] - } - } - - Method [ public method join ] { - - - Parameters [1] { - Parameter #0 [ string $glue = ] - } - - Return [ string ] - } - - Method [ public method last ] { - - - Parameters [0] { - } - } - - Method [ public method map ] { - - - Parameters [1] { - Parameter #0 [ callable $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method merge ] { - - - Parameters [1] { - Parameter #0 [ $values ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method offsetExists ] { - - - Parameters [1] { - Parameter #0 [ $offset ] - } - - Return [ bool ] - } - - Method [ public method offsetGet ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ mixed ] - } - - Method [ public method offsetSet ] { - - - Parameters [2] { - Parameter #0 [ mixed $offset ] - Parameter #1 [ mixed $value ] - } - - Tentative return [ void ] - } - - Method [ public method offsetUnset ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ void ] - } - - Method [ public method pop ] { - - - Parameters [0] { - } - } - - Method [ public method push ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ public method reduce ] { - - - Parameters [2] { - Parameter #0 [ callable $callback ] - Parameter #1 [ $initial = ] - } - } - - Method [ public method remove ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ public method reverse ] { - - - Parameters [0] { - } - } - - Method [ public method reversed ] { - - - Parameters [0] { - } - - Return [ Ds\Sequence ] - } - - Method [ public method rotate ] { - - - Parameters [1] { - Parameter #0 [ int $rotations ] - } - } - - Method [ public method set ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ $value ] - } - } - - Method [ public method shift ] { - - - Parameters [0] { - } - } - - Method [ public method slice ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ?int $length = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method sort ] { - - - Parameters [1] { - Parameter #0 [ ?callable $comparator = ] - } - } - - Method [ public method sorted ] { - - - Parameters [1] { - Parameter #0 [ ?callable $comparator = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method sum ] { - - - Parameters [0] { - } - } - - Method [ public method unshift ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ public method clear ] { - - - Parameters [0] { - } - } - - Method [ public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ public method count ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ public method isEmpty ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method jsonSerialize ] { - - - Parameters [0] { - } - - Tentative return [ mixed ] - } - - Method [ public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __serialize ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __unserialize ] { - - - Parameters [1] { - Parameter #0 [ $data ] - } - } - } - } - - Class [ final class Ds\Deque implements Ds\Sequence, ArrayAccess, IteratorAggregate, Traversable, Countable, JsonSerializable, Ds\Collection ] { - - - Constants [1] { - Constant [ public int MIN_CAPACITY ] { 8 } - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [41] { - Method [ public method __construct ] { - - - Parameters [1] { - Parameter #0 [ $values = ] - } - } - - Method [ public method getIterator ] { - - - Parameters [0] { - } - - Return [ Traversable ] - } - - Method [ public method clear ] { - - - Parameters [0] { - } - } - - Method [ public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ public method count ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ public method isEmpty ] { - - - Parameters [0] { - } - - Return [ bool ] - } - - Method [ public method jsonSerialize ] { - - - Parameters [0] { - } - - Tentative return [ mixed ] - } - - Method [ public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __serialize ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __unserialize ] { - - - Parameters [1] { - Parameter #0 [ $data ] - } - } - - Method [ public method allocate ] { - - - Parameters [1] { - Parameter #0 [ int $capacity ] - } - } - - Method [ public method apply ] { - - - Parameters [1] { - Parameter #0 [ callable $callback ] - } - } - - Method [ public method capacity ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ public method contains ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - - Return [ bool ] - } - - Method [ public method filter ] { - - - Parameters [1] { - Parameter #0 [ ?callable $callback = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method find ] { - - - Parameters [1] { - Parameter #0 [ $value ] - } - } - - Method [ public method first ] { - - - Parameters [0] { - } - } - - Method [ public method get ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ public method insert ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ...$values ] - } - } - - Method [ public method join ] { - - - Parameters [1] { - Parameter #0 [ string $glue = ] - } - - Return [ string ] - } - - Method [ public method last ] { - - - Parameters [0] { - } - } - - Method [ public method map ] { - - - Parameters [1] { - Parameter #0 [ callable $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method merge ] { - - - Parameters [1] { - Parameter #0 [ $values ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method offsetExists ] { - - - Parameters [1] { - Parameter #0 [ $offset ] - } - - Return [ bool ] - } - - Method [ public method offsetGet ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ mixed ] - } - - Method [ public method offsetSet ] { - - - Parameters [2] { - Parameter #0 [ mixed $offset ] - Parameter #1 [ mixed $value ] - } - - Tentative return [ void ] - } - - Method [ public method offsetUnset ] { - - - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ void ] - } - - Method [ public method pop ] { - - - Parameters [0] { - } - } - - Method [ public method push ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ public method reduce ] { - - - Parameters [2] { - Parameter #0 [ callable $callback ] - Parameter #1 [ $initial = ] - } - } - - Method [ public method remove ] { - - - Parameters [1] { - Parameter #0 [ int $index ] - } - } - - Method [ public method reverse ] { - - - Parameters [0] { - } - } - - Method [ public method reversed ] { - - - Parameters [0] { - } - - Return [ Ds\Sequence ] - } - - Method [ public method rotate ] { - - - Parameters [1] { - Parameter #0 [ int $rotations ] - } - } - - Method [ public method set ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ $value ] - } - } - - Method [ public method shift ] { - - - Parameters [0] { - } - } - - Method [ public method slice ] { - - - Parameters [2] { - Parameter #0 [ int $index ] - Parameter #1 [ ?int $length = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method sort ] { - - - Parameters [1] { - Parameter #0 [ ?callable $comparator = ] - } - } - - Method [ public method sorted ] { - - - Parameters [1] { - Parameter #0 [ ?callable $comparator = ] - } - - Return [ Ds\Sequence ] - } - - Method [ public method sum ] { - - - Parameters [0] { - } - } - - Method [ public method unshift ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - } - } - - Class [ final class Ds\Stack implements Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate, ArrayAccess ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [19] { - Method [ public method __construct ] { - - - Parameters [1] { - Parameter #0 [ $values = ] - } - } - - Method [ public method allocate ] { - - - Parameters [1] { - Parameter #0 [ int $capacity ] - } - } - - Method [ public method capacity ] { - - - Parameters [0] { - } - - Return [ int ] - } - - Method [ public method peek ] { - - - Parameters [0] { - } - } - - Method [ public method pop ] { - - - Parameters [0] { - } - } - - Method [ public method push ] { - - - Parameters [1] { - Parameter #0 [ ...$values ] - } - } - - Method [ public method getIterator ] { - - - Parameters [0] { - } - - Return [ Traversable ] - } - - Method [ public method offsetExists ] { + - Static methods [0] { + } - - Parameters [1] { - Parameter #0 [ $offset ] - } - - Return [ bool ] - } + - Properties [0] { + } - Method [ public method offsetGet ] { + - Methods [41] { + Method [ public method __construct ] { - Parameters [1] { - Parameter #0 [ mixed $offset ] - } - - Tentative return [ mixed ] - } - - Method [ public method offsetSet ] { - - - Parameters [2] { - Parameter #0 [ mixed $offset ] - Parameter #1 [ mixed $value ] + Parameter #0 [ $values = ] } - - Tentative return [ void ] } - Method [ public method offsetUnset ] { + Method [ public method getIterator ] { - - Parameters [1] { - Parameter #0 [ mixed $offset ] + - Parameters [0] { } - - Tentative return [ void ] + - Return [ Traversable ] } - Method [ public method clear ] { + Method [ public method clear ] { - Parameters [0] { } } - Method [ public method copy ] { + Method [ public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ public method count ] { @@ -1109,7 +169,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ int ] } - Method [ public method isEmpty ] { + Method [ public method isEmpty ] { - Parameters [0] { } @@ -1123,7 +183,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ mixed ] } - Method [ public method toArray ] { + Method [ public method toArray ] { - Parameters [0] { } @@ -1143,70 +203,100 @@ Extension [ extension #154 ds version 1.8.0 ] { Parameter #0 [ $data ] } } - } - } - Class [ final class Ds\Queue implements Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate, ArrayAccess ] { + Method [ public method allocate ] { - - Constants [1] { - Constant [ public int MIN_CAPACITY ] { 8 } - } + - Parameters [1] { + Parameter #0 [ int $capacity ] + } + } - - Static properties [0] { - } + Method [ public method apply ] { - - Static methods [0] { - } + - Parameters [1] { + Parameter #0 [ callable $callback ] + } + } - - Properties [0] { - } + Method [ public method capacity ] { - - Methods [19] { - Method [ public method __construct ] { + - Parameters [0] { + } + - Return [ int ] + } + + Method [ public method contains ] { - Parameters [1] { - Parameter #0 [ $values = ] + Parameter #0 [ ...$values ] } + - Return [ bool ] } - Method [ public method allocate ] { + Method [ public method filter ] { - Parameters [1] { - Parameter #0 [ int $capacity ] + Parameter #0 [ ?callable $callback = ] } + - Return [ Ds\Sequence ] } - Method [ public method capacity ] { + Method [ public method find ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $value ] } - - Return [ int ] } - Method [ public method peek ] { + Method [ public method first ] { - Parameters [0] { } } - Method [ public method pop ] { + Method [ public method get ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ int $index ] } } - Method [ public method push ] { + Method [ public method insert ] { + + - Parameters [2] { + Parameter #0 [ int $index ] + Parameter #1 [ ...$values ] + } + } + + Method [ public method join ] { - Parameters [1] { - Parameter #0 [ ...$values ] + Parameter #0 [ string $glue = ] } + - Return [ string ] } - Method [ public method getIterator ] { + Method [ public method last ] { - Parameters [0] { } - - Return [ Traversable ] + } + + Method [ public method map ] { + + - Parameters [1] { + Parameter #0 [ callable $callback ] + } + - Return [ Ds\Sequence ] + } + + Method [ public method merge ] { + + - Parameters [1] { + Parameter #0 [ $values ] + } + - Return [ Ds\Sequence ] } Method [ public method offsetExists ] { @@ -1242,64 +332,108 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ void ] } - Method [ public method clear ] { + Method [ public method pop ] { - Parameters [0] { } } - Method [ public method copy ] { + Method [ public method push ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ ...$values ] } - - Return [ Ds\Collection ] } - Method [ public method count ] { + Method [ public method reduce ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ callable $callback ] + Parameter #1 [ $initial = ] + } + } + + Method [ public method remove ] { + + - Parameters [1] { + Parameter #0 [ int $index ] } - - Return [ int ] } - Method [ public method isEmpty ] { + Method [ public method reverse ] { - Parameters [0] { } - - Return [ bool ] } - Method [ public method jsonSerialize ] { + Method [ public method reversed ] { - Parameters [0] { } - - Tentative return [ mixed ] + - Return [ Ds\Sequence ] + } + + Method [ public method rotate ] { + + - Parameters [1] { + Parameter #0 [ int $rotations ] + } + } + + Method [ public method set ] { + + - Parameters [2] { + Parameter #0 [ int $index ] + Parameter #1 [ $value ] + } } - Method [ public method toArray ] { + Method [ public method shift ] { - Parameters [0] { } - - Return [ array ] } - Method [ public method __serialize ] { + Method [ public method slice ] { + + - Parameters [2] { + Parameter #0 [ int $index ] + Parameter #1 [ ?int $length = ] + } + - Return [ Ds\Sequence ] + } + + Method [ public method sort ] { + + - Parameters [1] { + Parameter #0 [ ?callable $comparator = ] + } + } + + Method [ public method sorted ] { + + - Parameters [1] { + Parameter #0 [ ?callable $comparator = ] + } + - Return [ Ds\Sequence ] + } + + Method [ public method sum ] { - Parameters [0] { } - - Return [ array ] } - Method [ public method __unserialize ] { + Method [ public method unshift ] { - Parameters [1] { - Parameter #0 [ $data ] + Parameter #0 [ ...$values ] } } } } - Class [ final class Ds\Map implements Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate, ArrayAccess ] { + Class [ final class Ds\Map implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { Constant [ public int MIN_CAPACITY ] { 8 } @@ -1595,17 +729,16 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ void ] } - Method [ public method clear ] { + Method [ public method clear ] { - Parameters [0] { } } - Method [ public method copy ] { + Method [ public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ public method count ] { @@ -1615,7 +748,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ int ] } - Method [ public method isEmpty ] { + Method [ public method isEmpty ] { - Parameters [0] { } @@ -1629,7 +762,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ mixed ] } - Method [ public method toArray ] { + Method [ public method toArray ] { - Parameters [0] { } @@ -1652,7 +785,7 @@ Extension [ extension #154 ds version 1.8.0 ] { } } - Class [ final class Ds\Set implements Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate, ArrayAccess ] { + Class [ final class Ds\Set implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { Constant [ public int MIN_CAPACITY ] { 8 } @@ -1884,17 +1017,16 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ void ] } - Method [ public method clear ] { + Method [ public method clear ] { - Parameters [0] { } } - Method [ public method copy ] { + Method [ public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ public method count ] { @@ -1904,7 +1036,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ int ] } - Method [ public method isEmpty ] { + Method [ public method isEmpty ] { - Parameters [0] { } @@ -1918,7 +1050,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ mixed ] } - Method [ public method toArray ] { + Method [ public method toArray ] { - Parameters [0] { } @@ -1941,7 +1073,7 @@ Extension [ extension #154 ds version 1.8.0 ] { } } - Class [ final class Ds\PriorityQueue implements Ds\Collection, JsonSerializable, Countable, Traversable, IteratorAggregate ] { + Class [ final class Ds\Heap implements IteratorAggregate, Traversable, Countable, JsonSerializable ] { - Constants [1] { Constant [ public int MIN_CAPACITY ] { 8 } @@ -1959,7 +1091,9 @@ Extension [ extension #154 ds version 1.8.0 ] { - Methods [15] { Method [ public method __construct ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ $values = ] + Parameter #1 [ ?callable $comparator = ] } } @@ -1977,9 +1111,10 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ int ] } - Method [ public method peek ] { + Method [ public method push ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ ...$values ] } } @@ -1989,11 +1124,9 @@ Extension [ extension #154 ds version 1.8.0 ] { } } - Method [ public method push ] { + Method [ public method peek ] { - - Parameters [2] { - Parameter #0 [ $value ] - Parameter #1 [ $priority ] + - Parameters [0] { } } @@ -2004,17 +1137,16 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ Traversable ] } - Method [ public method clear ] { + Method [ public method clear ] { - Parameters [0] { } } - Method [ public method copy ] { + Method [ public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ public method count ] { @@ -2024,7 +1156,7 @@ Extension [ extension #154 ds version 1.8.0 ] { - Return [ int ] } - Method [ public method isEmpty ] { + Method [ public method isEmpty ] { - Parameters [0] { } @@ -2038,68 +1170,6 @@ Extension [ extension #154 ds version 1.8.0 ] { - Tentative return [ mixed ] } - Method [ public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __serialize ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ public method __unserialize ] { - - - Parameters [1] { - Parameter #0 [ $data ] - } - } - } - } - - Class [ final class Ds\Pair implements JsonSerializable ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [2] { - Property [ public $key = NULL ] - Property [ public $value = NULL ] - } - - - Methods [6] { - Method [ public method __construct ] { - - - Parameters [2] { - Parameter #0 [ $key = ] - Parameter #1 [ $value = ] - } - } - - Method [ public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Pair ] - } - - Method [ public method jsonSerialize ] { - - - Parameters [0] { - } - - Tentative return [ mixed ] - } - Method [ public method toArray ] { - Parameters [0] { diff --git a/composer.json b/composer.json index 144b45c..0733777 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": ">= 8.2.0" }, "require-dev": { - "php-ds/tests": "^1.8" + "php-ds/tests": "^2.0" }, "scripts": { "test" : "php test.php", diff --git a/php-pecl-ds.spec b/php-pecl-ds.spec index af4f4b1..7fb76e5 100644 --- a/php-pecl-ds.spec +++ b/php-pecl-ds.spec @@ -1,4 +1,4 @@ -# remirepo spec file for php-pecl-ds +# remirepo spec file for php-pecl-ds2 # # SPDX-FileCopyrightText: Copyright 2016-2026 Remi Collet # SPDX-License-Identifier: CECILL-2.1 @@ -7,69 +7,49 @@ # Please, preserve the changelog entries # -%if 0%{?scl:1} -%scl_package php-pecl-ds -# No phpunit in SCL -%bcond_with tests -%else +%{?scl:%scl_package php-pecl-ds2} + %bcond_without tests -%endif -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name ds %global pie_vend php-ds %global pie_proj ext-ds -# After json %global ini_name 40-%{pecl_name}.ini -%global sources %{gh_proj}-%{version} -%global _configure ../%{sources}/configure - +%global _configure ../configure # Github forge -%global gh_vend php-ds -%global gh_proj ext-ds -%global forgeurl0 https://github.com/%{gh_vend}/%{gh_proj} -%global tag0 v%{version} +%global gh_vend %{pie_vend} +%global gh_proj %{pie_proj} +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag v%{version} # for EL-8 to avoid TAG usage -%global archivename0 %{gh_proj}-%{version} - -# For test suite, see https://github.com/php-ds/tests/tags -%global forgeurl1 https://github.com/%{gh_vend}/tests -%global tag1 v1.8.0 -%global archivename1 tests-1.8.0 +%global archivename %{gh_proj}-%{version} Summary: Data Structures for PHP -Name: %{?scl_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name}2 License: MIT -Version: 1.8.0 +Version: 2.0.0 Release: 1%{?dist} -%if 0%{?rhel} == 8 -URL: %{forgeurl0} -Source0: %{forgeurl0}/archive/v%{tag0}/%{archivename0}.tar.gz -Source1: %{forgeurl1}/archive/v%{tag1}/%{archivename1}.tar.gz -%else -%forgemeta -a +%forgemeta URL: %{forgeurl} -Source0: %{forgesource0} -Source1: %{forgesource1} -%endif +Source0: %{forgesource} BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 8.2 -BuildRequires: %{?scl_prefix}php-gmp -BuildRequires: %{?scl_prefix}php-json -%if %{with tests} -BuildRequires: %{_bindir}/phpunit11 -BuildRequires: %{_bindir}/phpab -%endif -#BuildRequires: php-debuginfo -#BuildRequires: gdb Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -Requires: %{?scl_prefix}php-json%{?_isa} + +%if 0%{?fedora} >= 45 || 0%{?rhel} >= 11 || "%{php_version}" > "8.6" +Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 2 +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +%else +# A single version can be installed +Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 2 +%endif # Extension Provides: %{?scl_prefix}php-%{pecl_name} = %{version} @@ -90,22 +70,16 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep -%setup -q -c -a 1 -mv %{archivename1} tests +%forgesetup -cd %{sources} # Sanity check, really often broken extver=$(sed -n '/#define PHP_DS_VERSION/{s/.* "//;s/".*$//;p}' php_ds.h) if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}. exit 1 fi -cd .. mkdir NTS -%if %{with_zts} -mkdir ZTS -%endif # Create configuration file cat << 'EOF' | tee %{ini_name} @@ -125,18 +99,12 @@ peclbuild() { %make_build } -cd %{sources} %{__phpize} sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global -cd ../NTS +cd NTS peclbuild %{__phpconfig} -%if %{with_zts} -cd ../ZTS -peclbuild %{__ztsphpconfig} -%endif - %install %{?dtsenable} @@ -146,68 +114,36 @@ peclbuild %{__ztsphpconfig} # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} -%if %{with_zts} -%make_install -C ZTS - -install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} -%endif - %check -[ -f %{php_extdir}/json.so ] && modules="-d extension=json.so" - : Minimal load test for NTS extension %{__php} --no-php-ini \ - $modules \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' -%if %{with_zts} -: Minimal load test for ZTS extension -%{__ztsphp} --no-php-ini \ - $modules \ - --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep '^%{pecl_name}$' -%endif - %if %{with tests} -# This file is not a test file -mv tests/tests/CollectionTest.php tests/tests/Collection.php - -: Generate autoloader for tests -%{_bindir}/phpab \ - --output tests/autoload.php \ - tests - -: Run upstream test suite -%{_bindir}/php \ - -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - %{_bindir}/phpunit11 \ - --do-not-cache-result \ - --bootstrap tests/autoload.php \ - tests +: Upstream test suite for NTS extension +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ +%{__php} -n run-tests.php -q --show-diff %{?_smp_mflags} %endif %files -%license %{sources}/LICENSE -%doc %{sources}/composer.json -%doc %{sources}/*.md +%license LICENSE +%doc composer.json +%doc *.md %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so -%if %{with_zts} -%config(noreplace) %{php_ztsinidir}/%{ini_name} -%{php_ztsextdir}/%{pecl_name}.so -%endif - %changelog -* Tue Apr 14 2026 Remi Collet - 1.8.0-1 -- update to 1.8.0 -- raise dependency on PHP 8.2 -- switch to phpunit11 +* Tue Apr 14 2026 Remi Collet - 2.0.0-1 +- update to 2.0.0 +- rename to php-pecl-ds2 +- run standard php test suite from extension sources + instead of separate tests using phpunit +- drop ZTS build * Fri Mar 13 2026 Remi Collet - 1.6.0-4 - drop pear/pecl dependency -- cgit