Completed
Push — master ( b77a89...ae9c75 )
by Vitaly
06:10
created

Collection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 5
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 1
1
<?php
2
3
namespace samsoncms\newsletter;
4
5
use samsoncms\email\field\Status;
6
use samsoncms\email\field\Template;
7
use samsoncms\field\Control;
8
use samsoncms\field\Generic;
9
10
class Collection extends \samsoncms\Collection
11
{
12
    /** {@inheritdoc} */
13
    public function __construct($renderer, $query = null, $pager = null)
14
    {
15
        // Fill default column fields for collection
16
        $this->fields = array(
0 ignored issues
show
Documentation Bug introduced by
It seems like array(new \samsoncms\fie...soncms\field\Control()) of type array<integer,object<sam...cms\\field\\Control>"}> is incompatible with the declared type array<integer,object<samsoncms\field\Generic>> of property $fields.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
17
            new Generic('distribution_id', t('#', true), 0, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18
            new Template('template_id', t('Template', true), 0),
19
            new Generic('recipient_count', t('Recipients count', true), 0, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
20
            new Generic('open_count', t('Opens count', true), 0, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
21
            new Generic('click_count', t('Clicks count', true), 0, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
22
            new Status('status', t('Status', true), 0),
23
            new Generic('ts', t('Created', true), 10, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
24
            new Generic('finished', t('Finished', true), 10, '', 0),
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
25
            new Control(),
26
        );
27
28
        // Call parents
29
        parent::__construct($renderer, $query, $pager);
30
31
        $this->fill();
32
    }
33
}
34