summaryrefslogtreecommitdiff
path: root/app/Report
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-05-06 15:49:59 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-05-06 15:49:59 +0100
commitb702978e3477158e6b6a638088c850e99bfb8cb0 (patch)
treedd295de9a1d9fc89f2049fd0e131d9df070aa4e6 /app/Report
parent2fee1a88a465136fd255fdc13a081ad7e91b847e (diff)
downloadwebtrees-b702978e3477158e6b6a638088c850e99bfb8cb0.tar.gz
webtrees-b702978e3477158e6b6a638088c850e99bfb8cb0.tar.bz2
webtrees-b702978e3477158e6b6a638088c850e99bfb8cb0.zip
Make report generator callbacks protected to permit reuse
Diffstat (limited to 'app/Report')
-rw-r--r--app/Report/ReportParserGenerate.php104
1 files changed, 52 insertions, 52 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index 0f779cbe90..ebf85de77d 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -232,7 +232,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function styleStartHandler(array $attrs): void
+ protected function styleStartHandler(array $attrs): void
{
if (empty($attrs['name'])) {
throw new DomainException('REPORT ERROR Style: The "name" of the style is missing or not set in the XML file.');
@@ -273,7 +273,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function docStartHandler(array $attrs): void
+ protected function docStartHandler(array $attrs): void
{
$this->parser = $this->xml_parser;
@@ -365,7 +365,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function docEndHandler(): void
+ protected function docEndHandler(): void
{
$this->wt_report->run();
}
@@ -375,7 +375,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function headerStartHandler(): void
+ protected function headerStartHandler(): void
{
// Clear the Header before any new elements are added
$this->wt_report->clearHeader();
@@ -387,7 +387,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function pageHeaderStartHandler(): void
+ protected function pageHeaderStartHandler(): void
{
$this->print_data_stack[] = $this->print_data;
$this->print_data = false;
@@ -400,7 +400,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function pageHeaderEndHandler(): void
+ protected function pageHeaderEndHandler(): void
{
$this->print_data = array_pop($this->print_data_stack);
$this->current_element = $this->wt_report;
@@ -413,7 +413,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function bodyStartHandler(): void
+ protected function bodyStartHandler(): void
{
$this->wt_report->setProcessing('B');
}
@@ -423,7 +423,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function footerStartHandler(): void
+ protected function footerStartHandler(): void
{
$this->wt_report->setProcessing('F');
}
@@ -435,7 +435,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function cellStartHandler(array $attrs): void
+ protected function cellStartHandler(array $attrs): void
{
// string The text alignment of the text in this box.
$align = '';
@@ -592,7 +592,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function cellEndHandler(): void
+ protected function cellEndHandler(): void
{
$this->print_data = array_pop($this->print_data_stack);
$this->wt_report->addElement($this->current_element);
@@ -603,7 +603,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function nowStartHandler(): void
+ protected function nowStartHandler(): void
{
$this->current_element->addText(Carbon::now()->local()->isoFormat('LLLL'));
}
@@ -613,7 +613,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function pageNumStartHandler(): void
+ protected function pageNumStartHandler(): void
{
$this->current_element->addText('#PAGENUM#');
}
@@ -623,7 +623,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function totalPagesStartHandler(): void
+ protected function totalPagesStartHandler(): void
{
$this->current_element->addText('{{:ptp:}}');
}
@@ -635,7 +635,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function gedcomStartHandler(array $attrs): void
+ protected function gedcomStartHandler(array $attrs): void
{
if ($this->process_gedcoms > 0) {
$this->process_gedcoms++;
@@ -699,7 +699,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function gedcomEndHandler(): void
+ protected function gedcomEndHandler(): void
{
if ($this->process_gedcoms > 0) {
$this->process_gedcoms--;
@@ -715,7 +715,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function textBoxStartHandler(array $attrs): void
+ protected function textBoxStartHandler(array $attrs): void
{
// string Background color code
$bgcolor = '';
@@ -841,7 +841,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function textBoxEndHandler(): void
+ protected function textBoxEndHandler(): void
{
$this->print_data = array_pop($this->print_data_stack);
$this->current_element = $this->wt_report;
@@ -856,7 +856,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function textStartHandler(array $attrs): void
+ protected function textStartHandler(array $attrs): void
{
$this->print_data_stack[] = $this->print_data;
$this->print_data = true;
@@ -881,7 +881,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function textEndHandler(): void
+ protected function textEndHandler(): void
{
$this->print_data = array_pop($this->print_data_stack);
$this->wt_report->addElement($this->current_element);
@@ -897,7 +897,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function getPersonNameStartHandler(array $attrs): void
+ protected function getPersonNameStartHandler(array $attrs): void
{
$id = '';
$match = [];
@@ -978,7 +978,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function gedcomValueStartHandler(array $attrs): void
+ protected function gedcomValueStartHandler(array $attrs): void
{
$id = '';
$match = [];
@@ -1058,7 +1058,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function repeatTagStartHandler(array $attrs): void
+ protected function repeatTagStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
@@ -1128,7 +1128,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function repeatTagEndHandler(): void
+ protected function repeatTagEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
@@ -1222,7 +1222,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function varStartHandler(array $attrs): void
+ protected function varStartHandler(array $attrs): void
{
if (empty($attrs['var'])) {
throw new DomainException('REPORT ERROR var: The attribute "var=" is missing or not set in the XML file on line: ' . xml_get_current_line_number($this->parser));
@@ -1272,7 +1272,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function factsStartHandler(array $attrs): void
+ protected function factsStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
@@ -1320,7 +1320,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function factsEndHandler(): void
+ protected function factsEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
@@ -1419,7 +1419,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function setVarStartHandler(array $attrs): void
+ protected function setVarStartHandler(array $attrs): void
{
if (empty($attrs['name'])) {
throw new DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
@@ -1486,7 +1486,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function ifStartHandler(array $attrs): void
+ protected function ifStartHandler(array $attrs): void
{
if ($this->process_ifs > 0) {
$this->process_ifs++;
@@ -1556,7 +1556,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function ifEndHandler(): void
+ protected function ifEndHandler(): void
{
if ($this->process_ifs > 0) {
$this->process_ifs--;
@@ -1572,7 +1572,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function footnoteStartHandler(array $attrs): void
+ protected function footnoteStartHandler(array $attrs): void
{
$id = '';
if (preg_match('/[0-9] (.+) @(.+)@/', $this->gedrec, $match)) {
@@ -1600,7 +1600,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function footnoteEndHandler(): void
+ protected function footnoteEndHandler(): void
{
if ($this->process_footnote) {
$this->print_data = array_pop($this->print_data_stack);
@@ -1619,7 +1619,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function footnoteTextsStartHandler(): void
+ protected function footnoteTextsStartHandler(): void
{
$temp = 'footnotetexts';
$this->wt_report->addElement($temp);
@@ -1630,7 +1630,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function brStartHandler(): void
+ protected function brStartHandler(): void
{
if ($this->print_data && $this->process_gedcoms === 0) {
$this->current_element->addText('<br>');
@@ -1642,7 +1642,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function spStartHandler(): void
+ protected function spStartHandler(): void
{
if ($this->print_data && $this->process_gedcoms === 0) {
$this->current_element->addText(' ');
@@ -1656,7 +1656,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function highlightedImageStartHandler(array $attrs): void
+ protected function highlightedImageStartHandler(array $attrs): void
{
$id = '';
if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
@@ -1709,7 +1709,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function imageStartHandler(array $attrs): void
+ protected function imageStartHandler(array $attrs): void
{
// Position the top corner of this box on the page. the default is the current position
$top = (float) ($attrs['top'] ?? ReportBaseElement::CURRENT_POSITION);
@@ -1780,7 +1780,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function lineStartHandler(array $attrs): void
+ protected function lineStartHandler(array $attrs): void
{
// Start horizontal position, current position (default)
$x1 = ReportBaseElement::CURRENT_POSITION;
@@ -1838,7 +1838,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function listStartHandler(array $attrs): void
+ protected function listStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
@@ -2241,7 +2241,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function listEndHandler(): void
+ protected function listEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
@@ -2336,7 +2336,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function listTotalStartHandler(): void
+ protected function listTotalStartHandler(): void
{
if ($this->list_private == 0) {
$this->current_element->addText((string) $this->list_total);
@@ -2352,7 +2352,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function relativesStartHandler(array $attrs): void
+ protected function relativesStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
@@ -2472,7 +2472,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function relativesEndHandler(): void
+ protected function relativesEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
@@ -2562,7 +2562,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function generationStartHandler(): void
+ protected function generationStartHandler(): void
{
$this->current_element->addText((string) $this->generation);
}
@@ -2573,7 +2573,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function newPageStartHandler(): void
+ protected function newPageStartHandler(): void
{
$temp = 'addpage';
$this->wt_report->addElement($temp);
@@ -2587,7 +2587,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function htmlStartHandler(string $tag, array $attrs): void
+ protected function htmlStartHandler(string $tag, array $attrs): void
{
if ($tag === 'tempdoc') {
return;
@@ -2607,7 +2607,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function htmlEndHandler($tag): void
+ protected function htmlEndHandler($tag): void
{
if ($tag === 'tempdoc') {
return;
@@ -2628,7 +2628,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function inputStartHandler(): void
+ protected function inputStartHandler(): void
{
// Dummy function, to prevent the default HtmlStartHandler() being called
}
@@ -2638,7 +2638,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function inputEndHandler(): void
+ protected function inputEndHandler(): void
{
// Dummy function, to prevent the default HtmlEndHandler() being called
}
@@ -2648,7 +2648,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function reportStartHandler(): void
+ protected function reportStartHandler(): void
{
// Dummy function, to prevent the default HtmlStartHandler() being called
}
@@ -2658,7 +2658,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function reportEndHandler(): void
+ protected function reportEndHandler(): void
{
// Dummy function, to prevent the default HtmlEndHandler() being called
}
@@ -2668,7 +2668,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function titleEndHandler(): void
+ protected function titleEndHandler(): void
{
$this->report_root->addTitle($this->text);
}
@@ -2678,7 +2678,7 @@ class ReportParserGenerate extends ReportParserBase
*
* @return void
*/
- private function descriptionEndHandler(): void
+ protected function descriptionEndHandler(): void
{
$this->report_root->addDescription($this->text);
}