diff -Nru phpunit-type-3.2.0/ChangeLog.md phpunit-type-3.2.1/ChangeLog.md --- phpunit-type-3.2.0/ChangeLog.md 2022-09-12 14:47:03.000000000 +0000 +++ phpunit-type-3.2.1/ChangeLog.md 2023-02-03 06:13:03.000000000 +0000 @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [3.2.1] - 2023-02-03 + +### Fixed + +* [#28](https://github.com/sebastianbergmann/type/pull/28): Potential undefined offset warning/notice + ## [3.2.0] - 2022-09-12 ### Added @@ -38,6 +44,8 @@ ## [2.3.4] - 2021-06-15 +### Fixed + * Fixed regression introduced in 2.3.3 ## [2.3.3] - 2021-06-15 [YANKED] @@ -139,6 +147,7 @@ * Initial release based on [code contributed by Michel Hartmann to PHPUnit](https://github.com/sebastianbergmann/phpunit/pull/3673) +[3.2.1]: https://github.com/sebastianbergmann/type/compare/3.2.0...3.2.1 [3.2.0]: https://github.com/sebastianbergmann/type/compare/3.1.0...3.2.0 [3.1.0]: https://github.com/sebastianbergmann/type/compare/3.0.0...3.1.0 [3.0.0]: https://github.com/sebastianbergmann/type/compare/2.3.4...3.0.0 diff -Nru phpunit-type-3.2.0/debian/changelog phpunit-type-3.2.1/debian/changelog --- phpunit-type-3.2.0/debian/changelog 2022-09-15 10:13:16.000000000 +0000 +++ phpunit-type-3.2.1/debian/changelog 2023-02-03 15:02:25.000000000 +0000 @@ -1,3 +1,14 @@ +phpunit-type (3.2.1-1) unstable; urgency=medium + + [ Sebastian Bergmann ] + * Prepare release + + [ David Prévot ] + * Track version 3 for now (Bookworm?) + * Update standards version to 4.6.2, no changes needed. + + -- David Prévot Fri, 03 Feb 2023 16:02:25 +0100 + phpunit-type (3.2.0-1) unstable; urgency=medium [ Sebastian Bergmann ] diff -Nru phpunit-type-3.2.0/debian/control phpunit-type-3.2.1/debian/control --- phpunit-type-3.2.0/debian/control 2022-08-30 07:45:47.000000000 +0000 +++ phpunit-type-3.2.1/debian/control 2023-02-03 15:01:56.000000000 +0000 @@ -9,7 +9,7 @@ phpab, phpunit, pkg-php-tools (>= 1.41~) -Standards-Version: 4.6.1 +Standards-Version: 4.6.2 Homepage: https://github.com/sebastianbergmann/type Vcs-Git: https://salsa.debian.org/php-team/pear/phpunit-type.git -b debian/latest Vcs-Browser: https://salsa.debian.org/php-team/pear/phpunit-type diff -Nru phpunit-type-3.2.0/debian/watch phpunit-type-3.2.1/debian/watch --- phpunit-type-3.2.0/debian/watch 2021-04-15 15:13:23.000000000 +0000 +++ phpunit-type-3.2.1/debian/watch 2023-02-03 14:59:06.000000000 +0000 @@ -2,4 +2,4 @@ options=uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/,\ mode=git,gitmode=full,gitexport=all,pgpmode=gittag \ https://github.com/sebastianbergmann/type \ -refs/tags/v?(\d.+) +refs/tags/v?(3.+) diff -Nru phpunit-type-3.2.0/.github/workflows/ci.yml phpunit-type-3.2.1/.github/workflows/ci.yml --- phpunit-type-3.2.0/.github/workflows/ci.yml 2022-09-12 14:47:03.000000000 +0000 +++ phpunit-type-3.2.1/.github/workflows/ci.yml 2023-02-03 06:13:03.000000000 +0000 @@ -6,6 +6,9 @@ name: "CI" +env: + COMPOSER_ROOT_VERSION: "3.2-dev" + permissions: contents: read diff -Nru phpunit-type-3.2.0/.phive/phars.xml phpunit-type-3.2.1/.phive/phars.xml --- phpunit-type-3.2.0/.phive/phars.xml 2022-09-12 14:47:03.000000000 +0000 +++ phpunit-type-3.2.1/.phive/phars.xml 2023-02-03 06:13:03.000000000 +0000 @@ -2,6 +2,6 @@ - - + + diff -Nru phpunit-type-3.2.0/src/type/CallableType.php phpunit-type-3.2.1/src/type/CallableType.php --- phpunit-type-3.2.0/src/type/CallableType.php 2022-09-12 14:47:03.000000000 +0000 +++ phpunit-type-3.2.1/src/type/CallableType.php 2023-02-03 06:13:03.000000000 +0000 @@ -143,6 +143,10 @@ return false; } + if (!isset($type->value()[0], $type->value()[1])) { + return false; + } + if (!is_object($type->value()[0]) || !is_string($type->value()[1])) { return false; } @@ -171,6 +175,10 @@ return false; } + if (!isset($type->value()[0], $type->value()[1])) { + return false; + } + if (!is_string($type->value()[0]) || !is_string($type->value()[1])) { return false; } diff -Nru phpunit-type-3.2.0/src/type/IntersectionType.php phpunit-type-3.2.1/src/type/IntersectionType.php --- phpunit-type-3.2.0/src/type/IntersectionType.php 2022-09-12 14:47:03.000000000 +0000 +++ phpunit-type-3.2.1/src/type/IntersectionType.php 2023-02-03 06:13:03.000000000 +0000 @@ -9,10 +9,10 @@ */ namespace SebastianBergmann\Type; -use function array_unique; use function assert; use function count; use function implode; +use function in_array; use function sort; final class IntersectionType extends Type @@ -114,13 +114,13 @@ foreach ($types as $type) { assert($type instanceof ObjectType); - $names[] = $type->className()->qualifiedName(); - } + $classQualifiedName = $type->className()->qualifiedName(); - if (count(array_unique($names)) < count($names)) { - throw new RuntimeException( - 'An intersection type must not contain duplicate types' - ); + if (in_array($classQualifiedName, $names, true)) { + throw new RuntimeException('An intersection type must not contain duplicate types'); + } + + $names[] = $classQualifiedName; } } } Binary files /tmp/tmpm0_e_k2w/VOqFiAXVz9/phpunit-type-3.2.0/tools/composer and /tmp/tmpm0_e_k2w/JaBw1m4f7p/phpunit-type-3.2.1/tools/composer differ Binary files /tmp/tmpm0_e_k2w/VOqFiAXVz9/phpunit-type-3.2.0/tools/infection and /tmp/tmpm0_e_k2w/JaBw1m4f7p/phpunit-type-3.2.1/tools/infection differ