Code Duplication    Length = 16-17 lines in 3 locations

src/ClientLocal.php 3 locations

@@ 183-199 (lines=17) @@
180
    /**
181
     * @inheritDoc
182
     */
183
    public function getSettingsByCollection($collectionName)
184
    {
185
        $connection = $this->container->get('connection');
186
        $acl = $this->container->get('acl');
187
        $tableGateway = new DirectusSettingsTableGateway($connection, $acl);
188
189
        $data = [
190
            'meta' => [
191
                'table' => 'directus_settings',
192
                'type' => 'entry',
193
                'settings_collection' => $collectionName
194
            ],
195
            'data' => $tableGateway->fetchCollection($collectionName)
196
        ];
197
198
        return $this->createResponseFromData($data);
199
    }
200
201
    /**
202
     * @inheritdoc
@@ 506-521 (lines=16) @@
503
        return $this->createMessage($data);
504
    }
505
506
    public function createPrivileges(array $data)
507
    {
508
        $connection = $this->container->get('connection');
509
        $acl = $this->container->get('acl');
510
        $privileges = new DirectusPrivilegesTableGateway($connection, $acl);
511
512
        $response = [
513
            'meta' => [
514
                'type' => 'item',
515
                'table' => 'directus_privileges'
516
            ],
517
            'data' => $privileges->insertPrivilege($data)
518
        ];
519
520
        return $this->createResponseFromData($response);
521
    }
522
523
    public function createTable($name, array $data = [])
524
    {
@@ 606-621 (lines=16) @@
603
        return $this->createResponseFromData($response);
604
    }
605
606
    public function getPreferences($table, $user)
607
    {
608
        $acl = $this->container->get('acl');
609
        $connection = $this->container->get('connection');
610
        $preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl);
611
612
        $response = [
613
            'meta' => [
614
                'type' => 'item',
615
                'table' => 'directus_preferences'
616
            ],
617
            'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table)
618
        ];
619
620
        return $this->createResponseFromData($response);
621
    }
622
623
    /**
624
     * @inheritdoc