Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Merge requests
!192
Issue
#3261847
: Add helpful methods to compute the difference between two ComposerUtility objects
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3261847
: Add helpful methods to compute the difference between two ComposerUtility objects
issue/automatic_updates-3261847:3261847-add-helpful-methods
into
8.x-2.x
Overview
11
Commits
10
Pipelines
0
Changes
8
All threads resolved!
Hide all comments
Merged
Adam G-H
requested to merge
issue/automatic_updates-3261847:3261847-add-helpful-methods
into
8.x-2.x
3 years ago
Overview
11
Commits
10
Pipelines
0
Changes
3
All threads resolved!
Hide all comments
Expand
0
0
Merge request reports
Compare
version 5
version 10
8e7ef208
3 years ago
version 9
e66f2e31
3 years ago
version 8
9b35badb
3 years ago
version 7
fe7d859d
3 years ago
version 6
75b35749
3 years ago
version 5
2932df09
3 years ago
version 4
661489f2
3 years ago
version 3
6ae4ea2d
3 years ago
version 2
fb5e9a30
3 years ago
version 1
8fc2b374
3 years ago
8.x-2.x (base)
and
version 7
latest version
8e7ef208
10 commits,
3 years ago
version 10
8e7ef208
10 commits,
3 years ago
version 9
e66f2e31
9 commits,
3 years ago
version 8
9b35badb
8 commits,
3 years ago
version 7
fe7d859d
7 commits,
3 years ago
version 6
75b35749
6 commits,
3 years ago
version 5
2932df09
5 commits,
3 years ago
version 4
661489f2
4 commits,
3 years ago
version 3
6ae4ea2d
3 commits,
3 years ago
version 2
fb5e9a30
2 commits,
3 years ago
version 1
8fc2b374
1 commit,
3 years ago
Show latest version
3 files
+
29
−
44
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
package_manager/src/ComposerUtility.php
+
14
−
28
Options
@@ -155,48 +155,34 @@ class ComposerUtility {
}
/**
* Returns the packages
added in another directory
.
* Returns the packages
that are in the current project, but not in another
.
*
* @param self $th
at
* @param self $
o
th
er
* A Composer utility wrapper around a different directory.
*
* @return \Composer\Package\PackageInterface[]
* The packages that were added in the other directory, keyed by name.
* The packages which are installed in the current project, but not in the
* other one, keyed by name.
*/
public
function
getPackagesAddedBy
(
self
$that
):
array
{
// Return the packages that are there, but not here.
return
array_diff_key
(
$that
->
getInstalledPackages
(),
$this
->
getInstalledPackages
());
public
function
getPackagesNotIn
(
self
$other
):
array
{
return
array_diff_key
(
$this
->
getInstalledPackages
(),
$other
->
getInstalledPackages
());
}
/**
* Returns the packages
that were removed
in another
directory
.
* Returns the packages
which have a different version
in another
project
.
*
* @param self $that
* A Composer utility wrapper around a different directory.
*
* @return \Composer\Package\PackageInterface[]
* The packages that were removed in the other directory, keyed by name.
*/
public
function
getPackagesRemovedBy
(
self
$that
):
array
{
// Return the packages that are here, but not there.
return
array_diff_key
(
$this
->
getInstalledPackages
(),
$that
->
getInstalledPackages
());
}
/**
* Returns the packages that were updated in another directory.
*
* A package will be considered "updated" if its version in the other
* directory has changed *at all*.
* This compares the current project with another one, and returns packages
* which are present in both, but in different versions.
*
* @param self $th
at
* @param self $
o
th
er
* A Composer utility wrapper around a different directory.
*
* @return \Composer\Package\PackageInterface[]
* The packages
in the current directory that were updated in
the other
*
directory
, keyed by name.
* The packages
which are present in both the current project and
the other
*
one, but in different versions
, keyed by name.
*/
public
function
getPackages
UpdatedBy
(
self
$th
at
):
array
{
$theirs
=
$th
at
->
getInstalledPackages
();
public
function
getPackages
WithDifferentVersionsIn
(
self
$
o
th
er
):
array
{
$theirs
=
$
o
th
er
->
getInstalledPackages
();
// Only compare packages that are both here and there.
$packages
=
array_intersect_key
(
$this
->
getInstalledPackages
(),
$theirs
);
Loading