Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webbasics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
webbasics
Commits
d379120e
Commit
d379120e
authored
Oct 06, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template class now uses FormattedException instead of RuntimeException
parent
b646dfc0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
template.php
template.php
+5
-5
tests/test_template.php
tests/test_template.php
+1
-1
No files found.
template.php
View file @
d379120e
...
...
@@ -158,9 +158,9 @@ class Template extends Node {
}
if
(
!
$found
)
{
throw
new
\Runtime
Exception
(
sprintf
(
"Could not find template file
\"
%s
\"
, looked in folders:
\n
%s"
,
$filename
,
implode
(
"
\n
"
,
$look_in
)
)
throw
new
Formatted
Exception
(
"Could not find template file
\"
%s
\"
, looked in folders:
\n
%s"
,
$filename
,
implode
(
"
\n
"
,
$look_in
)
);
}
...
...
@@ -455,7 +455,7 @@ class Template extends Node {
// <nested_exp>||<nested_exp>
try
{
return
self
::
evaluateExpression
(
substr
(
$expression
,
0
,
$split_at
),
$data
,
false
);
}
catch
(
\
Runtime
Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
self
::
evaluateExpression
(
substr
(
$expression
,
$split_at
+
2
),
$data
,
false
);
}
}
...
...
@@ -505,7 +505,7 @@ class Template extends Node {
*
* @package WebBasics
*/
class
ParseError
extends
\
Runtime
Exception
{
class
ParseError
extends
\Exception
{
/**
* Constructor.
*
...
...
tests/test_template.php
View file @
d379120e
...
...
@@ -92,7 +92,7 @@ class TemplateTest extends PHPUnit_Framework_TestCase {
}
/**
* @expectedException
Runtime
Exception
* @expectedException
webbasics\Formatted
Exception
*/
function
testNonExistingTemplate
()
{
$bar
=
new
Template
(
'bar'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment