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.

GetCalendarsResponse::getResponseByType()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 6
c 2
b 1
f 0
dl 0
loc 10
rs 10
cc 4
nc 4
nop 1
1
<?php namespace CalDAVClient\Facade\Responses;
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
/**
16
 * Class GetCalendarsResponse
17
 * @package CalDAVClient\Facade\Responses
18
 */
19
final class GetCalendarsResponse extends GenericMultiCalDAVResponse
20
{
21
    /**
22
     * @return GenericSinglePROPFINDCalDAVResponse
23
     */
24
    protected function buildSingleResponse()
25
    {
26
        return new GetCalendarResponse();
27
    }
28
29
    /**
30
     * @param string $type
31
     * @return array
32
     */
33
    public function getResponseByType($type){
34
        $responses = [];
35
36
        foreach ($this->getResponses() as $response){
37
            if(!$response instanceof GetCalendarResponse) continue;
38
            $resource_types = $response->getResourceType();
39
            if(in_array($type, array_keys($resource_types))) $responses[] = $response;
40
        }
41
42
        return $responses;
43
    }
44
}
45
46