class Complexity
@psalm-immutable
Hierarchy
- class \SebastianBergmann\Complexity\Complexity
Expanded class hierarchy of Complexity
3 string references to 'Complexity'
- Clover::process in vendor/
phpunit/ php-code-coverage/ src/ Report/ Clover.php - Cobertura::process in vendor/
phpunit/ php-code-coverage/ src/ Report/ Cobertura.php - Crap4j::process in vendor/
phpunit/ php-code-coverage/ src/ Report/ Crap4j.php
File
-
vendor/
sebastian/ complexity/ src/ Complexity/ Complexity.php, line 17
Namespace
SebastianBergmann\ComplexityView source
final class Complexity {
/**
* @psalm-var non-empty-string
*/
private readonly string $name;
/**
* @psalm-var positive-int
*/
private int $cyclomaticComplexity;
/**
* @psalm-param non-empty-string $name
* @psalm-param positive-int $cyclomaticComplexity
*/
public function __construct(string $name, int $cyclomaticComplexity) {
$this->name = $name;
$this->cyclomaticComplexity = $cyclomaticComplexity;
}
/**
* @psalm-return non-empty-string
*/
public function name() : string {
return $this->name;
}
/**
* @psalm-return positive-int
*/
public function cyclomaticComplexity() : int {
return $this->cyclomaticComplexity;
}
public function isFunction() : bool {
return !$this->isMethod();
}
public function isMethod() : bool {
return str_contains($this->name, '::');
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
Complexity::$cyclomaticComplexity | private | property | @psalm-var positive-int |
Complexity::$name | private | property | @psalm-var non-empty-string |
Complexity::cyclomaticComplexity | public | function | @psalm-return positive-int |
Complexity::isFunction | public | function | |
Complexity::isMethod | public | function | |
Complexity::name | public | function | @psalm-return non-empty-string |
Complexity::__construct | public | function | @psalm-param non-empty-string $name @psalm-param positive-int $cyclomaticComplexity |