BlocksPageController::BodyClass()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace LeKoala\Blocks;
4
5
use PageController;
6
7
/**
8
 * Extend page controller
9
 *
10
 * @property \LeKoala\Blocks\BlocksPage dataRecord
11
 * @method \LeKoala\Blocks\BlocksPage data()
12
 * @mixin \LeKoala\Blocks\BlocksPage dataRecord
13
 */
14
class BlocksPageController extends PageController
15
{
16
    public function BodyClass()
17
    {
18
        $class = parent::BodyClass();
0 ignored issues
show
introduced by
The method BodyClass() does not exist on PageController. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        /** @scrutinizer ignore-call */ 
19
        $class = parent::BodyClass();
Loading history...
19
20
        $arr = $this->data()->getBlocksListArray();
21
        if (!empty($arr)) {
22
            $class .= ' Starts-' . $arr[0];
23
        }
24
25
        return $class;
26
    }
27
}
28