diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-05-31 17:50:11 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-05-31 17:50:11 +0100 |
| commit | 102a585e51388accc5b8a66309b7b5298ded9163 (patch) | |
| tree | a999a402a2b8572aa6c6483e564244c859b6f2d3 /app | |
| parent | 03a3fe082230f19d0503571ae2c85eb3875dff6d (diff) | |
| download | webtrees-102a585e51388accc5b8a66309b7b5298ded9163.tar.gz webtrees-102a585e51388accc5b8a66309b7b5298ded9163.tar.bz2 webtrees-102a585e51388accc5b8a66309b7b5298ded9163.zip | |
Cleanup - avoid and/or operators
Diffstat (limited to 'app')
| -rw-r--r-- | app/Report/ReportBase.php | 22 | ||||
| -rw-r--r-- | app/Report/ReportHtmlFootnote.php | 2 | ||||
| -rw-r--r-- | app/Report/ReportHtmlText.php | 2 | ||||
| -rw-r--r-- | app/Report/ReportPdfFootnote.php | 4 | ||||
| -rw-r--r-- | app/Report/ReportPdfText.php | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/app/Report/ReportBase.php b/app/Report/ReportBase.php index ab8c3a508b..71fb78df33 100644 --- a/app/Report/ReportBase.php +++ b/app/Report/ReportBase.php @@ -1649,16 +1649,16 @@ function factsEndHandler() { $i = 0; while ($i < $count) { $gedrec = $repeats[$i]; - $fact = ""; - $desc = ""; - if (preg_match("/1 (\w+)(.*)/", $gedrec, $match)) { + $fact = ''; + $desc = ''; + if (preg_match('/1 (\w+)(.*)/', $gedrec, $match)) { $fact = $match[1]; - if ($fact == "EVEN" or $fact == "FACT") { + if ($fact === 'EVEN' || $fact === 'FACT') { $tmatch = array(); - if (preg_match("/2 TYPE (.+)/", $gedrec, $tmatch)) { + if (preg_match('/2 TYPE (.+)/', $gedrec, $tmatch)) { $type = trim($tmatch[1]); } else { - $type = " "; + $type = ' '; } } $desc = trim($match[2]); @@ -2059,7 +2059,7 @@ function highlightedImageStartHandler($attrs) { ) ) && $mediaobject->canShow() && $mediaobject->fileExists('thumb') ) { - if (($width > 0) and ($height == 0)) { + if ($width > 0 && $height == 0) { $perc = $width / $attributes['adjW']; $height = round($attributes['adjH'] * $perc); } elseif ($height > 0 && $width == 0) { @@ -2157,7 +2157,7 @@ function imageStartHandler($attrs) { ) ) && $mediaobject->canShow() && $mediaobject->fileExists('thumb') ) { - if (($width > 0) and ($height == 0)) { + if ($width > 0 && $height == 0) { $perc = $width / $attributes['adjW']; $height = round($attributes['adjH'] * $perc); } elseif ($height > 0 && $width == 0) { @@ -2174,7 +2174,7 @@ function imageStartHandler($attrs) { } else { if (file_exists($file) && preg_match("/(jpg|jpeg|png|gif)$/i", $file)) { $size = getimagesize($file); - if (($width > 0) and ($height == 0)) { + if ($width > 0 && $height == 0) { $perc = $width / $size[0]; $height = round($size[1] * $perc); } elseif ($height > 0 && $width == 0) { @@ -2319,7 +2319,7 @@ function listStartHandler($attrs) { unset($attrs[$attr]); // This filter has been fully processed } elseif (preg_match('/^NAME CONTAINS (.*)$/', $value, $match)) { // Do nothing, unless you have to - if (($match[1] != "") or ($sortby == "NAME")) { + if ($match[1] != '' || $sortby == 'NAME') { $sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)"; // Search the DB only if there is any name supplied if ($match[1] != "") { @@ -2457,7 +2457,7 @@ function listStartHandler($attrs) { $filters = array(); $filters2 = array(); - if ((isset($attrs['filter1'])) and (count($list) > 0)) { + if (isset($attrs['filter1']) && count($list) > 0) { foreach ($attrs as $key => $value) { if (preg_match("/filter(\d)/", $key)) { $condition = $value; diff --git a/app/Report/ReportHtmlFootnote.php b/app/Report/ReportHtmlFootnote.php index 48c729a5e6..6e960ec969 100644 --- a/app/Report/ReportHtmlFootnote.php +++ b/app/Report/ReportHtmlFootnote.php @@ -107,7 +107,7 @@ class ReportHtmlFootnote extends ReportBaseFootnote { // If there is still remaining wrap width... if ($this->wrapWidthRemaining > 0) { // Check with line counter too! - if (($lw >= $this->wrapWidthRemaining) or ($lfct > 1)) { + if ($lw >= $this->wrapWidthRemaining || $lfct > 1) { $newtext = ""; $wrapWidthRemaining = $this->wrapWidthRemaining; $lines = explode("\n", $this->numText); diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php index cdaf99075f..68e11567dd 100644 --- a/app/Report/ReportHtmlText.php +++ b/app/Report/ReportHtmlText.php @@ -113,7 +113,7 @@ class ReportHtmlText extends ReportBaseText { // If there is still remaining wrap width... if ($this->wrapWidthRemaining > 0) { // Check with line counter too! - if (($lw >= $this->wrapWidthRemaining) or ($lfct > 1)) { + if ($lw >= $this->wrapWidthRemaining || $lfct > 1) { $newtext = ""; $wrapWidthRemaining = $this->wrapWidthRemaining; $lines = explode("\n", $this->text); diff --git a/app/Report/ReportPdfFootnote.php b/app/Report/ReportPdfFootnote.php index db82ddfb28..f6cbc0a7c2 100644 --- a/app/Report/ReportPdfFootnote.php +++ b/app/Report/ReportPdfFootnote.php @@ -98,8 +98,8 @@ class ReportPdfFootnote extends ReportBaseFootnote { // Check with line counter too! // but floor the $wrapWidthRemaining first to keep it bugfree! $wrapWidthRemaining = (int) ($this->wrapWidthRemaining); - if (($lw >= $wrapWidthRemaining) or ($lfct > 1)) { - $newtext = ""; + if ($lw >= $wrapWidthRemaining || $lfct > 1) { + $newtext = ''; $lines = explode("\n", $this->numText); // Go throught the text line by line foreach ($lines as $line) { diff --git a/app/Report/ReportPdfText.php b/app/Report/ReportPdfText.php index 0e843bc08e..61897bf790 100644 --- a/app/Report/ReportPdfText.php +++ b/app/Report/ReportPdfText.php @@ -102,7 +102,7 @@ class ReportPdfText extends ReportBaseText { // Check with line counter too! // but floor the $wrapWidthRemaining first to keep it bugfree! $wrapWidthRemaining = (int) ($this->wrapWidthRemaining); - if (($lw >= ($wrapWidthRemaining)) or ($lfct > 1)) { + if ($lw >= $wrapWidthRemaining || $lfct > 1) { $newtext = ""; $lines = explode("\n", $this->text); // Go throught the text line by line |
