Completed
Push — master ( 04c44f...f6f21a )
by Oscar
02:41
created

Config::getDirectory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Demo\Entities;
4
5
use Folk\Entities\FlyCrud;
6
use Folk\Formats\Group;
7
use Folk\Formats\FormatFactory;
8
use FlyCrud\Directory;
9
use FlyCrud\Formats\Json;
10
11
class Config extends FlyCrud
12
{
13
    protected function getDirectory(): Directory
14
    {
15
        return Directory::make(dirname(__DIR__), new Json());
16
    }
17
18
    public function getScheme(FormatFactory $builder): Group
19
    {
20
        return $builder->group([
0 ignored issues
show
Documentation Bug introduced by
The method group does not exist on object<Folk\Formats\FormatFactory>? 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...
21
            'dev' => $builder->checkbox()->label('Dev mode')
0 ignored issues
show
Documentation Bug introduced by
The method checkbox does not exist on object<Folk\Formats\FormatFactory>? 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...
22
        ]);
23
    }
24
}
25