Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
identifierStartsWithBackslash example
if
(
$found
)
{
$identifier
=
$className
. '::' .
$const
;
}
}
/** * Checks if identifier ends with ::class and remove the leading backslash if it exists. */
if
(
$this
->
identifierEndsWithClassConstant
(
$identifier
)
&&
!
$this
->
identifierStartsWithBackslash
(
$identifier
)
)
{
return
substr
(
$identifier
, 0,
$this
->
getClassConstantPositionInIdentifier
(
$identifier
)
)
;
}
if
(
$this
->
identifierEndsWithClassConstant
(
$identifier
)
&&
$this
->
identifierStartsWithBackslash
(
$identifier
)
)
{
return
substr
(
$identifier
, 1,
$this
->
getClassConstantPositionInIdentifier
(
$identifier
)
- 1
)
;
}
if
(
!
defined
(
$identifier
)
)
{
throw
AnnotationException::
semanticalErrorConstants
(
$identifier
,
$this
->context
)
;
}