Skip to content

Commit

Permalink
Merge pull request #16918 from mattwire/smartyerrorevent
Browse files Browse the repository at this point in the history
Add smarty error event
  • Loading branch information
seamuslee001 authored Jun 13, 2020
2 parents f50a464 + bf58f0c commit 2953cbd
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Civi/Core/Event/SmartyErrorEvent.php
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];
}

}

0 comments on commit 2953cbd

Please sign in to comment.