-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16918 from mattwire/smartyerrorevent
Add smarty error event
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/* | ||
+--------------------------------------------------------------------+ | ||
| Copyright CiviCRM LLC. All rights reserved. | | ||
| | | ||
| This work is published under the GNU AGPLv3 license with some | | ||
| permitted exceptions and without any warranty. For full license | | ||
| and copyright information, see https://civicrm.org/licensing | | ||
+--------------------------------------------------------------------+ | ||
*/ | ||
|
||
namespace Civi\Core\Event; | ||
|
||
/** | ||
* This triggers when a smarty parse error happens via \Smarty::trigger_error | ||
* Event: civi.smarty.error | ||
* | ||
* Class SmartyErrorEvent | ||
* @package Civi\API\Event | ||
*/ | ||
class SmartyErrorEvent extends \Symfony\Component\EventDispatcher\Event { | ||
|
||
/** | ||
* The error message generated by smarty | ||
* @var string | ||
*/ | ||
public $errorMsg; | ||
|
||
/** | ||
* The error type - one of PHP error constants | ||
* @var int | ||
*/ | ||
public $errorType; | ||
|
||
/** | ||
* @param string $errorMsg | ||
* @param int $errorType | ||
*/ | ||
public function __construct($errorMsg, $errorType) { | ||
$this->errorMsg = $errorMsg; | ||
$this->errorType = $errorType; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getHookValues() { | ||
return [$this->errorMsg, $this->errorType]; | ||
} | ||
|
||
} |