@@ -23,29 +23,29 @@ |
||
| 23 | 23 | |
| 24 | 24 | class EducationBundle extends Bundle { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * {@inheritDoc} |
|
| 28 | - */ |
|
| 29 | - public function getName() { |
|
| 30 | - return (string)$this->l10n->t('Education Edition'); |
|
| 31 | - } |
|
| 26 | + /** |
|
| 27 | + * {@inheritDoc} |
|
| 28 | + */ |
|
| 29 | + public function getName() { |
|
| 30 | + return (string)$this->l10n->t('Education Edition'); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * {@inheritDoc} |
|
| 35 | - */ |
|
| 36 | - public function getAppIdentifiers() { |
|
| 37 | - return [ |
|
| 38 | - 'zenodo', |
|
| 39 | - 'dashboard', |
|
| 40 | - 'circles', |
|
| 41 | - 'groupfolders', |
|
| 42 | - 'announcementcenter', |
|
| 43 | - 'admin_notifications', |
|
| 44 | - 'quota_warning', |
|
| 45 | - 'sharepoint', |
|
| 46 | - 'orcid', |
|
| 47 | - 'user_saml', |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 33 | + /** |
|
| 34 | + * {@inheritDoc} |
|
| 35 | + */ |
|
| 36 | + public function getAppIdentifiers() { |
|
| 37 | + return [ |
|
| 38 | + 'zenodo', |
|
| 39 | + 'dashboard', |
|
| 40 | + 'circles', |
|
| 41 | + 'groupfolders', |
|
| 42 | + 'announcementcenter', |
|
| 43 | + 'admin_notifications', |
|
| 44 | + 'quota_warning', |
|
| 45 | + 'sharepoint', |
|
| 46 | + 'orcid', |
|
| 47 | + 'user_saml', |
|
| 48 | + ]; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | } |
@@ -24,58 +24,58 @@ |
||
| 24 | 24 | use OCP\IL10N; |
| 25 | 25 | |
| 26 | 26 | class BundleFetcher { |
| 27 | - /** @var IL10N */ |
|
| 28 | - private $l10n; |
|
| 27 | + /** @var IL10N */ |
|
| 28 | + private $l10n; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param IL10N $l10n |
|
| 32 | - */ |
|
| 33 | - public function __construct(IL10N $l10n) { |
|
| 34 | - $this->l10n = $l10n; |
|
| 35 | - } |
|
| 30 | + /** |
|
| 31 | + * @param IL10N $l10n |
|
| 32 | + */ |
|
| 33 | + public function __construct(IL10N $l10n) { |
|
| 34 | + $this->l10n = $l10n; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @return Bundle[] |
|
| 39 | - */ |
|
| 40 | - public function getBundles() { |
|
| 41 | - return [ |
|
| 42 | - new EnterpriseBundle($this->l10n), |
|
| 43 | - new GroupwareBundle($this->l10n), |
|
| 44 | - new SocialSharingBundle($this->l10n), |
|
| 45 | - new EducationBundle($this->l10n), |
|
| 46 | - ]; |
|
| 47 | - } |
|
| 37 | + /** |
|
| 38 | + * @return Bundle[] |
|
| 39 | + */ |
|
| 40 | + public function getBundles() { |
|
| 41 | + return [ |
|
| 42 | + new EnterpriseBundle($this->l10n), |
|
| 43 | + new GroupwareBundle($this->l10n), |
|
| 44 | + new SocialSharingBundle($this->l10n), |
|
| 45 | + new EducationBundle($this->l10n), |
|
| 46 | + ]; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * Bundles that should be installed by default after installation |
|
| 51 | - * |
|
| 52 | - * @return Bundle[] |
|
| 53 | - */ |
|
| 54 | - public function getDefaultInstallationBundle() { |
|
| 55 | - return [ |
|
| 56 | - new CoreBundle($this->l10n), |
|
| 57 | - ]; |
|
| 58 | - } |
|
| 49 | + /** |
|
| 50 | + * Bundles that should be installed by default after installation |
|
| 51 | + * |
|
| 52 | + * @return Bundle[] |
|
| 53 | + */ |
|
| 54 | + public function getDefaultInstallationBundle() { |
|
| 55 | + return [ |
|
| 56 | + new CoreBundle($this->l10n), |
|
| 57 | + ]; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Get the bundle with the specified identifier |
|
| 62 | - * |
|
| 63 | - * @param string $identifier |
|
| 64 | - * @return Bundle |
|
| 65 | - * @throws \BadMethodCallException If the bundle does not exist |
|
| 66 | - */ |
|
| 67 | - public function getBundleByIdentifier($identifier) { |
|
| 68 | - /** @var Bundle[] $bundles */ |
|
| 69 | - $bundles = array_merge( |
|
| 70 | - $this->getBundles(), |
|
| 71 | - $this->getDefaultInstallationBundle() |
|
| 72 | - ); |
|
| 73 | - foreach($bundles as $bundle) { |
|
| 74 | - if($bundle->getIdentifier() === $identifier) { |
|
| 75 | - return $bundle; |
|
| 76 | - } |
|
| 77 | - } |
|
| 60 | + /** |
|
| 61 | + * Get the bundle with the specified identifier |
|
| 62 | + * |
|
| 63 | + * @param string $identifier |
|
| 64 | + * @return Bundle |
|
| 65 | + * @throws \BadMethodCallException If the bundle does not exist |
|
| 66 | + */ |
|
| 67 | + public function getBundleByIdentifier($identifier) { |
|
| 68 | + /** @var Bundle[] $bundles */ |
|
| 69 | + $bundles = array_merge( |
|
| 70 | + $this->getBundles(), |
|
| 71 | + $this->getDefaultInstallationBundle() |
|
| 72 | + ); |
|
| 73 | + foreach($bundles as $bundle) { |
|
| 74 | + if($bundle->getIdentifier() === $identifier) { |
|
| 75 | + return $bundle; |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - throw new \BadMethodCallException('Bundle with specified identifier does not exist'); |
|
| 80 | - } |
|
| 79 | + throw new \BadMethodCallException('Bundle with specified identifier does not exist'); |
|
| 80 | + } |
|
| 81 | 81 | } |