55 $status =
Status::newGood();
57 $requiredButMissing = [];
59 $installed = $this->composerLock->getInstalledDependencies();
60 foreach ( $this->composerJson->getRequiredDependencies() as $name => $version ) {
62 if ( !isset( $installed[$name] ) ) {
63 $requiredButMissing[] = [
65 'wantedVersion' => $version
71 if ( !SemVer::satisfies( $installed[$name][
'version'], $version ) ) {
74 'wantedVersion' => $version,
75 'suppliedVersion' => $installed[$name][
'version']
82 if ( count( $requiredButOld ) === 0 && count( $requiredButMissing ) === 0 ) {
87 foreach ( $requiredButOld as [
89 "suppliedVersion" => $suppliedVersion,
90 "wantedVersion" => $wantedVersion
92 $status->
error(
'composer-deps-outdated', $name, $suppliedVersion, $wantedVersion );
95 foreach ( $requiredButMissing as [
97 "wantedVersion" => $wantedVersion
99 $status->error(
'composer-deps-notinstalled', $name, $wantedVersion );