summaryrefslogtreecommitdiff
path: root/app/Report/ReportParserGenerate.php
diff options
context:
space:
mode:
authorRico Sonntag <mail@ricosonntag.de>2018-09-23 00:32:55 +0200
committerGreg Roach <fisharebest@gmail.com>2018-09-22 23:32:55 +0100
commitb2ce94c6833c25934b40a7e6bc15985d50b5f42a (patch)
tree62b41467db3d26698ff21ed862461402d2febd1d /app/Report/ReportParserGenerate.php
parenta0cead57f9defbc64fdc8dfbbfb2cf01c516be57 (diff)
downloadwebtrees-b2ce94c6833c25934b40a7e6bc15985d50b5f42a.tar.gz
webtrees-b2ce94c6833c25934b40a7e6bc15985d50b5f42a.tar.bz2
webtrees-b2ce94c6833c25934b40a7e6bc15985d50b5f42a.zip
Reduced if/else complexity, removed not require else conditions (#1866)
* Reduced if/else complexity, removed not require else conditions * Fix indentation * Fix indentation * Use null-coalesce to simplify logic * Use null-coalesce to simplify logic * Use null-coalesce to simplify logic * Use null-coalesce to simplify logic * Use null-coalesce to simplify logic * Use null-coalesce to simplify logic * Admin theme no longer exists * Code style * Use null-coalesce operator to simplify logic
Diffstat (limited to 'app/Report/ReportParserGenerate.php')
-rw-r--r--app/Report/ReportParserGenerate.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index 794375f7b0..e0710b0504 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -1996,7 +1996,7 @@ class ReportParserGenerate extends ReportParserBase
$sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file={$attr}b.pl_file AND {$attr}b.pl_p_id={$attr}a.p_id AND {$attr}b.pl_gid=f_id)";
$sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')";
$sql_params[$attr . 'place'] = $match[1];
- // Don't unset this filter. This is just initial filtering
+ // Don't unset this filter. This is just initial filtering
} elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) {
$sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')";
$sql_params[$attr . 'contains1'] = $match[1];
@@ -2860,14 +2860,14 @@ class ReportParserGenerate extends ReportParserBase
if (isset($this->vars[$matches[1]]['id'])) {
if ($quote) {
return "'" . addcslashes($this->vars[$matches[1]]['id'], "'") . "'";
- } else {
- return $this->vars[$matches[1]]['id'];
}
- } else {
- Log::addErrorLog(sprintf('Undefined variable $%s in report', $matches[1]));
- return '$' . $matches[1];
+ return $this->vars[$matches[1]]['id'];
}
+
+ Log::addErrorLog(sprintf('Undefined variable $%s in report', $matches[1]));
+
+ return '$' . $matches[1];
},
$expression
);