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
@@ 501-516 (lines=16) @@
498
        return $this->createMessage($data);
499
    }
500
501
    public function createPrivileges(array $data)
502
    {
503
        $connection = $this->container->get('connection');
504
        $acl = $this->container->get('acl');
505
        $privileges = new DirectusPrivilegesTableGateway($connection, $acl);
506
507
        $response = [
508
            'meta' => [
509
                'type' => 'item',
510
                'table' => 'directus_privileges'
511
            ],
512
            'data' => $privileges->insertPrivilege($data)
513
        ];
514
515
        return $this->createResponseFromData($response);
516
    }
517
518
    public function createTable($name, array $data = [])
519
    {
@@ 601-616 (lines=16) @@
598
        return $this->createResponseFromData($response);
599
    }
600
601
    public function getPreferences($table, $user)
602
    {
603
        $acl = $this->container->get('acl');
604
        $connection = $this->container->get('connection');
605
        $preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl);
606
607
        $response = [
608
            'meta' => [
609
                'type' => 'item',
610
                'table' => 'directus_preferences'
611
            ],
612
            'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table)
613
        ];
614
615
        return $this->createResponseFromData($response);
616
    }
617
618
    /**
619
     * @inheritdoc