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.
Passed
Push — master ( 1f9fcc...08d1d9 )
by sebastian
02:54
created

GetCalendarsResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildSingleResponse() 0 3 1
A getResponseByType() 0 7 3
1
<?php
2
/**
3
 * Copyright 2017 OpenStack Foundation
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * Unless required by applicable law or agreed to in writing, software
9
 * distributed under the License is distributed on an "AS IS" BASIS,
10
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
 * See the License for the specific language governing permissions and
12
 * limitations under the License.
13
 **/
14
15
namespace CalDAVClient\Facade\Responses;
16
17
/**
18
 * Class GetCalendarsResponse
19
 * @package CalDAVClient\Facade\Responses
20
 */
21
final class GetCalendarsResponse extends GenericMultiCalDAVResponse
22
{
23
    /**
24
     * @return GenericSinglePROPFINDCalDAVResponse
25
     */
26
    protected function buildSingleResponse()
27
    {
28
        return new GetCalendarResponse();
29
    }
30
31
    /**
32
     * @param string $type
33
     * @return array
34
     */
35
    public function getResponseByType($type){
36
        $responses = [];
37
        foreach ($this->getResponses() as $response){
38
            $resource_types = $response->getResourceType();
0 ignored issues
show
Bug introduced by
The method getResourceType() does not exist on CalDAVClient\Facade\Resp...ePROPFINDCalDAVResponse. It seems like you code against a sub-type of CalDAVClient\Facade\Resp...ePROPFINDCalDAVResponse such as CalDAVClient\Facade\Responses\GetCalendarResponse. ( Ignorable by Annotation )

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

38
            /** @scrutinizer ignore-call */ 
39
            $resource_types = $response->getResourceType();
Loading history...
39
            if(in_array($type, array_keys($resource_types))) $responses[] = $response;
40
        }
41
        return $responses;
42
    }
43
}
44
45