Passed
Pull Request — master (#5629)
by Angel Fernando Quiroz
10:06 queued 01:32
created

Site   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\PluginBundle\XApi\ToolExperience\Activity;
8
9
use Xabbuh\XApi\Model\Activity;
10
use Xabbuh\XApi\Model\Definition;
11
use Xabbuh\XApi\Model\IRI;
12
use Xabbuh\XApi\Model\LanguageMap;
13
14
/**
15
 * Class Site.
16
 */
17
class Site extends BaseActivity
18
{
19
    public function generate(): Activity
20
    {
21
        $platformLanguageIso = api_get_language_isocode(
22
            api_get_setting('platformLanguage')
23
        );
24
        $platform = api_get_setting('Institution').' - '.api_get_setting('siteName');
0 ignored issues
show
Bug introduced by
Are you sure api_get_setting('Institution') of type array|string can be used in concatenation? ( Ignorable by Annotation )

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

24
        $platform = /** @scrutinizer ignore-type */ api_get_setting('Institution').' - '.api_get_setting('siteName');
Loading history...
Bug introduced by
Are you sure api_get_setting('siteName') of type array|string can be used in concatenation? ( Ignorable by Annotation )

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

24
        $platform = api_get_setting('Institution').' - './** @scrutinizer ignore-type */ api_get_setting('siteName');
Loading history...
25
26
        return new Activity(
27
            IRI::fromString('http://id.tincanapi.com/activitytype/lms'),
28
            new Definition(
29
                LanguageMap::create([$platformLanguageIso => $platform])
30
            )
31
        );
32
    }
33
}
34