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

fixes mb_strlen(): Passing null to parameter #1 ($string) of type str… #85

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

MichalSkoula
Copy link

při volání new Api() bez parametrů (když je nepotřebuji = když si jen chci stáhnout pobočky přes getParcelShops) dostávám chybu

Message: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Filename: src/Api.php

Tento commit to fixne :)

…ing is deprecated in Api.php constructor
src/Api.php Outdated
@@ -97,11 +97,11 @@ class Api
*/
public function __construct($username = null, $password = null, $customerId = null, $storage = null, $trace = true)
{
if (mb_strlen($username) > 32) {
if (mb_strlen($username ?? '') > 32) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm tohle se mi zda trosku "hacky" nebude null check lepsi? (citelnejsi) if ($username !== null && mb_...?

@MichalSkoula
Copy link
Author

ok přepsáno :)

@Salamek Salamek merged commit 7f93ae7 into Salamek:master Jun 29, 2024
1 check passed
@Salamek
Copy link
Owner

Salamek commented Jun 29, 2024

Diky!

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

Successfully merging this pull request may close these issues.

2 participants