PSR2 style fixes

These are some simple whitespace/arrangement things that apparantly
can't be fixed automatically
This commit is contained in:
Andreas Gohr 2019-02-24 09:29:27 +01:00
parent c472ace45f
commit e24a74c008
6 changed files with 16 additions and 18 deletions

View File

@ -209,8 +209,7 @@ abstract class ChangeLog
// next chunk
if ($finger == 0) {
break;
} // already read all the lines
else {
} else { // already read all the lines
$tail = $finger;
$finger = max($tail - $this->chunk_size, 0);
}

View File

@ -122,12 +122,15 @@ class TaskRunner
for ($i = 0; $i < count($lines); $i++) {
$log = parseChangelogLine($lines[$i]);
if ($log === false) {
continue;
} // discard junk
continue; // discard junk
}
if ($log['date'] < $trim_time) {
$old_lines[$log['date'] . ".$i"] = $lines[$i]; // keep old lines for now (append .$i to prevent key collisions)
// keep old lines for now (append .$i to prevent key collisions)
$old_lines[$log['date'] . ".$i"] = $lines[$i];
} else {
$out_lines[$log['date'] . ".$i"] = $lines[$i]; // definitely keep these lines
// definitely keep these lines
$out_lines[$log['date'] . ".$i"] = $lines[$i];
}
}

View File

@ -158,7 +158,7 @@ class Admin extends Ui {
* @param array $b
* @return int
*/
protected function menuSort ($a, $b) {
protected function menuSort($a, $b) {
$strcmp = strcasecmp($a['prompt'], $b['prompt']);
if($strcmp != 0) return $strcmp;
if($a['sort'] === $b['sort']) return 0;

View File

@ -5,6 +5,7 @@
*
* All DokuWiki commandline scripts should inherit from this class and implement the abstract methods.
*
* @deprecated 2017-11-10
* @author Andreas Gohr <andi@splitbrain.org>
*/
abstract class DokuCLI {

View File

@ -322,7 +322,7 @@ if(!function_exists('utf8_rtrim')){
* @param string $charlist
* @return string
*/
function utf8_rtrim($str,$charlist=''){
function utf8_rtrim($str,$charlist=''){
if($charlist == '') return rtrim($str);
//quote charlist for use in a characterclass
@ -343,7 +343,7 @@ if(!function_exists('utf8_trim')){
* @param string $charlist
* @return string
*/
function utf8_trim($str,$charlist='') {
function utf8_trim($str,$charlist='') {
if($charlist == '') return trim($str);
return utf8_ltrim(utf8_rtrim($str,$charlist),$charlist);
@ -571,7 +571,7 @@ if(!function_exists('utf8_tohtml')){
* @param string $str
* @return string
*/
function utf8_tohtml ($str) {
function utf8_tohtml($str) {
$ret = '';
foreach (utf8_to_unicode($str) as $cp) {
if ($cp < 0x80)

View File

@ -464,18 +464,13 @@ class DokuCssFile {
*/
public function replacements($match) {
// not a relative url? - no adjustment required
if (preg_match('#^(/|data:|https?://)#',$match[3])) {
if (preg_match('#^(/|data:|https?://)#', $match[3])) { // not a relative url? - no adjustment required
return $match[0];
}
// a less file import? - requires a file system location
else if (substr($match[3],-5) == '.less') {
} elseif (substr($match[3], -5) == '.less') { // a less file import? - requires a file system location
if ($match[3]{0} != '/') {
$match[3] = $this->getRelativePath() . '/' . $match[3];
}
}
// everything else requires a url adjustment
else {
} else { // everything else requires a url adjustment
$match[3] = $this->location . $match[3];
}