ThickBox   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A include_code() 0 5 1
A block() 0 5 1
A setAlternativeLoadingImage() 0 4 1
1
<?php
2
3
4
class ThickBox extends Object
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...
5
{
6
    public static function include_code()
7
    {
8
        Requirements::javascript('thickbox/javascript/jquery.thickbox.js');
9
        Requirements::css('thickbox/css/thickbox.css');
10
    }
11
12
    public static function block()
13
    {
14
        Requirements::block('thickbox/javascript/jquery.thickbox.js');
0 ignored issues
show
Documentation introduced by
'thickbox/javascript/jquery.thickbox.js' is of type string, but the function expects a object<unknown_type>.

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...
15
        Requirements::block('thickbox/css/thickbox.css');
0 ignored issues
show
Documentation introduced by
'thickbox/css/thickbox.css' is of type string, but the function expects a object<unknown_type>.

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...
16
    }
17
18
    public static function setAlternativeLoadingImage($location = "thickbox/images/loading.gif")
19
    {
20
        Requirements::customScript('var tb_pathToImage = "'.$location.'";');
0 ignored issues
show
Documentation introduced by
'var tb_pathToImage = "' . $location . '";' 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...
21
    }
22
}
23