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

Add stub for mysqli_stmt properties #700

Merged
merged 1 commit into from
Oct 6, 2021
Merged

Add stub for mysqli_stmt properties #700

merged 1 commit into from
Oct 6, 2021

Conversation

morozov
Copy link
Contributor

@morozov morozov commented Oct 6, 2021

See #692.

public $errno;

/**
* @var array
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be smth like

@var array<int, array{errno: int, sqlstate: string, error: string}>

public $insert_id;

/**
* @var int
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be 0|positive-int as well as is $param_count?

/**
* @var int
*/
public $field_count;
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this one should also never be negative?

public $param_count;

/**
* @var string
Copy link
Contributor

Choose a reason for hiding this comment

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

If I interpret the docs right, I think this will never be empty, as 00000 means no error

Additionally, update the corresponding procedural style aliases.
@morozov
Copy link
Contributor Author

morozov commented Oct 6, 2021

@herndlm thanks for the recommendations. I initially intended to keep the changes scoped to the original issue and keep the signatures consistent with their existing procedural style aliases.

@herndlm
Copy link
Contributor

herndlm commented Oct 6, 2021

@herndlm thanks for the recommendations. I initially intended to keep the changes scoped to the original issue and keep the signatures consistent with their existing procedural style aliases.

Yeah I just wanted to suggest things, but I'm still too new here, so do take my comments with a grain of salt please!

@ondrejmirtes ondrejmirtes merged commit d5c2a07 into phpstan:master Oct 6, 2021
@ondrejmirtes
Copy link
Member

Thank you both! :)

@morozov morozov deleted the mysqli-stub branch October 6, 2021 15:36
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.

3 participants