Added class constants support #131
Annotations
10 warnings
Run composer infection:
src/ClassReflection.php#L452
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
--- Original
+++ New
@@ @@
}
public function isInstance(object $object) : bool
{
- return $this->metadata->name === $object::class || $this->reflectClass($object::class)->isSubclassOf($this);
+ return !($this->metadata->name === $object::class) || !$this->reflectClass($object::class)->isSubclassOf($this);
}
public function isInstantiable() : bool
{
|
Run composer infection:
src/MethodReflection.php#L290
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function getTentativeReturnType() : ?\ReflectionType
{
- $this->loadNative();
+
return parent::getTentativeReturnType();
}
/**
|
Run composer infection:
src/NameContext/NameContext.php#L83
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function enterNamespace(?string $namespace = null) : void
{
- $this->leaveNamespace();
+
if ($namespace !== null) {
$this->namespace = self::parse($namespace)->resolve();
}
|
Run composer infection:
src/NameContext/NameContext.php#L109
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
public function addConstantUse(string $name, ?string $alias = null) : void
{
$resolvedName = self::parse($name)->resolve();
- $resolvedAlias = ($alias === null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
+ $resolvedAlias = ($alias !== null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
if (isset($this->constantImportTable[$resolvedAlias])) {
throw new DefaultReflectionException(sprintf('Cannot use constant %s as %s because the name is already in use.', $name, $resolvedAlias));
}
|
Run composer infection:
src/NameContext/NameContext.php#L109
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
public function addConstantUse(string $name, ?string $alias = null) : void
{
$resolvedName = self::parse($name)->resolve();
- $resolvedAlias = ($alias === null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
+ $resolvedAlias = ($alias === null ? new UnqualifiedName($alias) : $resolvedName->lastSegment())->toString();
if (isset($this->constantImportTable[$resolvedAlias])) {
throw new DefaultReflectionException(sprintf('Cannot use constant %s as %s because the name is already in use.', $name, $resolvedAlias));
}
|
Run composer infection:
src/NameContext/NameContext.php#L125
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
public function addFunctionUse(string $name, ?string $alias = null) : void
{
$resolvedName = self::parse($name)->resolve();
- $resolvedAlias = ($alias === null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
+ $resolvedAlias = ($alias !== null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
if (isset($this->functionImportTable[$resolvedAlias])) {
throw new DefaultReflectionException(sprintf('Cannot use constant %s as %s because the name is already in use.', $name, $resolvedAlias));
}
|
Run composer infection:
src/NameContext/NameContext.php#L125
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
public function addFunctionUse(string $name, ?string $alias = null) : void
{
$resolvedName = self::parse($name)->resolve();
- $resolvedAlias = ($alias === null ? $resolvedName->lastSegment() : new UnqualifiedName($alias))->toString();
+ $resolvedAlias = ($alias === null ? new UnqualifiedName($alias) : $resolvedName->lastSegment())->toString();
if (isset($this->functionImportTable[$resolvedAlias])) {
throw new DefaultReflectionException(sprintf('Cannot use constant %s as %s because the name is already in use.', $name, $resolvedAlias));
}
|
Run composer infection:
src/NameContext/NameContext.php#L140
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function enterClass(string $unresolvedName, ?string $unresolvedParentName, bool $trait, bool $final) : void
{
- $this->leaveClass();
+
$this->inClass = true;
if ($trait) {
return;
|
Run composer infection:
src/NameContext/NameContext.php#L154
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
if ($unresolvedParentName !== null) {
$this->namespaceImportTable[self::PARENT] = self::parse($unresolvedParentName)->resolve($this->namespace, $this->namespaceImportTable);
}
- if ($final) {
+ if (!$final) {
$this->namespaceImportTable[self::STATIC] = $this->namespaceImportTable[self::SELF];
}
}
|
Run composer infection:
src/NameContext/NameContext.php#L161
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
}
public function leaveClass() : void
{
- $this->inClass = false;
+ $this->inClass = true;
unset($this->namespaceImportTable[self::SELF], $this->namespaceImportTable[self::PARENT], $this->namespaceImportTable[self::STATIC]);
}
public function leaveNamespace() : void
|
Loading