FlowPlayer   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A set_swf_file() 0 4 1
A get_swf_file() 0 4 1
A set_flow_player_config_file() 0 4 1
A get_flow_player_config_file() 0 4 1
A AbsoluteLink() 0 8 1
1
<?php
2
3
/**
4
  *@author nicolaas [at] sunnysideup.co.nz
5
  **/
6
7
class FlowPlayer extends File
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    protected static $swf_file = "flowplayer/thirdparty/flowplayer-3.2.5.swf";
10
    public static function set_swf_file($v)
11
    {
12
        self::$swf_file = $v;
13
    }
14
    public static function get_swf_file()
15
    {
16
        return self::$swf_file;
17
    }
18
19
    protected static $flow_player_config_file = "flowplayer/javascript/FlowPlayerConfig.js";
20
    public static function set_flow_player_config_file($v)
21
    {
22
        self::$flow_player_config_file = $v;
23
    }
24
    public static function get_flow_player_config_file()
25
    {
26
        return self::$flow_player_config_file;
27
    }
28
29
    public function AbsoluteLink($IDString = "FlowPlayer")
30
    {
31
        Requirements::javascript("flowplayer/thirdparty/flowplayer-3.2.4.min.js");
32
        Requirements::javascript(self::get_flow_player_config_file());
33
        Requirements::customScript('$f("'.$IDString.'", "'.self::get_swf_file().'", FlowPlayerConfig);', "FlowPlayerSWF");
0 ignored issues
show
Documentation introduced by
'$f("' . $IDString . '",...'", FlowPlayerConfig);' is of type string, but the function expects a object<The>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
'FlowPlayerSWF' is of type string, but the function expects a object<Use>|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
34
        Requirements::themedCSS("FlowPlayer");
35
        return $this->getAbsoluteURL();
36
    }
37
}
38