Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ArgumentCountError example
return
$runtime
->
getRunner
(
$application
)
;
}
if
(
!\
is_callable
(
$application
)
)
{
throw
new
\
LogicException
(
sprintf
(
'"%s" doesn\'t know how to handle apps of type "%s".',
get_debug_type
(
$this
)
,
get_debug_type
(
$application
)
)
)
;
}
$application
=
$application
(
...
)
;
}
if
(
$_SERVER
[
$this
->options
[
'debug_var_name'
]
]
&&
(
$r
=
new
\
ReflectionFunction
(
$application
)
)
&&
$r
->
getNumberOfRequiredParameters
(
)
)
{
throw
new
\
ArgumentCountError
(
sprintf
(
'Zero argument should be required by the runner callable, but at least one is in "%s" on line "%d.',
$r
->
getFileName
(
)
,
$r
->
getStartLine
(
)
)
)
;
}
return
new
ClosureRunner
(
$application
)
;
}
protected
function
getArgument
(
\ReflectionParameter
$parameter
, ?string
$type
)
: mixed
{
if
(
'array' ===
$type
)
{
switch
(
$parameter
->name
)
{
case
'context':
$context
=
$_SERVER
;