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 ( 2e65de...a5ebf2 )
by Lukáš
01:47
created

Helpers   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B initTempDir() 0 11 5
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\Nette\Proxy\Tests;
5
6
class Helpers
7
{
8
	/**
9
	 * @param string $path
10
	 */
11
	public static function initTempDir(string $path)
12
	{
13
		if (!@mkdir($path, 0777, true) && !is_dir($path)) {
14
			throw new \RuntimeException(sprintf('Cannot create temp directory %s', $path));
15
		}
16
17
		/** @var \SplFileInfo $entry */
18
		foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $entry) {
19
			$entry->isDir() ? rmdir((string) $entry) : unlink((string) $entry);
20
		}
21
	}
22
}
23