You are a developer and looking for Shopware projects?
Apply Now!
isManagedByComposer example
public
function
deleteApp
(
string
$technicalName
)
: void
{
$apps
=
$this
->
load
(
)
;
if
(
!
isset
(
$apps
[
$technicalName
]
)
)
{
return
;
}
$manifest
=
$apps
[
$technicalName
]
;
if
(
$manifest
->
isManagedByComposer
(
)
)
{
throw
AppException::
cannotDeleteManaged
(
$technicalName
)
;
}
(
new
Filesystem
(
)
)
->
remove
(
$manifest
->
getPath
(
)
)
;
}
public
function
loadFile
(
string
$appPath
, string
$filePath
)
: ?string
{
$path
= Path::
join
(
$appPath
,
$filePath
)
;
if
(
$path
[
0
]
!== \DIRECTORY_SEPARATOR
)
{
__DIR__,
__DIR__,
new
ConfigReader
(
)
)
;
$apps
=
$appLoader
->
load
(
)
;
static
::
assertCount
(
1,
$apps
)
;
static
::
assertArrayHasKey
(
'test',
$apps
)
;
$app
=
$apps
[
'test'
]
;
static
::
assertTrue
(
$app
->
isManagedByComposer
(
)
)
;
static
::
assertEquals
(
'test',
$app
->
getMetadata
(
)
->
getName
(
)
)
;
static
::
assertEquals
(
'1.0.0',
$app
->
getMetadata
(
)
->
getVersion
(
)
)
;
static
::
expectException
(
AppException::
class
)
;
$appLoader
->
deleteApp
(
'test'
)
;
}
public
function
testGetFlowActions
(
)
: void
{
$appLoader
=
new
AppLoader
(