Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

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 ( 05966a...c37768 )
by Der Mundschenk
13s
created

File_Operations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_http_response_code() 0 13 1
1
<?php
2
/**
3
 *  This file is part of PHP-Typography.
4
 *
5
 *  Copyright 2017 Peter Putzer.
6
 *
7
 *  This program is free software; you can redistribute it and/or
8
 *  modify it under the terms of the GNU General Public License
9
 *  as published by the Free Software Foundation; either version 2
10
 *  of the License, or (at your option) any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program; if not, write to the Free Software
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 *
21
 *  ***
22
 *
23
 *  @package mundschenk-at/php-typography
24
 *  @author Peter Putzer <[email protected]>
25
 *  @license http://www.gnu.org/licenses/gpl-2.0.html
26
 */
27
28
namespace PHP_Typography\Bin;
29
30
/**
31
 * Encapsulate some common file operations (including on remote files).
32
 */
33
abstract class File_Operations {
34
35
	/**
36
	 * Retrieve a HTTP response code via cURL.
37
	 *
38
	 * @param  string $url Required.
39
	 *
40
	 * @return int
41
	 */
42
	public static function get_http_response_code( $url ) {
43
44
		$curl = curl_init();
0 ignored issues
show
introduced by
Using cURL functions is highly discouraged within VIP context. Check (Fetching Remote Data) on VIP Documentation.
Loading history...
45
		curl_setopt_array( $curl, [
0 ignored issues
show
introduced by
Using cURL functions is highly discouraged within VIP context. Check (Fetching Remote Data) on VIP Documentation.
Loading history...
46
			CURLOPT_RETURNTRANSFER => true,
47
			CURLOPT_URL            => $url,
48
		] );
49
		curl_exec( $curl );
0 ignored issues
show
introduced by
Using cURL functions is highly discouraged within VIP context. Check (Fetching Remote Data) on VIP Documentation.
Loading history...
50
		$response_code = curl_getinfo( $curl, CURLINFO_HTTP_CODE );
0 ignored issues
show
introduced by
Using cURL functions is highly discouraged within VIP context. Check (Fetching Remote Data) on VIP Documentation.
Loading history...
51
		curl_close( $curl );
0 ignored issues
show
introduced by
Using cURL functions is highly discouraged within VIP context. Check (Fetching Remote Data) on VIP Documentation.
Loading history...
52
53
		return $response_code;
54
	}
55
}
56