diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-09-22 13:29:02 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-09-22 17:36:09 +0200 |
commit | 1115199ae3e1c0f2f23874253e6202725e28778c (patch) | |
tree | 24c777433e7d1f699ee0ac6342b23cea3d5ed46b | |
parent | 86b787d21e0a51f3378315868998df8fa12726ad (diff) | |
download | nextcloud-server-1115199ae3e1c0f2f23874253e6202725e28778c.tar.gz nextcloud-server-1115199ae3e1c0f2f23874253e6202725e28778c.zip |
remove getDefaultInstallationBundle
- because all apps are shipped now it was returning an empty result
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | lib/private/App/AppStore/Bundles/BundleFetcher.php | 27 | ||||
-rw-r--r-- | lib/private/Setup.php | 8 | ||||
-rw-r--r-- | tests/lib/App/AppStore/Bundles/BundleFetcherTest.php | 5 |
3 files changed, 4 insertions, 36 deletions
diff --git a/lib/private/App/AppStore/Bundles/BundleFetcher.php b/lib/private/App/AppStore/Bundles/BundleFetcher.php index 4745fef5203..0d2bb61495f 100644 --- a/lib/private/App/AppStore/Bundles/BundleFetcher.php +++ b/lib/private/App/AppStore/Bundles/BundleFetcher.php @@ -27,12 +27,8 @@ namespace OC\App\AppStore\Bundles; use OCP\IL10N; class BundleFetcher { - /** @var IL10N */ - private $l10n; + private IL10N $l10n; - /** - * @param IL10N $l10n - */ public function __construct(IL10N $l10n) { $this->l10n = $l10n; } @@ -40,7 +36,7 @@ class BundleFetcher { /** * @return Bundle[] */ - public function getBundles() { + public function getBundles(): array { return [ new EnterpriseBundle($this->l10n), new HubBundle($this->l10n), @@ -51,29 +47,14 @@ class BundleFetcher { } /** - * Bundles that should be installed by default after installation - * - * @return Bundle[] - */ - public function getDefaultInstallationBundle() { - return [ - ]; - } - - /** * Get the bundle with the specified identifier * * @param string $identifier * @return Bundle * @throws \BadMethodCallException If the bundle does not exist */ - public function getBundleByIdentifier($identifier) { - /** @var Bundle[] $bundles */ - $bundles = array_merge( - $this->getBundles(), - $this->getDefaultInstallationBundle() - ); - foreach ($bundles as $bundle) { + public function getBundleByIdentifier(string $identifier): Bundle { + foreach ($this->getBundles() as $bundle) { if ($bundle->getIdentifier() === $identifier) { return $bundle; } diff --git a/lib/private/Setup.php b/lib/private/Setup.php index edbb9b33275..a14d43a65f0 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -403,14 +403,6 @@ class Setup { // Install shipped apps and specified app bundles Installer::installShippedApps(); - $bundleFetcher = new BundleFetcher(\OC::$server->getL10N('lib')); - $defaultInstallationBundles = $bundleFetcher->getDefaultInstallationBundle(); - foreach ($defaultInstallationBundles as $bundle) { - try { - $this->installer->installAppBundle($bundle); - } catch (Exception $e) { - } - } // create empty file in data dir, so we can later find // out that this is indeed an ownCloud data directory diff --git a/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php b/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php index daec97255ca..c1fe5ef328a 100644 --- a/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php +++ b/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php @@ -57,11 +57,6 @@ class BundleFetcherTest extends TestCase { $this->assertEquals($expected, $this->bundleFetcher->getBundles()); } - public function testGetDefaultInstallationBundle() { - $expected = []; - $this->assertEquals($expected, $this->bundleFetcher->getDefaultInstallationBundle()); - } - public function testGetBundleByIdentifier() { $this->assertEquals(new EnterpriseBundle($this->l10n), $this->bundleFetcher->getBundleByIdentifier('EnterpriseBundle')); $this->assertEquals(new GroupwareBundle($this->l10n), $this->bundleFetcher->getBundleByIdentifier('GroupwareBundle')); |