Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addProceduralOccurrence example
$this
->
assertArrayHasKey
(
'MyOtherAction::__invoke',
$countsByCaller
)
;
$this
->
assertSame
(
2,
$countsByCaller
[
'MyAction::__invoke'
]
)
;
$this
->
assertSame
(
1,
$countsByCaller
[
'MyOtherAction::__invoke'
]
)
;
}
public
function
testItCountsBothTypesOfOccurrences
(
)
{
$notice
=
new
DeprecationNotice
(
)
;
$notice
->
addObjectOccurrence
(
'MyAction', '__invoke'
)
;
$this
->
assertSame
(
1,
$notice
->
count
(
)
)
;
$notice
->
addProceduralOccurrence
(
)
;
$this
->
assertSame
(
2,
$notice
->
count
(
)
)
;
}
}
public
function
addNoticeFromObject
(
$message
,
$class
,
$method
)
{
$this
->
deprecationNotice
(
$message
)
->
addObjectOccurrence
(
$class
,
$method
)
;
$this
->
addNotice
(
)
;
}
/** * @param string $message */
public
function
addNoticeFromProceduralCode
(
$message
)
{
$this
->
deprecationNotice
(
$message
)
->
addProceduralOccurrence
(
)
;
$this
->
addNotice
(
)
;
}
public
function
addNotice
(
)
{
++
$this
->count;
}
/** * @param string $message */