Zend1Test   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAdapter() 0 16 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace StefanoTreeTest\Integration\Adapter;
6
7
use StefanoTree\NestedSet\Adapter\AdapterInterface;
8
use StefanoTree\NestedSet\Adapter\Zend1;
9
use StefanoTree\NestedSet\Options;
10
use StefanoTreeTest\TestUtil;
11
12
/**
13
 * @internal
14
 */
15
class Zend1Test extends AdapterAbstract
16
{
17
    /**
18
     * @return AdapterInterface
19
     */
20
    protected function getAdapter(): AdapterInterface
21
    {
22
        if (null === $this->adapter) {
23
            $options = new Options(array(
24
                'tableName' => 'tree_traversal',
25
                'idColumnName' => 'tree_traversal_id',
26
            ));
27
28
            if ('pgsql' == TEST_STEFANO_DB_VENDOR) {
0 ignored issues
show
introduced by
The condition 'pgsql' == StefanoTreeTe...\TEST_STEFANO_DB_VENDOR is always false.
Loading history...
29
                $options->setSequenceName('tree_traversal_tree_traversal_id_seq');
30
            }
31
32
            $this->adapter = new Zend1($options, TestUtil::getZend1DbAdapter());
33
        }
34
35
        return $this->adapter;
36
    }
37
}
38