Skip to content

Conversation

aaronjorbin
Copy link
Member

@aaronjorbin aaronjorbin commented Feb 1, 2023

The webp_uploads_update_image_onchange function takes 5 arguments.

See #622

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@aaronjorbin aaronjorbin added [Type] Bug An existing feature is broken [Focus] Images labels Feb 1, 2023
@aaronjorbin aaronjorbin added this to the 2.0.0 milestone Feb 1, 2023
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

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

This looks correct to me. Thanks for the PR, @aaronjorbin!

@szepeviktor
Copy link
Contributor

szepeviktor commented Feb 1, 2023

Fixes #622

😲

There are a bit more than 1 problems in performance. This argument count thing is just 1️⃣ example.

Would you like me to copy-paste here the output of static analysis?

composer require --dev szepeviktor/phpstan-wordpress
vendor/bin/phpstan analyse -c vendor/szepeviktor/phpstan-wordpress/extension.neon admin/ modules/ server-timing/ *.php --level=0

@szepeviktor
Copy link
Contributor

szepeviktor commented Feb 1, 2023

PHPStan level 0 output
 ------ ---------------------------------------------------------------
  Line   admin/load.php
 ------ ---------------------------------------------------------------
  30     Action callback returns array but should not return anything.
 ------ ---------------------------------------------------------------

 ------ ----------------------------------------------------------------
  Line   load.php
 ------ ----------------------------------------------------------------
  164    One or more @param tags has an invalid name or invalid syntax.
  301    One or more @param tags has an invalid name or invalid syntax.
 ------ ----------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------
  Line   modules/database/sqlite/wp-includes/sqlite/class-perflab-sqlite-db.php
 ------ ---------------------------------------------------------------------------------------------
  152    Method Perflab_SQLite_DB::print_error() should return bool but return statement is missing.
  203    Method Perflab_SQLite_DB::db_connect() should return bool but return statement is missing.
 ------ ---------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   modules/database/sqlite/wp-includes/sqlite/class-perflab-sqlite-pdo-engine.php
 ------ -------------------------------------------------------------------------------------------------------
  788    Method Perflab_SQLite_PDO_Engine::execute_query() should return bool but return statement is missing.
  1293   Method Perflab_SQLite_PDO_Engine::set_error() should return bool but return statement is missing.
  1513   Method Perflab_SQLite_PDO_Engine::commit() should return bool but return statement is missing.
  1523   Method Perflab_SQLite_PDO_Engine::rollBack() should return bool but return statement is missing.
 ------ -------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  Line   modules/database/sqlite/wp-includes/sqlite/class-perflab-sqlite-pdo-user-defined-functions.php
 ------ ---------------------------------------------------------------------------------------------------------------
  393    Method Perflab_SQLite_PDO_User_Defined_Functions::derive_interval() should return string but return statement
         is missing.
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------
  Line   modules/images/webp-uploads/image-edit.php
 ------ ------------------------------------------------------------
  224    Callback expects 5 parameters, $accepted_args is set to 7. 👈🏻
 ------ ------------------------------------------------------------

You will meet 👧🏻 Ms. Stability on level 4-5.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Thanks @aaronjorbin!

Though I would advise, since this is not the only problem spotted in #622, we change the PR description from "Fixes ..." to just "See ...", since there's more work to do to fix that issue.

Copy link
Contributor

@szepeviktor szepeviktor left a comment

Choose a reason for hiding this comment

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

Thank you.

The `webp_uploads_update_image_onchange` function takes 5 arguments.

See #622
@aaronjorbin aaronjorbin merged commit 8ae948e into trunk Feb 2, 2023
@aaronjorbin aaronjorbin deleted the aaronjorbin-patch-1 branch February 2, 2023 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants