@@ -19,7 +19,7 @@ |
||
| 19 | 19 | return '&> ' . escapeshellarg($logFile); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - /** |
|
| 22 | + /** |
|
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | 25 | public function getShouldUnlockOnCompletion() { |
@@ -9,14 +9,14 @@ |
||
| 9 | 9 | * @author Lukas Homza <[email protected]> |
| 10 | 10 | */ |
| 11 | 11 | class PrivateRepository extends BuildContext { |
| 12 | - /** |
|
| 12 | + /** |
|
| 13 | 13 | * @return int |
| 14 | 14 | */ |
| 15 | 15 | public function getType() { |
| 16 | 16 | return ConfigBuilder::PRIVATE_REPOSITORY; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - /** |
|
| 19 | + /** |
|
| 20 | 20 | * @return string |
| 21 | 21 | */ |
| 22 | 22 | public function getConfigFile() { |
@@ -13,85 +13,85 @@ |
||
| 13 | 13 | * @author Lukas Homza <[email protected]> |
| 14 | 14 | */ |
| 15 | 15 | class Archive { |
| 16 | - /** |
|
| 17 | - * @var string |
|
| 18 | - * @Type("string") |
|
| 19 | - */ |
|
| 20 | - private $directory; |
|
| 16 | + /** |
|
| 17 | + * @var string |
|
| 18 | + * @Type("string") |
|
| 19 | + */ |
|
| 20 | + private $directory; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @var string |
|
| 24 | - * @Type("string") |
|
| 25 | - */ |
|
| 26 | - private $format; |
|
| 22 | + /** |
|
| 23 | + * @var string |
|
| 24 | + * @Type("string") |
|
| 25 | + */ |
|
| 26 | + private $format; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - * @Type("string") |
|
| 31 | - * @SerializedName("prefix-url") |
|
| 32 | - */ |
|
| 33 | - private $prefix_url; |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + * @Type("string") |
|
| 31 | + * @SerializedName("prefix-url") |
|
| 32 | + */ |
|
| 33 | + private $prefix_url; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var boolean |
|
| 37 | - * @Type("boolean") |
|
| 38 | - * @SerializedName("skip-dev") |
|
| 39 | - */ |
|
| 40 | - private $skip_dev = true; |
|
| 35 | + /** |
|
| 36 | + * @var boolean |
|
| 37 | + * @Type("boolean") |
|
| 38 | + * @SerializedName("skip-dev") |
|
| 39 | + */ |
|
| 40 | + private $skip_dev = true; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param string $directory |
|
| 44 | - */ |
|
| 45 | - public function setDirectory($directory) { |
|
| 46 | - $this->directory = $directory; |
|
| 47 | - } |
|
| 42 | + /** |
|
| 43 | + * @param string $directory |
|
| 44 | + */ |
|
| 45 | + public function setDirectory($directory) { |
|
| 46 | + $this->directory = $directory; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @return string |
|
| 51 | - */ |
|
| 52 | - public function getDirectory() { |
|
| 53 | - return $this->directory; |
|
| 54 | - } |
|
| 49 | + /** |
|
| 50 | + * @return string |
|
| 51 | + */ |
|
| 52 | + public function getDirectory() { |
|
| 53 | + return $this->directory; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * @param string $format |
|
| 58 | - */ |
|
| 59 | - public function setFormat($format) { |
|
| 60 | - $this->format = $format; |
|
| 61 | - } |
|
| 56 | + /** |
|
| 57 | + * @param string $format |
|
| 58 | + */ |
|
| 59 | + public function setFormat($format) { |
|
| 60 | + $this->format = $format; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @return string |
|
| 65 | - */ |
|
| 66 | - public function getFormat() { |
|
| 67 | - return $this->format; |
|
| 68 | - } |
|
| 63 | + /** |
|
| 64 | + * @return string |
|
| 65 | + */ |
|
| 66 | + public function getFormat() { |
|
| 67 | + return $this->format; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * @param string $prefix_url |
|
| 72 | - */ |
|
| 73 | - public function setPrefixUrl($prefix_url) { |
|
| 74 | - $this->prefix_url = $prefix_url; |
|
| 75 | - } |
|
| 70 | + /** |
|
| 71 | + * @param string $prefix_url |
|
| 72 | + */ |
|
| 73 | + public function setPrefixUrl($prefix_url) { |
|
| 74 | + $this->prefix_url = $prefix_url; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * @return string |
|
| 79 | - */ |
|
| 80 | - public function getPrefixUrl() { |
|
| 81 | - return $this->prefix_url; |
|
| 82 | - } |
|
| 77 | + /** |
|
| 78 | + * @return string |
|
| 79 | + */ |
|
| 80 | + public function getPrefixUrl() { |
|
| 81 | + return $this->prefix_url; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @param boolean $skip_dev |
|
| 86 | - */ |
|
| 87 | - public function setSkipDev($skip_dev) { |
|
| 88 | - $this->skip_dev = $skip_dev; |
|
| 89 | - } |
|
| 84 | + /** |
|
| 85 | + * @param boolean $skip_dev |
|
| 86 | + */ |
|
| 87 | + public function setSkipDev($skip_dev) { |
|
| 88 | + $this->skip_dev = $skip_dev; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * @return boolean |
|
| 93 | - */ |
|
| 94 | - public function getSkipDev() { |
|
| 95 | - return $this->skip_dev; |
|
| 96 | - } |
|
| 91 | + /** |
|
| 92 | + * @return boolean |
|
| 93 | + */ |
|
| 94 | + public function getSkipDev() { |
|
| 95 | + return $this->skip_dev; |
|
| 96 | + } |
|
| 97 | 97 | } |
@@ -11,62 +11,62 @@ |
||
| 11 | 11 | * @author Lukas Homza <[email protected]> |
| 12 | 12 | */ |
| 13 | 13 | class Package { |
| 14 | - /** |
|
| 15 | - * @Type("string") |
|
| 16 | - */ |
|
| 17 | - private $name; |
|
| 14 | + /** |
|
| 15 | + * @Type("string") |
|
| 16 | + */ |
|
| 17 | + private $name; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * @Type("string") |
|
| 21 | - */ |
|
| 22 | - private $version; |
|
| 19 | + /** |
|
| 20 | + * @Type("string") |
|
| 21 | + */ |
|
| 22 | + private $version; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Initialize with default opinionated values |
|
| 26 | - */ |
|
| 27 | - public function __construct() { |
|
| 24 | + /** |
|
| 25 | + * Initialize with default opinionated values |
|
| 26 | + */ |
|
| 27 | + public function __construct() { |
|
| 28 | 28 | $this->name = ''; |
| 29 | 29 | $this->version = '*'; |
| 30 | - } |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @return string |
|
| 34 | - */ |
|
| 35 | - public function getVersion() { |
|
| 32 | + /** |
|
| 33 | + * @return string |
|
| 34 | + */ |
|
| 35 | + public function getVersion() { |
|
| 36 | 36 | return $this->version; |
| 37 | - } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @return string |
|
| 41 | - */ |
|
| 42 | - public function getName() { |
|
| 39 | + /** |
|
| 40 | + * @return string |
|
| 41 | + */ |
|
| 42 | + public function getName() { |
|
| 43 | 43 | return $this->name; |
| 44 | - } |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * @param string $version |
|
| 48 | - */ |
|
| 49 | - public function setVersion($version) { |
|
| 46 | + /** |
|
| 47 | + * @param string $version |
|
| 48 | + */ |
|
| 49 | + public function setVersion($version) { |
|
| 50 | 50 | $this->version = $version; |
| 51 | - } |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @param mixed $name |
|
| 55 | - * @return Package |
|
| 56 | - */ |
|
| 57 | - public function setName($name) { |
|
| 53 | + /** |
|
| 54 | + * @param mixed $name |
|
| 55 | + * @return Package |
|
| 56 | + */ |
|
| 57 | + public function setName($name) { |
|
| 58 | 58 | $this->name = trim($name); |
| 59 | 59 | |
| 60 | 60 | return $this; |
| 61 | - } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * Get repository ID |
|
| 65 | - * |
|
| 66 | - * @return string |
|
| 67 | - */ |
|
| 68 | - public function getId() { |
|
| 63 | + /** |
|
| 64 | + * Get repository ID |
|
| 65 | + * |
|
| 66 | + * @return string |
|
| 67 | + */ |
|
| 68 | + public function getId() { |
|
| 69 | 69 | return ConfigManager::nameToId($this->name); |
| 70 | - } |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | 72 | } |
@@ -15,50 +15,50 @@ discard block |
||
| 15 | 15 | * @author Lukas Homza <[email protected]> |
| 16 | 16 | */ |
| 17 | 17 | class Config { |
| 18 | - /** |
|
| 19 | - * @Type("string") |
|
| 20 | - */ |
|
| 21 | - private $name; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * @Type("string") |
|
| 25 | - */ |
|
| 26 | - private $homepage; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * @Type("App\Satis\Collections\RepositoryCollection<App\Satis\Model\Repository>") |
|
| 30 | - */ |
|
| 31 | - private $repositories; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @Type("App\Satis\Collections\PackageCollection<App\Satis\Model\Package>") |
|
| 35 | - * @SerializedName("require") |
|
| 36 | - */ |
|
| 37 | - private $packages; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @Type("boolean") |
|
| 41 | - * @SerializedName("require-all") |
|
| 42 | - */ |
|
| 43 | - private $requireAll; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * @Type("boolean") |
|
| 47 | - * @SerializedName("require-dependencies") |
|
| 48 | - */ |
|
| 49 | - private $requireDependencies; |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * @Type("boolean") |
|
| 53 | - * @SerializedName("require-dev-dependencies") |
|
| 54 | - */ |
|
| 55 | - private $requireDevDependencies; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * @var Archive |
|
| 59 | - * @Type("App\Satis\Model\Archive") |
|
| 60 | - */ |
|
| 61 | - private $archive; |
|
| 18 | + /** |
|
| 19 | + * @Type("string") |
|
| 20 | + */ |
|
| 21 | + private $name; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @Type("string") |
|
| 25 | + */ |
|
| 26 | + private $homepage; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @Type("App\Satis\Collections\RepositoryCollection<App\Satis\Model\Repository>") |
|
| 30 | + */ |
|
| 31 | + private $repositories; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @Type("App\Satis\Collections\PackageCollection<App\Satis\Model\Package>") |
|
| 35 | + * @SerializedName("require") |
|
| 36 | + */ |
|
| 37 | + private $packages; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @Type("boolean") |
|
| 41 | + * @SerializedName("require-all") |
|
| 42 | + */ |
|
| 43 | + private $requireAll; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @Type("boolean") |
|
| 47 | + * @SerializedName("require-dependencies") |
|
| 48 | + */ |
|
| 49 | + private $requireDependencies; |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * @Type("boolean") |
|
| 53 | + * @SerializedName("require-dev-dependencies") |
|
| 54 | + */ |
|
| 55 | + private $requireDevDependencies; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * @var Archive |
|
| 59 | + * @Type("App\Satis\Model\Archive") |
|
| 60 | + */ |
|
| 61 | + private $archive; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * @Type("string") |
@@ -66,133 +66,133 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | private $twigTemplate; |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Constructor |
|
| 71 | - */ |
|
| 72 | - public function __construct() { |
|
| 73 | - $this->repositories = []; |
|
| 74 | - $this->packages = []; |
|
| 75 | - $this->requireAll = false; |
|
| 76 | - $this->requireDependencies = true; |
|
| 77 | - $this->requireDevDependencies = false; |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Get name |
|
| 82 | - * |
|
| 83 | - * @return string $name |
|
| 84 | - */ |
|
| 85 | - public function getName() { |
|
| 86 | - return $this->name; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * Get homepage |
|
| 91 | - * |
|
| 92 | - * @return string $homepage |
|
| 93 | - */ |
|
| 94 | - public function getHomepage() { |
|
| 95 | - return $this->homepage; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @param string $homepage |
|
| 100 | - * @return $this |
|
| 101 | - */ |
|
| 102 | - public function setHomepage($homepage) { |
|
| 103 | - $this->homepage = $homepage; |
|
| 104 | - |
|
| 105 | - return $this; |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - /** |
|
| 109 | - * Get repositories |
|
| 110 | - * |
|
| 111 | - * @return RepositoryCollection<Repository> |
|
| 112 | - */ |
|
| 113 | - public function getRepositories() { |
|
| 114 | - return $this->repositories; |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Set repositories |
|
| 119 | - * |
|
| 120 | - * @param RepositoryCollection $repositories |
|
| 121 | - * |
|
| 122 | - * @return static |
|
| 123 | - */ |
|
| 124 | - public function setRepositories(RepositoryCollection $repositories) { |
|
| 125 | - $this->repositories = $repositories; |
|
| 126 | - |
|
| 127 | - return $this; |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * @param Archive $archive |
|
| 132 | - */ |
|
| 133 | - public function setArchive(Archive $archive = null) { |
|
| 134 | - $this->archive = $archive; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * @return Archive |
|
| 139 | - */ |
|
| 140 | - public function getArchive() { |
|
| 141 | - return $this->archive; |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Get packages |
|
| 146 | - * |
|
| 147 | - * @return PackageCollection<Package> |
|
| 148 | - */ |
|
| 149 | - public function getPackages() { |
|
| 150 | - return $this->packages; |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * @param PackageCollection $packages |
|
| 155 | - * @return $this |
|
| 156 | - */ |
|
| 157 | - public function setPackages(PackageCollection $packages) { |
|
| 158 | - $this->packages = $packages; |
|
| 159 | - |
|
| 160 | - return $this; |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - /** |
|
| 164 | - * @return boolean |
|
| 165 | - */ |
|
| 166 | - public function getRequireDevDependencies() { |
|
| 167 | - return $this->requireDevDependencies; |
|
| 168 | - } |
|
| 169 | - |
|
| 170 | - /** |
|
| 171 | - * @param boolean $requireDevDependencies |
|
| 172 | - * @return Config |
|
| 173 | - */ |
|
| 174 | - public function setRequireDevDependencies($requireDevDependencies) { |
|
| 175 | - $this->requireDevDependencies = $requireDevDependencies; |
|
| 176 | - |
|
| 177 | - return $this; |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - /** |
|
| 181 | - * @return boolean |
|
| 182 | - */ |
|
| 183 | - public function getRequireAll() { |
|
| 184 | - return $this->requireAll; |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * @param boolean $requireAll |
|
| 189 | - * @return $this |
|
| 190 | - */ |
|
| 191 | - public function setRequireAll($requireAll) { |
|
| 192 | - $this->requireAll = $requireAll; |
|
| 193 | - |
|
| 194 | - return $this; |
|
| 195 | - } |
|
| 69 | + /** |
|
| 70 | + * Constructor |
|
| 71 | + */ |
|
| 72 | + public function __construct() { |
|
| 73 | + $this->repositories = []; |
|
| 74 | + $this->packages = []; |
|
| 75 | + $this->requireAll = false; |
|
| 76 | + $this->requireDependencies = true; |
|
| 77 | + $this->requireDevDependencies = false; |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Get name |
|
| 82 | + * |
|
| 83 | + * @return string $name |
|
| 84 | + */ |
|
| 85 | + public function getName() { |
|
| 86 | + return $this->name; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * Get homepage |
|
| 91 | + * |
|
| 92 | + * @return string $homepage |
|
| 93 | + */ |
|
| 94 | + public function getHomepage() { |
|
| 95 | + return $this->homepage; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * @param string $homepage |
|
| 100 | + * @return $this |
|
| 101 | + */ |
|
| 102 | + public function setHomepage($homepage) { |
|
| 103 | + $this->homepage = $homepage; |
|
| 104 | + |
|
| 105 | + return $this; |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + /** |
|
| 109 | + * Get repositories |
|
| 110 | + * |
|
| 111 | + * @return RepositoryCollection<Repository> |
|
| 112 | + */ |
|
| 113 | + public function getRepositories() { |
|
| 114 | + return $this->repositories; |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Set repositories |
|
| 119 | + * |
|
| 120 | + * @param RepositoryCollection $repositories |
|
| 121 | + * |
|
| 122 | + * @return static |
|
| 123 | + */ |
|
| 124 | + public function setRepositories(RepositoryCollection $repositories) { |
|
| 125 | + $this->repositories = $repositories; |
|
| 126 | + |
|
| 127 | + return $this; |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @param Archive $archive |
|
| 132 | + */ |
|
| 133 | + public function setArchive(Archive $archive = null) { |
|
| 134 | + $this->archive = $archive; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @return Archive |
|
| 139 | + */ |
|
| 140 | + public function getArchive() { |
|
| 141 | + return $this->archive; |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Get packages |
|
| 146 | + * |
|
| 147 | + * @return PackageCollection<Package> |
|
| 148 | + */ |
|
| 149 | + public function getPackages() { |
|
| 150 | + return $this->packages; |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * @param PackageCollection $packages |
|
| 155 | + * @return $this |
|
| 156 | + */ |
|
| 157 | + public function setPackages(PackageCollection $packages) { |
|
| 158 | + $this->packages = $packages; |
|
| 159 | + |
|
| 160 | + return $this; |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + /** |
|
| 164 | + * @return boolean |
|
| 165 | + */ |
|
| 166 | + public function getRequireDevDependencies() { |
|
| 167 | + return $this->requireDevDependencies; |
|
| 168 | + } |
|
| 169 | + |
|
| 170 | + /** |
|
| 171 | + * @param boolean $requireDevDependencies |
|
| 172 | + * @return Config |
|
| 173 | + */ |
|
| 174 | + public function setRequireDevDependencies($requireDevDependencies) { |
|
| 175 | + $this->requireDevDependencies = $requireDevDependencies; |
|
| 176 | + |
|
| 177 | + return $this; |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + /** |
|
| 181 | + * @return boolean |
|
| 182 | + */ |
|
| 183 | + public function getRequireAll() { |
|
| 184 | + return $this->requireAll; |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * @param boolean $requireAll |
|
| 189 | + * @return $this |
|
| 190 | + */ |
|
| 191 | + public function setRequireAll($requireAll) { |
|
| 192 | + $this->requireAll = $requireAll; |
|
| 193 | + |
|
| 194 | + return $this; |
|
| 195 | + } |
|
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * @return string |
@@ -13,85 +13,85 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Repository { |
| 15 | 15 | |
| 16 | - const REGEX = '#((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:\/\-~]+)(\/)?#'; |
|
| 16 | + const REGEX = '#((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:\/\-~]+)(\/)?#'; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @Type("string") |
|
| 20 | - */ |
|
| 21 | - private $type; |
|
| 18 | + /** |
|
| 19 | + * @Type("string") |
|
| 20 | + */ |
|
| 21 | + private $type; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @Type("string") |
|
| 25 | - */ |
|
| 26 | - private $url; |
|
| 23 | + /** |
|
| 24 | + * @Type("string") |
|
| 25 | + */ |
|
| 26 | + private $url; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Initialize with default opinionated values |
|
| 30 | - */ |
|
| 31 | - public function __construct() { |
|
| 28 | + /** |
|
| 29 | + * Initialize with default opinionated values |
|
| 30 | + */ |
|
| 31 | + public function __construct() { |
|
| 32 | 32 | $this->type = config('satis.default_repository_type'); |
| 33 | 33 | $this->url = ''; |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Get the string representation |
|
| 38 | - * |
|
| 39 | - * @return string |
|
| 40 | - */ |
|
| 41 | - public function __toString() { |
|
| 36 | + /** |
|
| 37 | + * Get the string representation |
|
| 38 | + * |
|
| 39 | + * @return string |
|
| 40 | + */ |
|
| 41 | + public function __toString() { |
|
| 42 | 42 | return $this->url; |
| 43 | - } |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Get type |
|
| 47 | - * |
|
| 48 | - * @return string $type |
|
| 49 | - */ |
|
| 50 | - public function getType() { |
|
| 45 | + /** |
|
| 46 | + * Get type |
|
| 47 | + * |
|
| 48 | + * @return string $type |
|
| 49 | + */ |
|
| 50 | + public function getType() { |
|
| 51 | 51 | return $this->type; |
| 52 | - } |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Set type |
|
| 56 | - * |
|
| 57 | - * @param string $type |
|
| 58 | - * |
|
| 59 | - * @return static |
|
| 60 | - */ |
|
| 61 | - public function setType($type) { |
|
| 54 | + /** |
|
| 55 | + * Set type |
|
| 56 | + * |
|
| 57 | + * @param string $type |
|
| 58 | + * |
|
| 59 | + * @return static |
|
| 60 | + */ |
|
| 61 | + public function setType($type) { |
|
| 62 | 62 | $this->type = strtolower($type); |
| 63 | 63 | |
| 64 | 64 | return $this; |
| 65 | - } |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Get url |
|
| 69 | - * |
|
| 70 | - * @return string $url |
|
| 71 | - */ |
|
| 72 | - public function getUrl() { |
|
| 67 | + /** |
|
| 68 | + * Get url |
|
| 69 | + * |
|
| 70 | + * @return string $url |
|
| 71 | + */ |
|
| 72 | + public function getUrl() { |
|
| 73 | 73 | return $this->url; |
| 74 | - } |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Set url |
|
| 78 | - * |
|
| 79 | - * @param string $url |
|
| 80 | - * |
|
| 81 | - * @return static |
|
| 82 | - */ |
|
| 83 | - public function setUrl($url) { |
|
| 76 | + /** |
|
| 77 | + * Set url |
|
| 78 | + * |
|
| 79 | + * @param string $url |
|
| 80 | + * |
|
| 81 | + * @return static |
|
| 82 | + */ |
|
| 83 | + public function setUrl($url) { |
|
| 84 | 84 | $this->url = urldecode($url); |
| 85 | 85 | |
| 86 | 86 | return $this; |
| 87 | - } |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * Get repository ID |
|
| 91 | - * |
|
| 92 | - * @return string |
|
| 93 | - */ |
|
| 94 | - public function getId() { |
|
| 89 | + /** |
|
| 90 | + * Get repository ID |
|
| 91 | + * |
|
| 92 | + * @return string |
|
| 93 | + */ |
|
| 94 | + public function getId() { |
|
| 95 | 95 | return ConfigManager::nameToId($this->url); |
| 96 | - } |
|
| 96 | + } |
|
| 97 | 97 | } |