Passed
Push — master ( 4dd324...c74dc6 )
by Leandro
09:57
created

SportsBag::wearBag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ItsMeLePassos\HandBag\Bags;
4
5
use ItsMeLePassos\HandBag\Bag;
6
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class SportsBag extends Bag
9
{
10
    private string $relatedTo;
11
12
    public function setRelatedTo(string|array $relatedTo): void
13
    {
14
        $relatedTo = array_filter($relatedTo);
15
        $relatedTo = implode(", ", $relatedTo);
16
        $this->relatedTo = $relatedTo;
17
    }
18
19
    public function getRelatedTo(): string
20
    {
21
        $relatedTo = "<h2>Esta bolsa é relacionada ao(s) esporte(s)</h2>";
22
        $relatedTo .= "<p>{$this->relatedTo}</p>";
23
24
        return $relatedTo;
25
    }
26
27
    /**
28
     * This function overrides the parent class function
29
     *
30
     * @return string
31
     */
32
    public function wearBag(): string
33
    {
34
        return "Para todos os viciados em esporte!";
35
    }
36
}
37