1 | <?php |
||
7 | class Settings implements SettingsInterface |
||
8 | { |
||
9 | ////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
||
10 | const AUTHENTICATE_USING_TOKEN = Client::AUTH_URL_TOKEN; |
||
11 | const AUTHENTICATE_USING_PASSWORD = Client::AUTH_HTTP_PASSWORD; |
||
12 | |||
13 | const BRANCH_MASTER = 'master'; |
||
14 | const REFERENCE_HEAD = 'HEAD'; |
||
15 | |||
16 | const ERROR_INVALID_REPOSITORY_NAME = 'Given Repository name "%s" should be in the format of "vendor/project"'; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $branch; |
||
20 | /** @var array */ |
||
21 | private $credentials; |
||
22 | /** @var string */ |
||
23 | private $reference; |
||
24 | /** @var string */ |
||
25 | private $repository; |
||
26 | /** @var string */ |
||
27 | private $vendor; |
||
28 | /** @var string */ |
||
29 | private $package; |
||
30 | |||
31 | //////////////////////////// SETTERS AND GETTERS \\\\\\\\\\\\\\\\\\\\\\\\\\\ |
||
32 | /** |
||
33 | * @return string |
||
34 | */ |
||
35 | final public function getBranch() |
||
39 | |||
40 | /** |
||
41 | * @return array |
||
42 | */ |
||
43 | final public function getCredentials() |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | final public function getPackage() |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | final public function getReference() |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | final public function getRepository() |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | final public function getVendor() |
||
79 | |||
80 | //////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
||
81 | final public function __construct( |
||
96 | |||
97 | ////////////////////////////// UTILITY METHODS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
||
98 | /** |
||
99 | * @param $repository |
||
100 | */ |
||
101 | private function isValidRepositoryName($repository) |
||
113 | } |
||
114 | |||
116 |