Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
cacec94b
Commit
cacec94b
authored
Jul 30, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixes {foo()->Bar}
git-svn-id:
svn://dwoo.org/dwoo/trunk@135
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
2d656f46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Compiler.php
lib/Dwoo/Compiler.php
+1
-1
CompilerTests.php
tests/CompilerTests.php
+5
-3
No files found.
lib/Dwoo/Compiler.php
View file @
cacec94b
...
@@ -1192,7 +1192,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
...
@@ -1192,7 +1192,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
}
}
}
if
(
isset
(
$parsed
)
&&
$parsed
===
'func'
&&
preg_match
(
'#^->[a-z0-9_]+(\s*\(.+)?#s'
,
$substr
,
$match
))
{
if
(
isset
(
$parsed
)
&&
$parsed
===
'func'
&&
preg_match
(
'#^->[a-z0-9_]+(\s*\(.+)?#
i
s'
,
$substr
,
$match
))
{
$ptr
=
0
;
$ptr
=
0
;
if
(
is_array
(
$parsingParams
))
{
if
(
is_array
(
$parsingParams
))
{
...
...
tests/CompilerTests.php
View file @
cacec94b
...
@@ -538,12 +538,12 @@ replace="BAR"
...
@@ -538,12 +538,12 @@ replace="BAR"
public
function
testFunctionCallsChaining
()
public
function
testFunctionCallsChaining
()
{
{
$tpl
=
new
Dwoo_Template_String
(
'{getobj()->foo()->
bar("hoy")
}'
);
$tpl
=
new
Dwoo_Template_String
(
'{getobj()->foo()->
Bar("hoy") getobj()->moo
}'
);
$tpl
->
forceCompilation
();
$tpl
->
forceCompilation
();
$dwoo
=
new
Dwoo
();
$dwoo
=
new
Dwoo
();
$dwoo
->
addPlugin
(
'getobj'
,
array
(
new
PluginHelper
(),
'call'
));
$dwoo
->
addPlugin
(
'getobj'
,
array
(
new
PluginHelper
(),
'call'
));
$this
->
assertEquals
(
'HOY'
,
$dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
$this
->
assertEquals
(
'HOY
yay
'
,
$dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
}
}
public
function
testPluginProxy
()
public
function
testPluginProxy
()
...
@@ -583,6 +583,8 @@ class ProxyHelper implements Dwoo_IPluginProxy
...
@@ -583,6 +583,8 @@ class ProxyHelper implements Dwoo_IPluginProxy
class
PluginHelper
class
PluginHelper
{
{
public
$moo
=
"yay"
;
public
function
callWithDwoo
(
Dwoo
$dwoo
)
public
function
callWithDwoo
(
Dwoo
$dwoo
)
{
{
return
$this
;
return
$this
;
...
@@ -598,7 +600,7 @@ class PluginHelper
...
@@ -598,7 +600,7 @@ class PluginHelper
return
$this
;
return
$this
;
}
}
public
function
b
ar
(
$a
)
public
function
B
ar
(
$a
)
{
{
return
strtoupper
(
$a
);
return
strtoupper
(
$a
);
}
}
...
...
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