Skip to content

Commit

Permalink
docs: phpdoc incorrect explanation regarding variable naming (#9326)
Browse files Browse the repository at this point in the history
* Update FileHandler.php

* Update BaseConnection.php

* Update Connection.php

* Update filesystem_helper.php

* Update Security.php

* Update SecurityInterface.php
  • Loading branch information
andifahruddinakas authored Dec 16, 2024
1 parent 61881bd commit 17f7a9d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions system/Cache/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,13 @@ protected function getDirFileInfo(string $sourceDir, bool $topLevelOnly = true,
$relativePath = $sourceDir;

if ($fp = @opendir($sourceDir)) {
// reset the array and make sure $source_dir has a trailing slash on the initial call
// reset the array and make sure $sourceDir has a trailing slash on the initial call
if ($_recursion === false) {
$_filedata = [];
$sourceDir = rtrim(realpath($sourceDir) ?: $sourceDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}

// Used to be foreach (scandir($source_dir, 1) as $file), but scandir() is simply not as fast
// Used to be foreach (scandir($sourceDir, 1) as $file), but scandir() is simply not as fast
while (false !== ($file = readdir($fp))) {
if (is_dir($sourceDir . $file) && $file[0] !== '.' && $topLevelOnly === false) {
$this->getDirFileInfo($sourceDir . $file . DIRECTORY_SEPARATOR, $topLevelOnly, true);
Expand Down
4 changes: 2 additions & 2 deletions system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function initialize()
/* If an established connection is available, then there's
* no need to connect and select the database.
*
* Depending on the database driver, conn_id can be either
* Depending on the database driver, connID can be either
* boolean TRUE, a resource or an object.
*/
if ($this->connID) {
Expand Down Expand Up @@ -846,7 +846,7 @@ public function transBegin(bool $testMode = false): bool
}

// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// If the $testMode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
$this->transFailure = $testMode;

Expand Down
2 changes: 1 addition & 1 deletion system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Connection extends BaseConnection
/**
* MySQLi object
*
* Has to be preserved without being assigned to $conn_id.
* Has to be preserved without being assigned to $connId.
*
* @var false|mysqli
*/
Expand Down
4 changes: 2 additions & 2 deletions system/Helpers/filesystem_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ function get_dir_file_info(string $sourceDir, bool $topLevelOnly = true, bool $r
try {
$fp = opendir($sourceDir);

// reset the array and make sure $source_dir has a trailing slash on the initial call
// reset the array and make sure $sourceDir has a trailing slash on the initial call
if ($recursion === false) {
$fileData = [];
$sourceDir = rtrim(realpath($sourceDir), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}

// Used to be foreach (scandir($source_dir, 1) as $file), but scandir() is simply not as fast
// Used to be foreach (scandir($sourceDir, 1) as $file), but scandir() is simply not as fast
while (false !== ($file = readdir($fp))) {
if (is_dir($sourceDir . $file) && $file[0] !== '.' && $topLevelOnly === false) {
get_dir_file_info($sourceDir . $file . DIRECTORY_SEPARATOR, $topLevelOnly, true);
Expand Down
2 changes: 1 addition & 1 deletion system/Security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public function shouldRedirect(): bool
*
* If it is acceptable for the user input to include relative paths,
* e.g. file/in/some/approved/folder.txt, you can set the second optional
* parameter, $relative_path to TRUE.
* parameter, $relativePath to TRUE.
*
* @param string $str Input file name
* @param bool $relativePath Whether to preserve paths
Expand Down
2 changes: 1 addition & 1 deletion system/Security/SecurityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function shouldRedirect(): bool;
*
* If it is acceptable for the user input to include relative paths,
* e.g. file/in/some/approved/folder.txt, you can set the second optional
* parameter, $relative_path to TRUE.
* parameter, $relativePath to TRUE.
*
* @param string $str Input file name
* @param bool $relativePath Whether to preserve paths
Expand Down

0 comments on commit 17f7a9d

Please sign in to comment.