GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DisplayTabsCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 25
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onlyVisible() 0 4 1
A onlyActive() 0 11 2
1
<?php
2
3
namespace SleepingOwl\Admin\Display;
4
5
use SleepingOwl\Admin\Contracts\Display\TabInterface;
6
use SleepingOwl\Admin\Contracts\Form\FormElementInterface;
7
use SleepingOwl\Admin\Form\FormElementsCollection;
8
9
class DisplayTabsCollection extends FormElementsCollection
10
{
11
    /**
12
     * @return static
13
     */
14
    public function onlyActive()
15
    {
16
        return $this->filter(function (TabInterface $tab) {
17
            $element = $tab->getContent();
18
19
            if ($element instanceof FormElementInterface) {
20
                return ! $element->isReadonly();
21
            }
22
23
            return true;
24
        })->onlyVisible();
25
    }
26
27
    /**
28
     * @return static
29
     */
30
    public function onlyVisible()
31
    {
32
        return $this->filter(function (TabInterface $tab) {
33
            return $tab->isVisible();
0 ignored issues
show
Bug introduced by
The method isVisible() does not exist on SleepingOwl\Admin\Contracts\Display\TabInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to SleepingOwl\Admin\Contracts\Display\TabInterface. ( Ignorable by Annotation )

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

33
            return $tab->/** @scrutinizer ignore-call */ isVisible();
Loading history...
34
        });
35
    }
36
}
37