Completed
Push — master ( bafc2b...789f6f )
by Oscar
03:26
created

Choose::customRender()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Folk\Formats;
4
5
use FormManager\Fields;
6
use FormManager\Builder;
7
8
class Choose extends Fields\Choose implements FormatInterface
9
{
10
    use Traits\LabelTrait;
11
    use Traits\HtmlValueTrait;
12
13
    public function __construct(Builder $builder, array $children = null)
14
    {
15
        parent::__construct($children);
16
17
        $this->set('list', true);
18
        $this->class('format is-choose');
0 ignored issues
show
Documentation Bug introduced by
The method class does not exist on object<Folk\Formats\Choose>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
19
    }
20
}
21