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 | NewFunctions/NewConstants: detect new PGSQL features #1637

Merged
merged 4 commits into from
Sep 10, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -7706,6 +7706,41 @@ class NewConstantsSniff extends Sniff
'extension' => 'sockets',
],

'PGSQL_PIPELINE_SYNC' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_PIPELINE_ON' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_PIPELINE_OFF' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_PIPELINE_ABORTED' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_SHOW_CONTEXT_NEVER' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_SHOW_CONTEXT_ERRORS' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'PGSQL_SHOW_CONTEXT_ALWAYS' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'POSIX_SC_ARG_MAX' => [
'8.2' => false,
'8.3' => true,
Expand Down
25 changes: 25 additions & 0 deletions PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -4938,6 +4938,31 @@ class NewFunctionsSniff extends Sniff
'8.3' => true,
'extension' => 'mbstring',
],
'pg_set_error_context_visibility' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'pg_enter_pipeline_mode' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'pg_exit_pipeline_mode' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'pg_pipeline_sync' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'pg_pipeline_status' => [
'8.2' => false,
'8.3' => true,
'extension' => 'pgsql',
],
'posix_sysconf' => [
'8.2' => false,
'8.3' => true,
Expand Down
7 changes: 7 additions & 0 deletions PHPCompatibility/Tests/Constants/NewConstantsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1558,3 +1558,10 @@ echo POSIX_PC_CHOWN_RESTRICTED;
echo POSIX_PC_NO_TRUNC;
echo POSIX_PC_ALLOC_SIZE_MIN;
echo POSIX_PC_SYMLINK_MAX;
echo PGSQL_SHOW_CONTEXT_NEVER;
echo PGSQL_SHOW_CONTEXT_ERRORS;
echo PGSQL_SHOW_CONTEXT_ALWAYS;
echo PGSQL_PIPELINE_SYNC;
echo PGSQL_PIPELINE_ON;
echo PGSQL_PIPELINE_OFF;
echo PGSQL_PIPELINE_ABORTED;
7 changes: 7 additions & 0 deletions PHPCompatibility/Tests/Constants/NewConstantsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,13 @@ public static function dataNewConstant()
['POSIX_PC_NO_TRUNC', '8.2', 1558, '8.3'],
['POSIX_PC_ALLOC_SIZE_MIN', '8.2', 1559, '8.3'],
['POSIX_PC_SYMLINK_MAX', '8.2', 1560, '8.3'],
['PGSQL_SHOW_CONTEXT_NEVER', '8.2', 1561, '8.3'],
['PGSQL_SHOW_CONTEXT_ERRORS', '8.2', 1562, '8.3'],
['PGSQL_SHOW_CONTEXT_ALWAYS', '8.2', 1563, '8.3'],
['PGSQL_PIPELINE_SYNC', '8.2', 1564, '8.3'],
['PGSQL_PIPELINE_ON', '8.2', 1565, '8.3'],
['PGSQL_PIPELINE_OFF', '8.2', 1566, '8.3'],
['PGSQL_PIPELINE_ABORTED', '8.2', 1567, '8.3'],
];
}

Expand Down
5 changes: 5 additions & 0 deletions PHPCompatibility/Tests/FunctionUse/NewFunctionsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1048,3 +1048,8 @@ posix_sysconf();
posix_pathconf();
posix_fpathconf();
posix_eaccess();
pg_set_error_context_visibility();
pg_enter_pipeline_mode();
pg_exit_pipeline_mode();
pg_pipeline_sync();
pg_pipeline_status();
5 changes: 5 additions & 0 deletions PHPCompatibility/Tests/FunctionUse/NewFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,11 @@ public static function dataNewFunction()
['posix_pathconf', '8.2', 1048, '8.3'],
['posix_fpathconf', '8.2', 1049, '8.3'],
['posix_eaccess', '8.2', 1050, '8.3'],
['pg_set_error_context_visibility', '8.2', 1051, '8.3'],
['pg_enter_pipeline_mode', '8.2', 1052, '8.3'],
['pg_exit_pipeline_mode', '8.2', 1053, '8.3'],
['pg_pipeline_sync', '8.2', 1054, '8.3'],
['pg_pipeline_status', '8.2', 1055, '8.3'],
];
}

Expand Down