Merge pull request #687 from patchlevel/use-reflection-for-child-prop… #5064
Annotations
10 warnings
Infection:
src/Aggregate/AggregateRootAttributeBehaviour.php#L27
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
/** @var (callable(object $event): void)|null */
#[Ignore]
private $recorder = null;
- protected function apply(object $event) : void
+ private function apply(object $event) : void
{
$metadata = static::metadata();
if (!array_key_exists($event::class, $metadata->applyMethods)) {
|
Infection:
src/Aggregate/AggregateRootAttributeBehaviour.php#L68
Escaped Mutant for Mutator "AssignCoalesce":
--- Original
+++ New
@@ @@
private function passRecorderToChildAggregates() : void
{
$metadata = static::metadata();
- $this->recorder ??= $this->recordThat(...);
+ $this->recorder = $this->recordThat(...);
foreach ($metadata->childAggregates as $propertyName) {
$child = $this->getChildAggregateByPropertyName($propertyName);
if ($child === null) {
|
Infection:
src/Aggregate/AggregateRootAttributeBehaviour.php#L97
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
}
public function aggregateRootId() : AggregateRootId
{
- if ($this->cachedAggregateRootId instanceof AggregateRootId) {
+ if (false) {
return $this->cachedAggregateRootId;
}
$metadata = static::metadata();
|
Infection:
src/CommandBus/AggregateHandlerProvider.php#L70
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$this->handlers[$handler->commandClass][] = new HandlerDescriptor(new UpdateAggregateHandler($this->repositoryManager, $aggregateClass, $handler->method, new DefaultParameterResolver($this->container)));
}
}
- $this->initialized = true;
+ $this->initialized = false;
}
}
|
Infection:
src/CommandBus/Handler/UpdateAggregateHandler.php#L35
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$aggregate = $repository->load($aggregateRootId);
$reflection = new ReflectionClass($this->aggregateClass);
$reflectionMethod = $reflection->getMethod($this->methodName);
- $reflectionMethod->invokeArgs($aggregate, [...$this->parameterResolver->resolve($reflectionMethod, $command)]);
+
$repository->save($aggregate);
}
private function aggregateRootId(object $command) : AggregateRootId
|
Infection:
src/CommandBus/HandlerFinder.php#L40
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
$handle = $handleAttributes[0]->newInstance();
if ($handle->commandClass !== null) {
(yield new HandlerReference($handle->commandClass, $reflectionMethod->getName(), $reflectionMethod->isStatic()));
- continue;
+ break;
}
$parameters = $reflectionMethod->getParameters();
if ($parameters === []) {
|
Infection:
src/CommandBus/SyncCommandBus.php#L35
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
/** @throws HandlerNotFound */
public function dispatch(object $command) : void
{
- $this->logger?->debug('CommandBus: dispatch command', ['command' => $command::class]);
+ $this->logger?->debug('CommandBus: dispatch command', []);
$handlers = $this->handlerProvider->handlerForCommand($command::class);
if (!is_array($handlers)) {
$handlers = iterator_to_array($handlers);
|
Infection:
src/Console/Command/DatabaseCreateCommand.php#L49
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$tempConnection = $this->helper->copyConnectionWithoutDatabase($this->connection);
$ifNotExists = InputHelper::bool($input->getOption('if-not-exists'));
$hasDatabase = $this->helper->hasDatabase($tempConnection, $databaseName);
- if ($ifNotExists && $hasDatabase) {
+ if ($ifNotExists || $hasDatabase) {
$console->warning(sprintf('Database "%s" already exists. Skipped.', $databaseName));
$tempConnection->close();
return 0;
|
Infection:
src/Console/Command/DatabaseCreateCommand.php#L51
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$hasDatabase = $this->helper->hasDatabase($tempConnection, $databaseName);
if ($ifNotExists && $hasDatabase) {
$console->warning(sprintf('Database "%s" already exists. Skipped.', $databaseName));
- $tempConnection->close();
+
return 0;
}
try {
|
Infection:
src/Console/Command/DatabaseCreateCommand.php#L61
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$console->success(sprintf('Created database "%s"', $databaseName));
} catch (Throwable $e) {
$console->error(sprintf('Could not create database "%s"', $databaseName));
- $console->error($e->getMessage());
+
$tempConnection->close();
return 2;
}
|
Loading