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.

OrAbort   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 25 5
1
<?php
2
3
namespace Spatie\OrAbort;
4
5
use ReflectionMethod;
6
7
trait OrAbort
8
{
9
    public function __call($methodName, array $args)
10
    {
11
        if (ends_with($methodName, 'OrAbort')) {
0 ignored issues
show
Deprecated Code introduced by
The function ends_with() has been deprecated with message: Str::endsWith() should be used directly instead. Will be removed in Laravel 6.0.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
12
            $realMethodName = substr($methodName, 0, -7);
13
14
            $abortCode = null;
15
16
            $originalMethodParameterCount = (new ReflectionMethod($this, $realMethodName))->getNumberOfParameters();
17
18
            if (($originalMethodParameterCount + 1) == count($args)) {
19
                $abortCode = array_pop($args);
20
            }
21
22
            $originalMethodResult = call_user_func_array([$this, $realMethodName], $args);
23
24
            if ($originalMethodResult == false) {
25
                return abort($abortCode ?: 404);
26
            }
27
28
            return $originalMethodResult;
29
        }
30
31
32
        trigger_error('Call to undefined method '.__CLASS__.'::'.$methodName.'()', E_USER_ERROR);
33
    }
34
}
35