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

Rename PDO parameters. #6220

Closed
wants to merge 3 commits into from
Closed

Rename PDO parameters. #6220

wants to merge 3 commits into from

Conversation

Crell
Copy link
Contributor

@Crell Crell commented Sep 26, 2020

  • s/$passwd/$password.
  • s/$driverdata/$driver_options to match docs.
  • s/$class_name/$class, as we've done elsewhere.
  • Standardize on $param instead of $parameter.
  • Get rid of $ctor_args because really?
  • Don't repeat function name as variable name.
  • Standardize $fetch_style/$fetch_mode on the latter, since there is a setFetchMode method. Except in cases where "fetch" is already in the method name, then just use $mode. (I'm unsure about this one.)

Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

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

One more observation: usually, we use the $args param names, except in setFetchMode() where $params is used. I think we should choose one of these terms (if it's really possible).

ext/pdo/pdo_dbh.stub.php Outdated Show resolved Hide resolved

/** @return bool */
public function bindParam(string|int $parameter, mixed &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, mixed $driverdata = null) {}
public function bindParam(string|int $param, mixed &$bind_var, int $type = PDO::PARAM_STR, int $max_length = 0, mixed $driver_options = null) {}
Copy link
Member

Choose a reason for hiding this comment

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

I could also imagine $var instead of $bind_var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could be convinced of that if others feel strongly. I felt "var" was too generic, and when writing it in named form bind_var seemed more descriptive.

ext/pdo/pdo_dbh.stub.php Outdated Show resolved Hide resolved
ext/pdo/pdo_stmt.stub.php Outdated Show resolved Hide resolved
ext/pdo/pdo_stmt.stub.php Outdated Show resolved Hide resolved
ext/pdo/pdo_stmt.stub.php Outdated Show resolved Hide resolved
ext/pdo/pdo_stmt.stub.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants