Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
e29c91ed
Commit
e29c91ed
authored
Jun 18, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added an exception when a method does not exist to ease debugging
parent
3fd92830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
src/Silex/Controller.php
src/Silex/Controller.php
+4
-0
src/Silex/ControllerCollection.php
src/Silex/ControllerCollection.php
+4
-0
No files found.
src/Silex/Controller.php
View file @
e29c91ed
...
...
@@ -74,6 +74,10 @@ class Controller
public
function
__call
(
$method
,
$arguments
)
{
if
(
!
method_exists
(
$this
->
route
,
$method
))
{
throw
new
\BadMethodCallException
(
sprintf
(
'Method "%s::%s" does not exist.'
,
get_class
(
$this
->
route
),
$method
));
}
call_user_func_array
(
array
(
$this
->
route
,
$method
),
$arguments
);
return
$this
;
...
...
src/Silex/ControllerCollection.php
View file @
e29c91ed
...
...
@@ -112,6 +112,10 @@ class ControllerCollection
public
function
__call
(
$method
,
$arguments
)
{
if
(
!
method_exists
(
$this
->
defaultRoute
,
$method
))
{
throw
new
\BadMethodCallException
(
sprintf
(
'Method "%s::%s" does not exist.'
,
get_class
(
$this
->
defaultRoute
),
$method
));
}
call_user_func_array
(
array
(
$this
->
defaultRoute
,
$method
),
$arguments
);
foreach
(
$this
->
controllers
as
$controller
)
{
...
...
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