Skip to content

Commit 11f6300

Browse files
authored
Package: rename origin from proxy to mirror (#22)
Package: rename origin from proxy to mirror
2 parents 639f395 + e3d2f58 commit 11f6300

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
@@ -14,23 +14,34 @@
1414
class Packages extends AbstractApi
1515
{
1616
/**
17-
* Packages that are mirrored from a public Composer repository like packagist.org.
17+
* Packages that are mirrored from a public mirrored third party repository like packagist.org.
1818
*/
19-
const ORIGIN_PUBLIC_PROXY = 'public-proxy';
19+
const ORIGIN_PUBLIC_MIRROR = 'public-mirror';
2020

2121
/**
22-
* Packages that are mirrored from a private Composer repository requiring authentication like repo.magento.com.
22+
* Packages that are mirrored from a private mirrored third party repository requiring authentication like repo.magento.com.
2323
*/
24-
const ORIGIN_PRIVATE_PROXY = 'private-proxy';
24+
const ORIGIN_PRIVATE_MIRROR = 'private-mirror';
2525

2626
/**
2727
* All other packages from a VCS repository or a custom JSON definition.
2828
*/
2929
const ORIGIN_PRIVATE = 'private';
3030

31+
/**
32+
* @deprecated Use Packages::ORIGIN_PUBLIC_MIRROR instead
33+
*/
34+
const ORIGIN_PUBLIC_PROXY = self::ORIGIN_PUBLIC_MIRROR;
35+
36+
/**
37+
* @deprecated Use Packages::ORIGIN_PRIVATE_MIRROR instead
38+
*/
39+
const ORIGIN_PRIVATE_PROXY = self::ORIGIN_PRIVATE_MIRROR;
40+
41+
3142
public function all(array $filters = [])
3243
{
33-
$availableOrigins = [self::ORIGIN_PUBLIC_PROXY, self::ORIGIN_PRIVATE_PROXY, self::ORIGIN_PRIVATE];
44+
$availableOrigins = [self::ORIGIN_PUBLIC_MIRROR, self::ORIGIN_PRIVATE_MIRROR, self::ORIGIN_PRIVATE, 'public-proxy', 'private-proxy'];
3445
if (isset($filters['origin']) && !in_array($filters['origin'], $availableOrigins, true)) {
3546
throw new InvalidArgumentException('Filter "origin" has to be one of: "' . implode('", "', $availableOrigins) . '".');
3647
}

0 commit comments

Comments
 (0)