Passed
Push — fix/findFromRaxSql-count ( 9e0437 )
by
unknown
04:06
created

TestAlbumDao   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 1
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findAllFromRawSqlWithCount() 0 6 1
A findAllFromRawSql() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TheCodingMachine\TDBM\Dao;
5
6
use TheCodingMachine\TDBM\Test\Dao\Bean\AlbumBean;
0 ignored issues
show
Bug introduced by
The type TheCodingMachine\TDBM\Test\Dao\Bean\AlbumBean was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use TheCodingMachine\TDBM\Test\Dao\Generated\AlbumBaseDao;
0 ignored issues
show
Bug introduced by
The type TheCodingMachine\TDBM\Te...\Generated\AlbumBaseDao was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
/**
10
 * The AlbumDao class will maintain the persistence of UserBean class into the users table.
11
 */
12
class TestAlbumDao extends AlbumBaseDao
13
{
14
    /**
15
     * @return \TheCodingMachine\TDBM\ResultIterator|AlbumBean[]
16
     */
17
    public function findAllFromRawSql()
18
    {
19
        return $this->findFromRawSql('SELECT DISTINCT albums.* FROM albums');
20
    }
21
22
    /**
23
     * @return \TheCodingMachine\TDBM\ResultIterator|AlbumBean[]
24
     */
25
    public function findAllFromRawSqlWithCount()
26
    {
27
        return $this->findFromRawSql(
28
            'SELECT DISTINCT albums.* FROM albums',
29
            [],
30
            'SELECT COUNT(DISTINCT albums.id) FROM albums'
31
        );
32
    }
33
}
34