Tags: rockschtar/wordpress-database-fluent
Tags
Fix the handling of database error in GetResults.php An error in the 'GetResults.php' file was resolved where the database error check was incorrectly calling '$wpdb->last_error' instead of using the object reference '$this->wpdb->last_error'. The change ensures that in case of a database error, a DatabaseException with the correct error message will be thrown.
Update package type and version in composer.json This commit changes the package type from "wordpress-plugin" to "library" in composer.json. It also updates the version of the "squizlabs/php_codesniffer" package from "3.9.1" to "3.9.2" in composer.lock to use the latest version.
Refactor WPDB class and add nullability to Execute The WPDB class has been refactored to remove the singleton pattern and instead each method now directly instantiates a new object. This change simplifies the logic in the WPDB class and leads to a more functional style of programming. In addition, the constructor in the Execute class is enhanced to accept null and handle the db connection appropriately.
Refactor code for consistency and readability This commit refactors two classes by making a small modification to improve code readability and ensure consistency. It removes an unnecessary newline in the Insert.php file and adds parentheses to a new instance creation in the WPDB.php file.
Refactor code for better readability and install PHP CodeSniffer The changes involve reformatting code for better readability and adherence to PSR-12 coding standards. PHP CodeSniffer was also installed as a development dependency to enforce these standards. A new .lando.yml file was introduced and phpcs.xml was configured to use the PSR-12 standard. Updates in composer.json and composer.lock reflect dependency changes.