Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isClassMapAuthoritative example
'autoload' =>
[
'psr-4' =>
[
'ExampleBundle\\' => '',
]
,
]
,
]
,
]
)
;
$fakeLoader
->
initializePlugins
(
__DIR__
)
;
static
::
assertFalse
(
$classLoader
->
isClassMapAuthoritative
(
)
)
;
}
/** * @dataProvider classLoaderDataProvider */
public
function
testWithComposerManaged
(
bool
$enabled
)
: void
{
$classLoader
=
new
ClassLoader
(
)
;
$classLoader
->
setClassMapAuthoritative
(
$enabled
)
;
$fakeLoader
=
new
StaticKernelPluginLoader
(
throw
new
KernelPluginLoaderException
(
$pluginName
,
$reason
)
;
}
foreach
(
$psr4
as
$namespace
=>
$paths
)
{
if
(
\
is_string
(
$paths
)
)
{
$paths
=
[
$paths
]
;
}
$mappedPaths
=
$this
->
mapPsrPaths
(
$pluginName
,
$paths
,
$projectDir
,
$plugin
[
'path'
]
)
;
$this
->classLoader->
addPsr4
(
$namespace
,
$mappedPaths
)
;
if
(
$this
->classLoader->
isClassMapAuthoritative
(
)
)
{
$this
->classLoader->
setClassMapAuthoritative
(
false
)
;
}
}
foreach
(
$psr0
as
$namespace
=>
$paths
)
{
if
(
\
is_string
(
$paths
)
)
{
$paths
=
[
$paths
]
;
}
$mappedPaths
=
$this
->
mapPsrPaths
(
$pluginName
,
$paths
,
$projectDir
,
$plugin
[
'path'
]
)
;
$this
->classLoader->
add
(
$namespace
,
$mappedPaths
)
;