From d7f0cce659038cea4833903bf0bbc78b7e0c65d7 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Thu, 20 Jan 2022 19:45:59 +0000 Subject: [PATCH] Add consistency between checkTemplateFileExists functions, resolving phpdoc issues in the process. --- CRM/Contribute/Form/ContributionBase.php | 5 +++-- CRM/Event/Form/Registration.php | 9 +++++---- CRM/Profile/Form.php | 7 +++++-- CRM/Profile/Page/Dynamic.php | 9 ++++++--- CRM/Profile/Page/Listings.php | 9 ++++++--- CRM/Profile/Page/View.php | 9 ++++++--- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 22eb615be8..87c71b7914 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -1011,9 +1011,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { /** * Check template file exists. * - * @param string $suffix + * @param string|null $suffix * - * @return null|string + * @return string|null + * Template file path, else null */ public function checkTemplateFileExists($suffix = NULL) { if ($this->_id) { diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 74526af6a4..5ffb6d8902 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -1056,13 +1056,14 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { } /** - * Check if template file exists. + * Check template file exists. * - * @param string $suffix + * @param string|null $suffix * - * @return null|string + * @return string|null + * Template file path, else null */ - public function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_eventId) { $templateName = $this->_name; if (substr($templateName, 0, 12) == 'Participant_') { diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index e8e58cb7f7..e503e72886 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -1353,9 +1353,12 @@ class CRM_Profile_Form extends CRM_Core_Form { } /** - * @param null $suffix + * Check template file exists. * - * @return null|string + * @param string|null $suffix + * + * @return string|null + * Template file path, else null */ public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index 2e05630f61..10f4037c25 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -388,11 +388,14 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { } /** - * @param string $suffix + * Check template file exists. * - * @return null|string + * @param string|null $suffix + * + * @return string|null + * Template file path, else null */ - public function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Dynamic.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index ab05516edf..0cec9a36ba 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -449,11 +449,14 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { } /** - * @param string $suffix + * Check template file exists. * - * @return null|string + * @param string|null $suffix + * + * @return string|null + * Template file path, else null */ - public function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); diff --git a/CRM/Profile/Page/View.php b/CRM/Profile/Page/View.php index 185980e8ed..90d8351496 100644 --- a/CRM/Profile/Page/View.php +++ b/CRM/Profile/Page/View.php @@ -161,11 +161,14 @@ class CRM_Profile_Page_View extends CRM_Core_Page { } /** - * @param string $suffix + * Check template file exists. * - * @return null|string + * @param string|null $suffix + * + * @return string|null + * Template file path, else null */ - public function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/View.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); -- 2.25.1