-
Notifications
You must be signed in to change notification settings - Fork 106
/
PhamlpException.php
31 lines (29 loc) · 956 Bytes
/
PhamlpException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/* SVN FILE: $Id: HamlException.php 61 2010-04-16 10:19:59Z chris.l.yates $ */
/**
* Phamlp exception.
* @author Chris Yates <[email protected]>
* @copyright Copyright (c) 2010 PBM Web Development
* @license http://phamlp.googlecode.com/files/license.txt
* @package PHamlP
*/
require_once('Phamlp.php');
/**
* Phamlp exception class.
* Base class for PHamlP::Haml and PHamlP::Sass exceptions.
* Translates exception messages.
* @package PHamlP
*/
class PhamlpException extends Exception {
/**
* Phamlp Exception.
* @param string Category (haml|sass)
* @param string Exception message
* @param array parameters to be applied to the message using <code>strtr</code>.
*/
public function __construct($category, $message, $params, $object) {
parent::__construct(Phamlp::t($category, $message, $params) .
(is_object($object) ? ": {$object->filename}::{$object->line}\nSource: {$object->source}" : '')
);
}
}