Skip to content

Commit 0e34a1e

Browse files
committed
Merge branch 'master' of github.com:jetbrains/phpstorm-stubs into fork
2 parents 75f36a1 + 4fb88bf commit 0e34a1e

File tree

157 files changed

+5853
-3503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+5853
-3503
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.php-cs-fixer.php export-ignore
4+
docker-compose.yml export-ignore
5+
phpunit.xml.dist export-ignore

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
11+
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1212
name: Run tests against php ${{matrix.php}}
1313
steps:
1414
- name: Checkout
@@ -50,4 +50,4 @@ jobs:
5050
run: docker compose -f docker-compose.yml run test_runner vendor/bin/phpunit --no-progress --testsuite Structure
5151

5252
- name: run cs fixer
53-
run: docker compose -f docker-compose.yml run test_runner composer cs -- --show-progress=none
53+
run: docker run --rm -e PHP_CS_FIXER_IGNORE_ENV=1 -v .:/opt/project -w /opt/project php:8.4-cli sh -c 'curl -sS https://getcomposer.org/installer | php && php composer.phar run cs'

.github/workflows/testLinks.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Composer Install
16-
run: docker-compose -f docker-compose.yml run test_runner composer install
16+
run: docker compose -f docker-compose.yml run test_runner composer install
1717
env:
18-
PHP_VERSION: '8.0'
18+
PHP_VERSION: '8.4'
1919

2020
- name: Build Docker Container
21-
run: docker-compose -f docker-compose.yml build >/dev/null
21+
run: docker compose -f docker-compose.yml build >/dev/null
2222
env:
23-
PHP_VERSION: '8.0'
23+
PHP_VERSION: '8.4'
2424

2525
- name: Run Tests
26-
run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner vendor/bin/phpunit --testsuite PhpDoc
26+
run: docker compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner vendor/bin/phpunit --testsuite PhpDoc
2727
env:
28-
PHP_VERSION: '8.0'
28+
PHP_VERSION: '8.4'

.github/workflows/testPeclExtensions.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Build Docker Container
16-
run: docker-compose -f docker-compose.yml build >/dev/null
16+
run: docker compose -f docker-compose.yml build >/dev/null
1717
env:
18-
PHP_VERSION: '8.0'
18+
PHP_VERSION: '8.4'
1919

2020
- name: Composer Install
21-
run: docker-compose -f docker-compose.yml run test_runner composer install
21+
run: docker compose -f docker-compose.yml run test_runner composer install
2222

2323
- name: Dump Reflection With Pecl To File
24-
run: docker-compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json
24+
run: docker compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json
2525

2626
- name: Dump Reflection Without Pecl To File
27-
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json
27+
run: docker compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json
2828

2929
- name: Build Reflection Data With Pecl Only
30-
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-pecl-to-file.php
30+
run: docker compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-pecl-to-file.php
3131

3232
- name: Run Tests
33-
run: docker-compose -f docker-compose.yml run -e PHP_VERSION='8.0' test_runner vendor/bin/phpunit tests/
33+
run: docker compose -f docker-compose.yml run -e PHP_VERSION='8.4' test_runner vendor/bin/phpunit tests/
3434
env:
35-
PHP_VERSION: '8.0'
35+
PHP_VERSION: '8.4'

.php-cs-fixer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
$finder = PhpCsFixer\Finder::create()
99
->in(__DIR__)
1010
->append(['.php-cs-fixer.php'])
11-
->notName('PhpStormStubsMap.php');
11+
->notName('PhpStormStubsMap.php')
12+
->notPath([
13+
'tests/Parsers/StubParser.php',
14+
'tests/Parsers/Visitors/ASTVisitor.php',
15+
'Core/Core.php',
16+
]);
1217

1318
return (new PhpCsFixer\Config())
19+
->setUnsupportedPhpVersionAllowed(true)
1420
->registerCustomFixers([
1521
new BracesOneLineFixer(),
1622
])

Core/Core.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ function method_exists($object_or_class, string $method): bool {}
431431
* @param string $property <p>
432432
* The name of the property
433433
* </p>
434-
* @return bool true if the property exists, false if it doesn't exist or
435-
* null in case of an error.
434+
* @return bool true if the property exists, false otherwise
436435
*/
437436
#[Pure]
438437
function property_exists($object_or_class, string $property): bool {}
@@ -441,7 +440,7 @@ function property_exists($object_or_class, string $property): bool {}
441440
* Checks if the trait exists
442441
* @param string $trait Name of the trait to check
443442
* @param bool $autoload [optional] Whether to autoload if not already loaded.
444-
* @return bool Returns TRUE if trait exists, FALSE if not, NULL in case of an error.
443+
* @return bool Returns true if trait exists, false otherwise
445444
* @link https://secure.php.net/manual/en/function.trait-exists.php
446445
* @since 5.4
447446
*/
@@ -605,7 +604,7 @@ function get_class_vars(string $class): array {}
605604
* for the specified <i>object</i> in scope. If a property have
606605
* not been assigned a value, it will be returned with a null value.
607606
*/
608-
#[Pure]
607+
#[Pure(true)]
609608
function get_object_vars(object $object): array {}
610609

611610
/**
@@ -708,6 +707,10 @@ function set_error_handler(?callable $callback, int $error_levels = E_ALL) {}
708707
#[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')]
709708
function restore_error_handler(): bool {}
710709

710+
/**
711+
* @since 8.5
712+
*/
713+
function get_error_handler(): ?callable {}
711714
/**
712715
* Sets a user-defined exception handler function
713716
* @link https://php.net/manual/en/function.set-exception-handler.php
@@ -724,6 +727,11 @@ function restore_error_handler(): bool {}
724727
*/
725728
function set_exception_handler(?callable $callback) {}
726729

730+
/**
731+
* @since 8.5
732+
*/
733+
function get_exception_handler(): ?callable {}
734+
727735
/**
728736
* Restores the previously defined exception handler function
729737
* @link https://php.net/manual/en/function.restore-exception-handler.php
@@ -813,6 +821,7 @@ function create_function(string $args, string $code): false|string {}
813821
* by this function, the return value will be the string
814822
* Unknown.
815823
*/
824+
#[Pure(true)]
816825
function get_resource_type($resource): string {}
817826

818827
/**
@@ -1032,6 +1041,7 @@ function get_defined_constants(bool $categorize = false): array {}
10321041
* </tr>
10331042
* </table>
10341043
*/
1044+
#[Pure(true)]
10351045
function debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0): array {}
10361046

10371047
/**
@@ -1139,4 +1149,9 @@ function exit(string|int $status = 0): never {}
11391149
/**
11401150
* @since 8.4
11411151
*/
1142-
function die(string|int $status = 0): never {}
1152+
function die(string|int $status = 0): never {}
1153+
1154+
/**
1155+
* @since 8.5
1156+
*/
1157+
function clone(object $object, array $withProperties = []): object {}

Core/Core_c.php

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ public function __toString();
279279
*/
280280
class Exception implements Throwable
281281
{
282-
/** The error message */
282+
/**
283+
* The error message
284+
* @var string
285+
*/
283286
protected $message;
284287

285288
/** The error code */
@@ -526,6 +529,12 @@ private function __clone(): void {}
526529
public function __wakeup(): void {}
527530
}
528531

532+
/**
533+
* Is thrown when the type of an argument is correct but the value of it is incorrect. For example, passing a negative
534+
* integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty.
535+
* @link https://www.php.net/manual/en/class.valueerror.php
536+
* @since 8.0
537+
*/
529538
class ValueError extends Error {}
530539

531540
/**
@@ -604,7 +613,7 @@ class ErrorException extends Exception
604613
* @param int $severity [optional] The severity level of the exception.
605614
* @param string $filename [optional] The filename where the exception is thrown.
606615
* @param int $line [optional] The line number where the exception is thrown.
607-
* @param Exception $previous [optional] The previous exception used for the exception chaining.
616+
* @param Throwable $previous [optional] The previous exception used for the exception chaining.
608617
*/
609618
#[Pure]
610619
public function __construct(
@@ -693,6 +702,11 @@ public function call(object $newThis, mixed ...$args): mixed {}
693702
* @since 7.1
694703
*/
695704
public static function fromCallable(callable $callback): Closure {}
705+
706+
/**
707+
* @since 8.5
708+
*/
709+
public static function getCurrent(): Closure {}
696710
}
697711

698712
/**
@@ -875,10 +889,16 @@ final class Attribute
875889
*/
876890
public const TARGET_PARAMETER = 32;
877891

892+
/**
893+
* Marks that attribute declaration is allowed only in constants.
894+
* @since 8.5
895+
*/
896+
public const TARGET_CONSTANT = 32;
897+
878898
/**
879899
* Marks that attribute declaration is allowed anywhere.
880900
*/
881-
public const TARGET_ALL = 63;
901+
public const TARGET_ALL = 127;
882902

883903
/**
884904
* Notes that an attribute declaration in the same place is
@@ -890,7 +910,7 @@ final class Attribute
890910
* @param int $flags A value in the form of a bitmask indicating the places
891911
* where attributes can be defined.
892912
*/
893-
public function __construct(#[ExpectedValues(flagsFromClass: Attribute::class)] int $flags = self::TARGET_ALL) {}
913+
public function __construct(#[ExpectedValues(flagsFromClass: Attribute::class)] int $flags = Attribute::TARGET_ALL) {}
894914
}
895915

896916
/**
@@ -937,7 +957,7 @@ interface BackedEnum extends UnitEnum
937957
* case, if any. If there is no matching case defined, it will throw a
938958
* <code>ValueError</code>.
939959
* @param int|string $value
940-
* @throws ValueError
960+
* @throws ValueError if there is no matching case defined
941961
* @throws TypeError
942962
* @return static
943963
* @link https://www.php.net/manual/en/backedenum.from.php
@@ -968,15 +988,23 @@ interface IntBackedEnum extends BackedEnum
968988
public readonly int $value;
969989

970990
/**
991+
* Translates an int into the corresponding <code>Enum</code>
992+
* case, if any. If there is no matching case defined, it will throw a
993+
* <code>ValueError</code>.
971994
* @param int $value
972995
* @return static
996+
* @throws ValueError if there is no matching case defined
997+
* @link https://www.php.net/manual/en/backedenum.from.php
973998
*/
974999
#[Pure]
9751000
public static function from(int $value): static;
9761001

9771002
/**
1003+
* Translates an int into the corresponding <code>Enum</code>
1004+
* case, if any. If there is no matching case defined, it will return null.
9781005
* @param int $value
9791006
* @return static|null
1007+
* @link https://www.php.net/manual/en/backedenum.tryfrom.php
9801008
*/
9811009
#[Pure]
9821010
public static function tryFrom(int $value): ?static;
@@ -992,9 +1020,25 @@ interface StringBackedEnum extends BackedEnum
9921020
{
9931021
public readonly string $value;
9941022

1023+
/**
1024+
* Translates a string into the corresponding <code>Enum</code>
1025+
* case, if any. If there is no matching case defined, it will throw a
1026+
* <code>ValueError</code>.
1027+
* @param string $value
1028+
* @return static
1029+
* @throws ValueError if there is no matching case defined
1030+
* @link https://www.php.net/manual/en/backedenum.from.php
1031+
*/
9951032
#[Pure]
9961033
public static function from(string $value): static;
9971034

1035+
/**
1036+
* Translates a string or int into the corresponding <code>Enum</code>
1037+
* case, if any. If there is no matching case defined, it will return null.
1038+
* @param string $value
1039+
* @return static|null
1040+
* @link https://www.php.net/manual/en/backedenum.tryfrom.php
1041+
*/
9981042
#[Pure]
9991043
public static function tryFrom(string $value): ?static;
10001044
}
@@ -1160,11 +1204,28 @@ public function __construct() {}
11601204
/**
11611205
* @since 8.4
11621206
*/
1163-
#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION|Attribute::TARGET_CLASS_CONSTANT)]
1207+
#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION|Attribute::TARGET_CLASS_CONSTANT|Attribute::TARGET_CONSTANT)]
11641208
final class Deprecated
11651209
{
11661210
public readonly ?string $message;
11671211
public readonly ?string $since;
11681212

11691213
public function __construct(?string $message = null, ?string $since = null) {}
11701214
}
1215+
1216+
/**
1217+
* @since 8.5
1218+
*/
1219+
#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION)]
1220+
final class NoDiscard
1221+
{
1222+
public readonly ?string $message;
1223+
1224+
public function __construct(?string $message = null) {}
1225+
}
1226+
1227+
/**
1228+
* @since 8.5
1229+
*/
1230+
#[Attribute(Attribute::TARGET_ALL)]
1231+
final class DelayedTargetValidation {}

Core/Core_d.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
define('null', null, true);
148148
define('ZEND_THREAD_SAFE', false);
149149
define('ZEND_DEBUG_BUILD', false);
150+
define('ZEND_VM_KIND_HYBRID', 4);
151+
define('ZEND_VM_KIND', ZEND_VM_KIND_HYBRID);
150152
define('PHP_WINDOWS_VERSION_BUILD', 0);
151153
define('PHP_WINDOWS_VERSION_MAJOR', 0);
152154
define('PHP_WINDOWS_VERSION_MINOR', 0);
@@ -281,3 +283,6 @@
281283
* @link https://php.net/manual/en/reserved.constants.php
282284
*/
283285
define('PHP_MANDIR', '/usr/local/php/php/man');
286+
287+
define('PHP_BUILD_DATE', 'Aug 14 2025 22:21:58');
288+
define('PHP_BUILD_PROVIDER', 'https://github.com/docker-library/php');

LuaSandbox/LuaSandbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class LuaSandboxFunction
371371
* which may be empty, or false on error.</p>
372372
* @since luasandbox >= 1.0.0
373373
*/
374-
public function call($arguments) {}
374+
public function call(string ...$args) {}
375375

376376
/**
377377
* Dump the function as a binary blob.

0 commit comments

Comments
 (0)