]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove getDefaultInstallationBundle
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 22 Sep 2022 11:29:02 +0000 (13:29 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 22 Sep 2022 13:11:39 +0000 (15:11 +0200)
- because all apps are shipped now it was returning an empty result

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/App/AppStore/Bundles/BundleFetcher.php
lib/private/Setup.php
tests/lib/App/AppStore/Bundles/BundleFetcherTest.php

index 4745fef5203c7ef98d34a8317507e40b4bd4155b..0d2bb61495ff85fcffa957d223eb0022becbd2f9 100644 (file)
@@ -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),
@@ -50,16 +46,6 @@ class BundleFetcher {
                ];
        }
 
-       /**
-        * Bundles that should be installed by default after installation
-        *
-        * @return Bundle[]
-        */
-       public function getDefaultInstallationBundle() {
-               return [
-               ];
-       }
-
        /**
         * Get the bundle with the specified identifier
         *
@@ -67,13 +53,8 @@ class BundleFetcher {
         * @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;
                        }
index edbb9b332759b42b9d5d64fefbe6e64e031d8fea..a14d43a65f07e990b872a0d3a6a981a1db36a9ef 100644 (file)
@@ -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
index daec97255ca5015bff8c8940861cc58465373093..c1fe5ef328a746cc10fcc1b666a4fa568cc44b00 100644 (file)
@@ -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'));