Skip to content

Commit

Permalink
WIP Move to the new annotations system for tests data files
Browse files Browse the repository at this point in the history
TODO:
 - Handle the other users of gatherAssertTypes()
  • Loading branch information
thg2k committed Jun 13, 2024
1 parent 6f69ff2 commit ee3556b
Show file tree
Hide file tree
Showing 180 changed files with 363 additions and 431 deletions.
612 changes: 181 additions & 431 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/allowed-subtypes-enum.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80100

namespace AllowedSubtypesEnum;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/already-defined-constant.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif ignore

namespace AlreadyDefinedConstant;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-chunk-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1);
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayChunkPhp8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-chunk-php81.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1);
// onlyif PHP_VERSION_ID >= 80100

namespace ArrayChunkPhp81;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-column-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayColumn\Php7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-column-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayColumn\Php8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-column-php82.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80200

namespace ArrayColumn82;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-column.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80200

namespace ArrayColumn;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-combine-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayCombinePHP7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-combine-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayCombinePHP8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-fill-keys-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayFillKeysPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-fill-keys-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayFillKeysPhp8;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID >= 70400

namespace ArrayFilterArrowFunctions;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-flip-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayFlipPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-flip-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayFlipPhp8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-intersect-key-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayIntersectKeyPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-intersect-key-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayIntersectKeyPhp8;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80100

namespace ArrayIsList;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-is-list-unset.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80100

namespace ArrayIsListUnset;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array-search-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1);
// onlyif PHP_VERSION_ID < 80000

namespace ArraySearchPhp7;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80100

namespace ArrayUnpackingWithStringKeys;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array_keys-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayKeysPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array_keys.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayKeys;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array_values-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace ArrayValuesPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/array_values.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace ArrayValues;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 70400

namespace ArrowFunctionArgumentType;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bcmath-dynamic-return-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

// Verification for constant types: https://3v4l.org/96GSj

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bcmath-dynamic-return-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

// Verification for constant types: https://3v4l.org/96GSj

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-10071.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1); // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug10071;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-10201.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.1
// onlyif PHP_VERSION_ID >= 80100

namespace Bug10201;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-10445.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.1
// onlyif PHP_VERSION_ID >= 80100

namespace Bug10445;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-10627.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80100

namespace Bug10627;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-2600-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace Bug2600Php8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-2600.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace Bug2600;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-3336.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace Bug3336;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-3961-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace Bug3961Php8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-3961.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace Bug3961;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4188.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID >= 70400

namespace Bug4188Types;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4339.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID >= 70400

namespace Bug4339;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4885.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug4885Types;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4896.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

declare(strict_types = 1);

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4902-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID >= 80000

namespace Bug4902Php8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-4902.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID < 80000

namespace Bug4902;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5072.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_INT_SIZE == 8

namespace Bug5072;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5262.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1);
// onlyif PHP_VERSION_ID >= 80000

namespace Bug5262;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5287-php81.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);
// onlyif PHP_VERSION_ID >= 80100

namespace Bug5287Php81;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5287.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);
// onlyif PHP_VERSION_ID < 80100

namespace Bug5287;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5458.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 70400

namespace Bug5458;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5698-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace Bug5698;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5698-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace Bug5698;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5782b-php7.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID < 80000

namespace Bug5782bPhp7;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5782b-php8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace Bug5782bPhp8;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-5843.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug5843;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6251.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1); // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6251;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6293.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6239;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6308.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6433.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.1
// onlyif PHP_VERSION_ID >= 80100

namespace Bug6433;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6505.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6505;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6566-types.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6566Types;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6591.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);
// onlyif PHP_VERSION_ID >= 70400

namespace Bug6591;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6654.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.3
// onlyif PHP_VERSION_ID >= 70300

namespace Bug6654;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6695.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.1
// onlyif PHP_VERSION_ID >= 80100

namespace Bug6695;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6790.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1); // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6790;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6859.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 7.4
// onlyif PHP_VERSION_ID >= 70400

declare(strict_types = 1);

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6864.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php // lint >= 8.1
// onlyif PHP_VERSION_ID >= 80100

namespace Bug6864;

Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/data/bug-6870.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types = 1); // lint >= 8.0
// onlyif PHP_VERSION_ID >= 80000

namespace Bug6870;

Expand Down
Loading

0 comments on commit ee3556b

Please sign in to comment.