berlindb / core

All of the required core code
MIT License
256 stars 29 forks source link

Resolve PHPStan Level 0 errors #144

Closed szepeviktor closed 2 years ago

szepeviktor commented 2 years ago

@JJJ Please see comments.

szepeviktor commented 2 years ago

Done. Both. 🍏

JJJ commented 2 years ago

@szepeviktor any suggestions on using with Php 8.1+?

Do you have any desire to have elevated access to create PRs directly here without needing to fork?

szepeviktor commented 2 years ago

any suggestions on using with Php 8.1+

Do you mean running PHPStan on PHP 8.1 or running BerlinDB on PHP 8.1?

JJJ commented 2 years ago

Do you mean running PHPStan on PHP 8.1 or running BerlinDB on PHP 8.1?

Both! 🫠 Running PHPStan (like you would normally) but for BerlinDB with PHP 8.1 as the active CLI version?

Deprecated: Return type of PHPStan\Dependency\ExportedNode\ExportedPropertyNode::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/jjj/Development/JH/wp-content/plugins/berlindb/vendor/phpstan/phpstan/phpstan.phar/src/Dependency/ExportedNode/ExportedPropertyNode.php on line 71
Deprecated: Return type of PHPStan\Dependency\ExportedNode\ExportedInterfaceNode::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/jjj/Development/JH/wp-content/plugins/berlindb/vendor/phpstan/phpstan/phpstan.phar/src/Dependency/ExportedNode/ExportedInterfaceNode.php on line 56
Deprecated: Return type of PHPStan\Dependency\ExportedNode\ExportedPhpDocNode::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/jjj/Development/JH/wp-content/plugins/berlindb/vendor/phpstan/phpstan/phpstan.phar/src/Dependency/ExportedNode/ExportedPhpDocNode.php on line 37
Deprecated: Return type of PHPStan\Dependency\ExportedNode\ExportedFunctionNode::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/jjj/Development/JH/wp-content/plugins/berlindb/vendor/phpstan/phpstan/phpstan.phar/src/Dependency/ExportedNode/ExportedFunctionNode.php on line 73
Deprecated: Return type of PHPStan\Dependency\ExportedNode\ExportedClassNode::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/jjj/Development/JH/wp-content/plugins/berlindb/vendor/phpstan/phpstan/phpstan.phar/src/Dependency/ExportedNode/ExportedClassNode.php on line 85
szepeviktor commented 2 years ago

As mixed typehint is not supported before PHP 8.1 the only way to resolve this is adding attribute #[\ReturnTypeWillChange]