Cs #123
Annotations
10 errors and 10 warnings
|
phpstan:
src/HtmlVisitor.php#L492
Match expression does not handle remaining value: string
|
|
phpstan:
src/HtmlVisitor.php#L489
Match expression does not handle remaining value: class-string<Graphpinator\Value\InputedValue>&literal-string
|
|
phpstan:
src/HtmlVisitor.php#L418
Function preg_replace is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\preg_replace;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
|
|
phpstan:
src/HtmlVisitor.php#L417
Function preg_replace is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\preg_replace;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
|
|
phpstan:
src/HtmlVisitor.php#L414
Function preg_match_all is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\preg_match_all;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
|
|
phpstan:
src/HtmlVisitor.php#L382
Parameter #1 $type of static method Graphpinator\Printer\HtmlVisitor::printNamedTypeLink() expects Graphpinator\Typesystem\Contract\NamedType, Graphpinator\Typesystem\Contract\Type given.
|
|
phpstan:
src/HtmlVisitor.php#L339
Function preg_replace is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\preg_replace;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
|
|
phpstan:
src/HtmlVisitor.php#L337
Function preg_replace is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\preg_replace;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
|
|
phpstan:
src/HtmlVisitor.php#L312
Only booleans are allowed in an if condition, int<0, max> given.
|
|
phpstan:
src/HtmlVisitor.php#L186
Method Graphpinator\Printer\HtmlVisitor::visitScalar() has parameter $scalar with generic class Graphpinator\Typesystem\ScalarType but does not specify its types: T
|
|
mutation:
src/HtmlVisitor.php#L492
Escaped Mutant for Mutator "MatchArmRemoval":
@@ @@
EnumValue::class => 'enum-literal',
ScalarValue::class => match (\get_debug_type($value->getRawValue())) {
'bool' => $value->getRawValue() ? 'true' : 'false',
- 'int' => 'int-literal',
'float' => 'float-literal',
'string' => 'string-literal',
},
|
|
mutation:
src/HtmlVisitor.php#L489
Escaped Mutant for Mutator "MatchArmRemoval":
@@ @@
{
$className = match ($value::class) {
NullValue::class => 'null',
- EnumValue::class => 'enum-literal',
ScalarValue::class => match (\get_debug_type($value->getRawValue())) {
'bool' => $value->getRawValue() ? 'true' : 'false',
'int' => 'int-literal',
|
|
mutation:
src/HtmlVisitor.php#L469
Escaped Mutant for Mutator "FalseValue":
@@ @@
private function printItems(FieldSet|ArgumentSet|EnumItemSet $set): string
{
$result = '';
- $previousHasDescription = false;
+ $previousHasDescription = true;
$isFirst = true;
foreach ($set as $item) {
$currentHasDescription = $item->getDescription() !== null;
|
|
mutation:
src/HtmlVisitor.php#L458
Escaped Mutant for Mutator "Assignment":
@@ @@
{
$return = '';
foreach ($set as $directiveUsage) {
- $return .= $directiveUsage->accept($this);
+ $return = $directiveUsage->accept($this);
}
return $return;
}
|
|
mutation:
src/HtmlVisitor.php#L420
Escaped Mutant for Mutator "Assignment":
@@ @@
$match = \preg_replace('/(?<=>).*?(?=<)/', self::LINK_TEXTS[$index], $match);
$match = \preg_replace('/(?<=title=").*?(?=")/', self::LINK_TITLES[$index], $match);
$match = \str_replace('class="typename"', 'class="floating-button"', $match);
- $result .= $match;
+ $result = $match;
}
return <<<EOL
<div class="floating-container">
|
|
mutation:
src/HtmlVisitor.php#L416
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
$result = '';
$matches = [];
\preg_match_all('/(<a .+?<\/a>)/', $schemaString, $matches);
- foreach ($matches[0] as $index => $match) {
+ foreach ($matches[1] as $index => $match) {
$match = \preg_replace('/(?<=>).*?(?=<)/', self::LINK_TEXTS[$index], $match);
$match = \preg_replace('/(?<=title=").*?(?=")/', self::LINK_TITLES[$index], $match);
$match = \str_replace('class="typename"', 'class="floating-button"', $match);
|
|
mutation:
src/HtmlVisitor.php#L342
Escaped Mutant for Mutator "UnwrapStrReplace":
@@ @@
// Replace whitespace between tags but leave out
$html = \preg_replace('/>((\s+( ){1}\s*)|(\s*( ){1}\s+))</', '> <', $html);
// Replace empty line div with empty line containing (empty divs are ignored by browsers)
- return \str_replace('<div class="line"></div>', self::emptyLine(), $html);
+ return $html;
}
private static function generateRootTypeLink(Type $type, string $rootType): string
{
|
|
mutation:
src/HtmlVisitor.php#L302
Escaped Mutant for Mutator "Continue_":
@@ @@
foreach ($directiveUsage->getArgumentValues() as $argument) {
// do not print default value
if ($argument->getValue()->getRawValue() === $argument->getArgument()->getDefaultValue()?->getValue()->getRawValue()) {
- continue;
+ break;
}
$printableArgument = '<span class="argument-name">' . $argument->getArgument()->getName() . '</span>';
$printableArgument .= '<span class="colon">:</span> ';
|
|
mutation:
src/HtmlVisitor.php#L277
Escaped Mutant for Mutator "Assignment":
@@ @@
$defaultValue = '';
$link = '<span class="argument-type">' . self::printTypeLink($argument->getType()) . '</span>';
if ($argument->getDefaultValue() instanceof ArgumentValue) {
- $defaultValue .= ' <span class="equals">=</span> ';
+ $defaultValue = ' <span class="equals">=</span> ';
$defaultValue .= '<span class="argument-value">' . $this->printValue($argument->getDefaultValue()->getValue()) . '</span>';
}
return <<<EOL
|
|
mutation:
src/HtmlVisitor.php#L49
Escaped Mutant for Mutator "Coalesce":
@@ @@
private FieldCollector $fieldCollector;
public function __construct(?FieldCollector $fieldCollector = null)
{
- $this->fieldCollector = $fieldCollector ?? new AllFieldCollector();
+ $this->fieldCollector = new AllFieldCollector() ?? $fieldCollector;
}
#[\Override]
public function visitSchema(Schema $schema): string
|