Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getSingularName example
$class
->
addMethod
(
$node
->
getName
(
)
,
$body
,
[
'PROPERTY' =>
$property
->
getName
(
)
,
'COMMENT' =>
$comment
,
'DEFAULT' =>
$node
->
hasDefaultValue
(
)
? ' = '.
var_export
(
$node
->
getDefaultValue
(
)
, true
)
: '',
]
)
;
}
private
function
handlePrototypedArrayNode
(
PrototypedArrayNode
$node
, ClassBuilder
$class
, string
$namespace
)
: void
{
$name
=
$this
->
getSingularName
(
$node
)
;
$prototype
=
$node
->
getPrototype
(
)
;
$methodName
=
$name
;
$hasNormalizationClosures
=
$this
->
hasNormalizationClosures
(
$node
)
||
$this
->
hasNormalizationClosures
(
$prototype
)
;
$nodeParameterTypes
=
$this
->
getParameterTypes
(
$node
)
;
$prototypeParameterTypes
=
$this
->
getParameterTypes
(
$prototype
)
;
if
(
!
$prototype
instanceof ArrayNode
||
(
$prototype
instanceof PrototypedArrayNode &&
$prototype
->
getPrototype
(
)
instanceof ScalarNode
)
)
{
$class
->
addUse
(
ParamConfigurator::
class
)
;
$property
=
$class
->
addProperty
(
$node
->
getName
(
)
)
;
if
(
null ===
$key
=
$node
->
getKeyAttribute
(
)
)
{
// This is an array of values; don't use singular name