Completed
Push — master ( e2e002...b5462c )
by
unknown
09:18 queued 02:12
created

BasicInput   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace Charcoal\Admin\Property\Input\Tinymce;
4
5
// From 'charcoal-admin'
6
use Charcoal\Admin\Property\Input\TinymceInput;
7
8
/**
9
 * Basic Features for a TinyMCE Rich-Text Input Property
10
 */
11
class BasicInput extends TinymceInput
12
{
13
    /**
14
     * Return a new object property for sports.
15
     *
16
     * @param array $data Dependencies.
17
     */
18
    public function __construct(array $data = null)
19
    {
20
        parent::__construct($data);
21
22
        $defaultData = $this->metadata()->defaultData();
23
        if ($defaultData) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $defaultData of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
24
            $this->setData($defaultData);
25
        }
26
    }
27
}
28