From: Eileen McNaughton Date: Mon, 20 Mar 2023 01:29:33 +0000 (+1300) Subject: [PHP8.2] Declare outputHandler property X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2a67c2028b4c3e9eb1e5fe0c24c5fb634c0d893a;p=civicrm-core.git [PHP8.2] Declare outputHandler property I did a universe search to check private is OK --- diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 13bcd610e0..e516a90f93 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -9,6 +9,8 @@ +--------------------------------------------------------------------+ */ +use Civi\Report\OutputHandlerFactory; + /** * Class CRM_Report_Form */ @@ -550,6 +552,11 @@ class CRM_Report_Form extends CRM_Core_Form { */ protected $_charts = []; + /** + * @var \Civi\Report\OutputHandlerInterface + */ + private $outputHandler; + /** * Get the number of rows to show * @return int @@ -6065,8 +6072,8 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * If there is no suitable output handler, e.g. if outputMode is "copy", * then this sets it to NULL. */ - public function setOutputHandler() { - $this->outputHandler = \Civi\Report\OutputHandlerFactory::singleton()->create($this); + public function setOutputHandler(): void { + $this->outputHandler = OutputHandlerFactory::singleton()->create($this); } /** @@ -6105,10 +6112,10 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a // since it shouldn't have any outputMode-related `if` statements in it. // Someday could remove the param from the function call. if (CRM_Report_Utils_Report::mailReport($mailBody, $this->_id, $this->_outputMode, $attachments)) { - CRM_Core_Session::setStatus(ts("Report mail has been sent."), ts('Sent'), 'success'); + CRM_Core_Session::setStatus(ts('Report mail has been sent.'), ts('Sent'), 'success'); } else { - CRM_Core_Session::setStatus(ts("Report mail could not be sent."), ts('Mail Error'), 'error'); + CRM_Core_Session::setStatus(ts('Report mail could not be sent.'), ts('Mail Error'), 'error'); } }