Code Duplication    Length = 16-17 lines in 3 locations

src/ClientLocal.php 3 locations

@@ 182-198 (lines=17) @@
179
    /**
180
     * @inheritDoc
181
     */
182
    public function getSettingsByCollection($collectionName)
183
    {
184
        $connection = $this->container->get('connection');
185
        $acl = $this->container->get('acl');
186
        $tableGateway = new DirectusSettingsTableGateway($connection, $acl);
187
188
        $data = [
189
            'meta' => [
190
                'table' => 'directus_settings',
191
                'type' => 'entry',
192
                'settings_collection' => $collectionName
193
            ],
194
            'data' => $tableGateway->fetchCollection($collectionName)
195
        ];
196
197
        return $this->createResponseFromData($data);
198
    }
199
200
    /**
201
     * @inheritdoc
@@ 481-496 (lines=16) @@
478
        return $this->createMessage($data);
479
    }
480
481
    public function createPrivileges(array $data)
482
    {
483
        $connection = $this->container->get('connection');
484
        $acl = $this->container->get('acl');
485
        $privileges = new DirectusPrivilegesTableGateway($connection, $acl);
486
487
        $response = [
488
            'meta' => [
489
                'type' => 'item',
490
                'table' => 'directus_privileges'
491
            ],
492
            'data' => $privileges->insertPrivilege($data)
493
        ];
494
495
        return $this->createResponseFromData($response);
496
    }
497
498
    public function createTable($name, array $data = [])
499
    {
@@ 581-596 (lines=16) @@
578
        return $this->createResponseFromData($response);
579
    }
580
581
    public function getPreferences($table, $user)
582
    {
583
        $acl = $this->container->get('acl');
584
        $connection = $this->container->get('connection');
585
        $preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl);
586
587
        $response = [
588
            'meta' => [
589
                'type' => 'item',
590
                'table' => 'directus_preferences'
591
            ],
592
            'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table)
593
        ];
594
595
        return $this->createResponseFromData($response);
596
    }
597
598
    /**
599
     * @inheritdoc