Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
using $array[] = $value instead of array_push($array,$value)
it's faster and more readable
  • Loading branch information
rotelok committed Jun 16, 2018
commit c8b2bc06b9f9ca3524f2846d518ddf358aff4e71
2 changes: 1 addition & 1 deletion lib/backup-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

while (false !== ($cssFile = readdir($handle))) {
if ($cssFile !== "." && $cssFile != "..") {
array_push($themeArray,basename($cssFile,".css"));
$themeArray[] = basename($cssFile, ".css");
}
}
sort($themeArray);
Expand Down
8 changes: 4 additions & 4 deletions lib/get-branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
$objectListArray = array();
foreach ($objectList as $objectRef) {
$fileFolderName = @ltrim(substr(str_replace("\\","/",$objectRef->getPathname()), strlen($path)),"/");
array_push($objectListArray,$fileFolderName);
$objectListArray[] = $fileFolderName;
}
}

Expand Down Expand Up @@ -253,9 +253,9 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
}
// Establish the blob SHA contents and push name, SHA and type into 3 arrays
$store = "blob ".strlen($contents)."\000".$contents;
array_push($dirListArray,ltrim($fileFolderName,"/"));
array_push($dirSHAArray,sha1($store));
array_push($dirTypeArray,"file");
$dirListArray[] = ltrim($fileFolderName, "/");
$dirSHAArray[] = sha1($store);
$dirTypeArray[] = "file";
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/settings-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
while (false !== ($file = readdir($handle))) {
if ($file !== "." && $file != "..") {
array_push($themeArray,basename($file,".css"));
$themeArray[] = basename($file, ".css");
}
}
sort($themeArray);
Expand Down
2 changes: 1 addition & 1 deletion lib/updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function startUpdate() {
$testPath = str_replace("\\","/",$testPath);
if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
if (!is_writable($item)) {
array_push($cantMoveArray,substr($item,count($source)+2));
$cantMoveArray[] = substr($item, count($source) + 2);
}
}
}
Expand Down