Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jrfnl/7902d86aa5d6b306e0edad9d7c1ff274 to your computer and use it in GitHub Desktop.

Select an option

Save jrfnl/7902d86aa5d6b306e0edad9d7c1ff274 to your computer and use it in GitHub Desktop.
Impact analysis proposed PHP 8.6 deprecation of return from finally on Packagist top 4000
<?xml version="1.0"?>
<ruleset name="Impact check for https://wiki.php.net/rfc/deprecations_php_8_6">
<!-- This ruleset should only be used in conjunction with PHPCompatibility at commit
https://github.com/PHPCompatibility/PHPCompatibility/commit/cc67a3824dda9612896f5892c2d6d9408fa20d77 -->
<file>sources</file>
<arg name="extensions" value="php"/>
<arg value="ps"/>
<arg name="basepath" value="./sources/"/>
<arg name="parallel" value="8"/>
<arg name="no-colors"/>
<arg name="ignore-annotations"/>
<arg name="report" value="code,summary,source"/>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!-- We are specifically and only checking for the PHP 8.6 deprecation(s). -->
<config name="testVersion" value="8.6"/>
<rule ref="PHPCompatibility.ControlStructures.RemovedReturnFromFinally"/>
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<rule ref="Internal.LineEndings.Mixed">
<severity>0</severity>
</rule>
</ruleset>
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
---------------------------------------------------------------------------------
SOURCE COUNT
---------------------------------------------------------------------------------
PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated 8
---------------------------------------------------------------------------------
A TOTAL OF 8 SNIFF VIOLATIONS WERE FOUND IN 1 SOURCE
---------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
---------------------------------------------------------------------------------
SOURCE COUNT
---------------------------------------------------------------------------------
PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated 8
---------------------------------------------------------------------------------
A TOTAL OF 8 SNIFF VIOLATIONS WERE FOUND IN 1 SOURCE
---------------------------------------------------------------------------------
FILE: amphp\http-server--v3.4.6\src\Driver\Http2Driver.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 1322: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
1320: } finally {
1321: if (!isset($this->streams[$streamId])) {
>> 1322: return; // Stream may have closed after resolving body emitter or trailers deferred.
1323: }
1324:
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: cakephp\cakephp--5.4.0-RC2\src\Database\Query.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 1885: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
1883: restore_error_handler();
1884:
>> 1885: return [
1886: '(help)' => 'This is a Query object, to get the results execute or iterate it.',
1887: 'sql' => $sql,
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: cakephp\database--5.4.0-RC2\Query.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 1885: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
1883: restore_error_handler();
1884:
>> 1885: return [
1886: '(help)' => 'This is a Query object, to get the results execute or iterate it.',
1887: 'sql' => $sql,
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: hyperf\http-server--v3.2.0\src\Server.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 140: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
138: // Send the Response to client.
139: if (! isset($psr7Response) || ! $psr7Response instanceof ResponseInterface) {
>> 140: return;
141: }
142: if (isset($psr7Request) && $psr7Request->getMethod() === 'HEAD') {
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: shopware\core--v6.7.11.1\Content\Media\Thumbnail\ThumbnailService.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 293: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
291: $this->dispatcher->dispatch($event);
292: } finally {
>> 293: return $records;
294: }
295: }
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: silverstripe\framework--6.2.2\src\ORM\Connect\MySQLiConnector.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 213: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
211: $errorCode = $exception ? $exception->getCode() : $this->getLastErrorCode();
212: $this->throwRelevantError($errorMsg, $errorCode, $errorLevel, $sql, []);
>> 213: return null;
214: }
215: }
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: spatie\ray--1.48.0\src\Client.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 71: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
69: static::$cache[$this->fingerprint] = [$success, $expiresAt];
70: } finally {
>> 71: return $success ?? false;
72: }
73: }
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: symfony\flex--v2.11.0\src\PackageResolver.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
LINE 88: WARNING Passing a return value from a finally block is deprecated since PHP 8.6.
(PHPCompatibility.ControlStructures.RemovedReturnFromFinally.Deprecated)
------------------------------------------------------------------------------------------------------------------------------------------------------
86: } finally {
87: if (!$isRequire || !isset($config['extra']['symfony']['require'])) {
>> 88: return '';
89: }
90: }
------------------------------------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment