Skip to content

Commit e3d2f58

Browse files
committed
Package: rename origin from proxy to mirror
1 parent 864aa38 commit e3d2f58

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/Api/Packages.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,34 @@
77
class Packages extends AbstractApi
88
{
99
/**
10-
* Packages that are mirrored from a public Composer repository like packagist.org.
10+
* Packages that are mirrored from a public mirrored third party repository like packagist.org.
1111
*/
12-
const ORIGIN_PUBLIC_PROXY = 'public-proxy';
12+
const ORIGIN_PUBLIC_MIRROR = 'public-mirror';
1313

1414
/**
15-
* Packages that are mirrored from a private Composer repository requiring authentication like repo.magento.com.
15+
* Packages that are mirrored from a private mirrored third party repository requiring authentication like repo.magento.com.
1616
*/
17-
const ORIGIN_PRIVATE_PROXY = 'private-proxy';
17+
const ORIGIN_PRIVATE_MIRROR = 'private-mirror';
1818

1919
/**
2020
* All other packages from a VCS repository or a custom JSON definition.
2121
*/
2222
const ORIGIN_PRIVATE = 'private';
2323

24+
/**
25+
* @deprecated Use Packages::ORIGIN_PUBLIC_MIRROR instead
26+
*/
27+
const ORIGIN_PUBLIC_PROXY = self::ORIGIN_PUBLIC_MIRROR;
28+
29+
/**
30+
* @deprecated Use Packages::ORIGIN_PRIVATE_MIRROR instead
31+
*/
32+
const ORIGIN_PRIVATE_PROXY = self::ORIGIN_PRIVATE_MIRROR;
33+
34+
2435
public function all(array $filters = [])
2536
{
26-
$availableOrigins = [self::ORIGIN_PUBLIC_PROXY, self::ORIGIN_PRIVATE_PROXY, self::ORIGIN_PRIVATE];
37+
$availableOrigins = [self::ORIGIN_PUBLIC_MIRROR, self::ORIGIN_PRIVATE_MIRROR, self::ORIGIN_PRIVATE, 'public-proxy', 'private-proxy'];
2738
if (isset($filters['origin']) && !in_array($filters['origin'], $availableOrigins, true)) {
2839
throw new InvalidArgumentException('Filter "origin" has to be one of: "' . implode('", "', $availableOrigins) . '".');
2940
}

0 commit comments

Comments
 (0)