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 ( 9d7a62...7e48e6 )
by Rob
03:32
created

StaticCalling::callStatic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace RattfieldNz\SafeUrls\Libraries\Traits;
4
5
trait StaticCalling
6
{
7
    /**
8
     * Performs a static method call
9
     *
10
     * Note that parent::class should be used instead of 'parent'
11
     * to refer to the actual parent class.
12
     *
13
     * @param  string $className  Name of the class
14
     * @param  string $methodName Name of the method
15
     * @return mixed
16
     * @see    https://www.pagemachine.de/blog/mocking-static-method-calls/.
17
     */
18
    public function callStatic($className, $methodName)
19
    {
20
        $parameters = func_get_args();
21
        $parameters = array_slice($parameters, 2); // Remove $className and $methodName
22
23
        return call_user_func_array($className . '::' . $methodName, $parameters);
24
    }
25
}
26