Fixes for 2 code quality findings in Tools library (#3344)

* Apply suggested fix to src/library/FOSSBilling/Tools.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Apply suggested fix to src/library/FOSSBilling/Tools.php from Copilot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
Adam DaleyandCopilot Autofix powered by AI authored and GitHub committed 2026-03-17 15:49:39 +00:00
1 parent bbdf1f8951
commit 7e42f5ed62
1 file changed
+3 -2
+3 -2
View File
@@ -56,7 +56,7 @@ class Tools
* @param int $length the length of the password to generate
* @param bool|int $includeSpecial If special characters should be included. If 4 is passed, that's considered to be true (added for backwards compatibility).
*
* @throws InformationException if it failed to generate a password meeting the requirements within 50 iterations
* @throws InformationException if it failed to generate a password meeting the requirements within 100 iterations
*/
public function generatePassword(int $length = 8, bool|int $includeSpecial = false): string
{
@@ -192,7 +192,8 @@ class Tools
return [];
}
$slots = (is_countable($ids) ? count($ids) : 0) ? implode(',', array_fill(0, is_countable($ids) ? count($ids) : 0, '?')) : ''; // same as RedBean genSlots() method
$count = is_countable($ids) ? count($ids) : 0;
$slots = $count ? implode(',', array_fill(0, $count, '?')) : ''; // same as RedBean genSlots() method
$rows = $this->di['db']->getAll('SELECT id, title FROM ' . $table . ' WHERE id in (' . $slots . ')', $ids);