WordPress / Requests

@@ -58,7 +58,7 @@
Loading
58 58
	 */
59 59
	public static function get_class($code) {
60 60
		if (!$code) {
61 -
			return 'Requests_Exception_HTTP_Unknown';
61 +
			return Requests_Exception_HTTP_Unknown::class;
62 62
		}
63 63
64 64
		$class = sprintf('Requests_Exception_HTTP_%d', $code);
@@ -66,6 +66,6 @@
Loading
66 66
			return $class;
67 67
		}
68 68
69 -
		return 'Requests_Exception_HTTP_Unknown';
69 +
		return Requests_Exception_HTTP_Unknown::class;
70 70
	}
71 71
}

@@ -153,7 +153,7 @@
Loading
153 153
	 * @codeCoverageIgnore
154 154
	 */
155 155
	public static function register_autoloader() {
156 -
		spl_autoload_register(array('Requests', 'autoloader'));
156 +
		spl_autoload_register(array(static::class, 'autoloader'));
157 157
	}
158 158
159 159
	/**
@@ -164,8 +164,8 @@
Loading
164 164
	public static function add_transport($transport) {
165 165
		if (empty(self::$transports)) {
166 166
			self::$transports = array(
167 -
				'Requests_Transport_cURL',
168 -
				'Requests_Transport_fsockopen',
167 +
				Requests_Transport_cURL::class,
168 +
				Requests_Transport_fsockopen::class,
169 169
			);
170 170
		}
171 171
@@ -194,8 +194,8 @@
Loading
194 194
195 195
		if (empty(self::$transports)) {
196 196
			self::$transports = array(
197 -
				'Requests_Transport_cURL',
198 -
				'Requests_Transport_fsockopen',
197 +
				Requests_Transport_cURL::class,
198 +
				Requests_Transport_fsockopen::class,
199 199
			);
200 200
		}
201 201
@@ -430,7 +430,7 @@
Loading
430 430
		$options = array_merge(self::get_default_options(true), $options);
431 431
432 432
		if (!empty($options['hooks'])) {
433 -
			$options['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));
433 +
			$options['hooks']->register('transport.internal.parse_response', array(static::class, 'parse_multiple'));
434 434
			if (!empty($options['complete'])) {
435 435
				$options['hooks']->register('multiple.request.complete', $options['complete']);
436 436
			}
@@ -461,7 +461,7 @@
Loading
461 461
462 462
			// Ensure we only hook in once
463 463
			if ($request['options']['hooks'] !== $options['hooks']) {
464 -
				$request['options']['hooks']->register('transport.internal.parse_response', array('Requests', 'parse_multiple'));
464 +
				$request['options']['hooks']->register('transport.internal.parse_response', array(static::class, 'parse_multiple'));
465 465
				if (!empty($request['options']['complete'])) {
466 466
					$request['options']['hooks']->register('multiple.request.complete', $request['options']['complete']);
467 467
				}
Files Complexity Coverage
library 776 93.10%
Project Totals (21 files) 776 93.10%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading