Skip to content

PHP 8.1: silence the deprecation notices about missing return types #64

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

Merged
Merged
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
"require-dev": {
"nette/tester": "^1.3 || ^2.0",
"php-parallel-lint/php-console-highlighter": "~0.3",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.6"
},
"suggest": {
"php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet"
4 changes: 4 additions & 0 deletions src/Error.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace JakubOnderka\PhpParallelLint;

use ReturnTypeWillChange;

class Error implements \JsonSerializable
{
/** @var string */
@@ -57,6 +59,7 @@ public function getShortFilePath()
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize()
{
return array(
@@ -87,6 +90,7 @@ class Blame implements \JsonSerializable
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
*/
#[ReturnTypeWillChange]
function jsonSerialize()
{
return array(
4 changes: 4 additions & 0 deletions src/Manager.php
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
use JakubOnderka\PhpParallelLint\Contracts\SyntaxErrorCallback;
use JakubOnderka\PhpParallelLint\Process\GitBlameProcess;
use JakubOnderka\PhpParallelLint\Process\PhpExecutable;
use ReturnTypeWillChange;

class Manager
{
@@ -226,6 +227,7 @@ public function __construct(\RecursiveDirectoryIterator $iterator, array $exclud
* @link http://php.net/manual/en/filteriterator.accept.php
* @return bool true if the current element is acceptable, otherwise false.
*/
#[ReturnTypeWillChange]
public function accept()
{
$current = $this->current()->getPathname();
@@ -245,6 +247,7 @@ public function accept()
* @link http://php.net/manual/en/recursivefilteriterator.haschildren.php
* @return bool true if the inner iterator has children, otherwise false
*/
#[ReturnTypeWillChange]
public function hasChildren()
{
return $this->iterator->hasChildren();
@@ -257,6 +260,7 @@ public function hasChildren()
* @link http://php.net/manual/en/recursivefilteriterator.getchildren.php
* @return \RecursiveFilterIterator containing the inner iterator's children.
*/
#[ReturnTypeWillChange]
public function getChildren()
{
return new self($this->iterator->getChildren(), $this->excluded);
3 changes: 3 additions & 0 deletions src/Result.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace JakubOnderka\PhpParallelLint;

use ReturnTypeWillChange;

class Result implements \JsonSerializable
{
/** @var Error[] */
@@ -154,6 +156,7 @@ public function getTestTime()
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
*/
#[ReturnTypeWillChange]
function jsonSerialize()
{
return array(
3 changes: 3 additions & 0 deletions src/exceptions.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
namespace JakubOnderka\PhpParallelLint;

use ReturnTypeWillChange;

class Exception extends \Exception implements \JsonSerializable
{
#[ReturnTypeWillChange]
public function jsonSerialize()
{
return array(