Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 dictionary #9366

Merged
merged 7 commits into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions dictionaries/CallMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Phan\Language\Internal;

/**
* CURRENT PHP TARGET VERSION: 8.2
* CURRENT PHP TARGET VERSION: 8.3
* The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION
*
* Format
Expand Down Expand Up @@ -2951,7 +2951,7 @@
'gc_enable' => ['void'],
'gc_enabled' => ['bool'],
'gc_mem_caches' => ['int'],
'gc_status' => ['array{runs:int,collected:int,threshold:int,roots:int}'],
'gc_status' => ['array{runs:int,collected:int,threshold:int,roots:int,running:bool,protected:bool,full:bool,buffer_size:int}'],
'gd_info' => ['array'],
'gearman_bugreport' => [''],
'gearman_client_add_options' => ['', 'client_object'=>'', 'option'=>''],
Expand Down Expand Up @@ -6162,6 +6162,7 @@
'json_encode' => ['non-empty-string|false', 'value'=>'mixed', 'flags='=>'int', 'depth='=>'int'],
'json_last_error' => ['int'],
'json_last_error_msg' => ['string'],
'json_validate' => ['bool', 'json'=>'string', 'depth='=>'positive-int', 'flags='=>'int'],
alies-dev marked this conversation as resolved.
Show resolved Hide resolved
'JsonException::__clone' => ['void'],
'JsonException::__construct' => ['void'],
'JsonException::__toString' => ['string'],
Expand Down
32 changes: 32 additions & 0 deletions dictionaries/CallMap_83_delta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php // phpcs:ignoreFile

/**
* This contains the information needed to convert the function signatures for php 8.3 to php 8.2 (and vice versa)
*
* This file has three sections.
* The 'added' section contains function/method names from FunctionSignatureMap (And alternates, if applicable) that do not exist in php 8.2
* The 'removed' section contains the signatures that were removed in php 8.3
* The 'changed' section contains functions for which the signature has changed for php 8.3.
* Each function in the 'changed' section has an 'old' and a 'new' section,
* representing the function as it was in PHP 8.2 and in PHP 8.3, respectively
*
* @see CallMap.php
* @see https://php.watch/versions/8.3
*
* @phan-file-suppress PhanPluginMixedKeyNoKey (read by Phan when analyzing this file)
*/
return [
'added' => [
'json_validate' => ['bool', 'json'=>'string', 'depth='=>'positive-int', 'flags='=>'int'],
],

'changed' => [
'gc_status' => [
'old' => ['array{runs:int,collected:int,threshold:int,roots:int}'],
'new' => ['array{runs:int,collected:int,threshold:int,roots:int,running:bool,protected:bool,full:bool,buffer_size:int}'],
],
],

'removed' => [
],
];
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Codebase/InternalCallMapHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
class InternalCallMapHandler
{
private const PHP_MAJOR_VERSION = 8;
private const PHP_MINOR_VERSION = 2;
private const PHP_MINOR_VERSION = 3;
private const LOWEST_AVAILABLE_DELTA = 71;

private static ?int $loaded_php_major_version = null;
Expand Down