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.1 compatibility, to avoid deprecation notices #59

Open
mklemme1 opened this issue Feb 16, 2022 · 4 comments
Open

PHP 8.1 compatibility, to avoid deprecation notices #59

mklemme1 opened this issue Feb 16, 2022 · 4 comments
Assignees

Comments

@mklemme1
Copy link

mklemme1 commented Feb 16, 2022

Hallo
I am using SVGGraph Library version 3.13.
When using PHP 8.1.2 I get a lot of deprecation notices.

Code:

$graph =  new Goat1000\SVGGraph\SVGGraph(700,700, $settings);

Output:

Deprecated: Return type of Goat1000\SVGGraph\Colours::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /xxxxxx/SVGGraph/Colours.php on line 93 start`

In fact, the entire sceen is filled with notices.

I suspect the library needs to be updated in order to be usable with PHP 8.1

@mklemme1
Copy link
Author

List of messages: messages.txt

@goat1000 goat1000 self-assigned this Feb 16, 2022
@goat1000
Copy link
Owner

I have upgraded my version of PHP to 8.1.2, so I can see this myself now. I'll see what I can do about it.

For now turning those messages off would be a simple fix - they are just warnings that things will not work with PHP9:

error_reporting(E_ALL ^ E_DEPRECATED);

@mklemme1
Copy link
Author

Thanks!
I'll use that for the time being.

I get one more message

Notice: iconv(): Detected an illegal character in input string in xxxSVGGraph/Text.php on line 48 

That can be avoided by error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE );

@goat1000
Copy link
Owner

I've fixed all the PHP 8.1 warnings and notices that I could find - there may be more, but none of my tests are showing any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants