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.
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
36
7
if (!array_key_exists($name, self::MAP_ALGO_TO_CLASS)) {
37
1
throw new \UnexpectedValueException(
38
1
"No compression algorithm '$name'.");
39
}
40
6
$cls = self::MAP_ALGO_TO_CLASS[$name];
41
6
return new $cls();
42
}
43
44
/**
45
* Get the compression algorithm as specified in the given header.
46
*
47
* @param Header $header Header
48
* @throws \UnexpectedValueException If compression algorithm parameter is
49
* not present or algorithm is not supported
50
* @return CompressionAlgorithm
51
*/
52
4
public static function algoByHeader(Header $header) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.