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.
Completed
Push — master ( b5dfb6...a568a9 )
by Mario
40:05
created

getNbResults()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\Core\Pagination;
6
7 View Code Duplication
class InformationCollectionContentsAdapter extends BaseAdapter
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    public function getNbResults()
10
    {
11
        if (!isset($this->nbResults)) {
12
            $this->nbResults = $this->informationCollectionService
0 ignored issues
show
Bug introduced by
The property nbResults does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
13
                ->getObjectsWithCollections($this->getCountQuery())
14
                ->count;
15
        }
16
17
        return $this->nbResults;
18
    }
19
20
    public function getSlice($offset, $length)
21
    {
22
        $objects = $this->informationCollectionService
23
            ->getObjectsWithCollections($this->getQuery($offset, $length))
24
            ->contents;
25
26
        $this->getNbResults();
27
28
        return $objects;
29
    }
30
}
31