PackageJsonSynchronizer
in package
Synchronize package.json files detected in installed PHP packages with the current application.
Table of Contents
- $io : mixed
- $rootDir : mixed
- $scriptExecutor : mixed
- $vendorDir : mixed
- $versionParser : mixed
- __construct() : mixed
- shouldSynchronize() : bool
- synchronize() : bool
- normalizePhpPackages() : array<string|int, mixed>
- registerDependenciesInPackageJson() : bool
- removeObsoletePackageJsonLinks() : bool
- resolveImportMapPackages() : array<string|int, mixed>
- resolvePackageJson() : JsonFile|null
- resolvePackageJsonDependencies() : array<string|int, mixed>
- shouldUpdateConstraint() : mixed
- synchronizeForAssetMapper() : void
- updateControllersJsonFile() : mixed
- updateImportMap() : void
Properties
$io
private
mixed
$io
$rootDir
private
mixed
$rootDir
$scriptExecutor
private
mixed
$scriptExecutor
$vendorDir
private
mixed
$vendorDir
$versionParser
private
mixed
$versionParser
Methods
__construct()
public
__construct(string $rootDir, string $vendorDir, ScriptExecutor $scriptExecutor, IOInterface $io) : mixed
Parameters
- $rootDir : string
- $vendorDir : string
- $scriptExecutor : ScriptExecutor
- $io : IOInterface
Return values
mixed —shouldSynchronize()
public
shouldSynchronize() : bool
Return values
bool —synchronize()
public
synchronize(array<string|int, mixed> $phpPackages) : bool
Parameters
- $phpPackages : array<string|int, mixed>
Return values
bool —normalizePhpPackages()
private
normalizePhpPackages(array<string|int, mixed> $phpPackages) : array<string|int, mixed>
Parameters
- $phpPackages : array<string|int, mixed>
Return values
array<string|int, mixed> —registerDependenciesInPackageJson()
private
registerDependenciesInPackageJson(array<string|int, mixed> $flexDependencies) : bool
Parameters
- $flexDependencies : array<string|int, mixed>
Return values
bool —removeObsoletePackageJsonLinks()
private
removeObsoletePackageJsonLinks() : bool
Return values
bool —resolveImportMapPackages()
private
resolveImportMapPackages(mixed $phpPackage) : array<string|int, mixed>
Parameters
- $phpPackage : mixed
Return values
array<string|int, mixed> —resolvePackageJson()
private
resolvePackageJson(array<string|int, mixed> $phpPackage) : JsonFile|null
Parameters
- $phpPackage : array<string|int, mixed>
Return values
JsonFile|null —resolvePackageJsonDependencies()
private
resolvePackageJsonDependencies(mixed $phpPackage) : array<string|int, mixed>
Parameters
- $phpPackage : mixed
Return values
array<string|int, mixed> —shouldUpdateConstraint()
private
shouldUpdateConstraint(string $existingConstraint, string $constraint) : mixed
Parameters
- $existingConstraint : string
- $constraint : string
Return values
mixed —synchronizeForAssetMapper()
private
synchronizeForAssetMapper(array<string|int, mixed> $phpPackages) : void
Parameters
- $phpPackages : array<string|int, mixed>
Return values
void —updateControllersJsonFile()
private
updateControllersJsonFile(array<string|int, mixed> $phpPackages) : mixed
Parameters
- $phpPackages : array<string|int, mixed>
Return values
mixed —updateImportMap()
private
updateImportMap(array<string, array{path?: string, package?: string, version?: string}> $importMapEntries) : void
Parameters
- $importMapEntries : array<string, array{path?: string, package?: string, version?: string}>