Skip to content

Working on tests

Working on tests #25

Triggered via push June 30, 2024 13:36
Status Success
Total duration 1m 7s
Artifacts

ci.yaml

on: push
Coding Standard & Static Analysis
24s
Coding Standard & Static Analysis
Matrix: Unittests
Fit to window
Zoom out
Zoom in

Annotations

21 warnings
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L54
Escaped Mutant for Mutator "IfNegation": @@ @@ $reflectionClass = new ReflectionClass($this); $domainEventsProperty = $this->findDomainEventsProperty($reflectionClass); if ($domainEventsProperty !== null) { - if ($domainEventsProperty->isPrivate()) { + if (!$domainEventsProperty->isPrivate()) { $domainEventsProperty->setAccessible(true); } $events = $domainEventsProperty->getValue($this);
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L82
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ } return null; } - protected function getEventNameFromEvent(object $event): string + private function getEventNameFromEvent(object $event): string { $eventClass = get_class($event); $eventName = ucfirst(substr($eventClass, strrpos($eventClass, '\\') + 1));
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L85
Escaped Mutant for Mutator "UnwrapUcFirst": @@ @@ protected function getEventNameFromEvent(object $event): string { $eventClass = get_class($event); - $eventName = ucfirst(substr($eventClass, strrpos($eventClass, '\\') + 1)); + $eventName = substr($eventClass, strrpos($eventClass, '\\') + 1); if (!empty(static::EVENT_METHOD_SUFFIX)) { $eventName = substr($eventName, 0, -strlen(static::EVENT_METHOD_SUFFIX)); }
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L100
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws MissingEventHandlerException */ - protected function assertEventHandlerExists(object $event, string $eventName): void + private function assertEventHandlerExists(object $event, string $eventName): void { if (method_exists($this, $eventName)) { return;
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L113
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ } throw MissingEventHandlerException::withNameAndClass($eventName, get_class($event), get_class($this)); } - protected function assertEventMatchesAggregate(object $event): void + private function assertEventMatchesAggregate(object $event): void { if ($event instanceof AggregateIdentityProvidingEventInterface && $this->aggregateId !== $event->getAggregateId()) { throw EventMismatchException::eventDoesNotMatchAggregateWith($event, $this);
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L131
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws EventMismatchException|MissingEventHandlerException */ - protected function applyEvent(object $event): void + private function applyEvent(object $event): void { $eventName = $this->getEventNameFromEvent($event); $this->assertEventHandlerExists($event, $eventName);
Coding Standard & Static Analysis: src/Aggregate/AbstractEventSourcedAggregate.php#L161
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws AggregateEventVersionMismatchException */ - protected function assertNextVersion(int $eventVersion): void + private function assertNextVersion(int $eventVersion): void { if ($this->aggregateVersion + 1 !== $eventVersion) { throw AggregateEventVersionMismatchException::fromVersions($this->aggregateVersion, $eventVersion);
Coding Standard & Static Analysis: src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L46
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ $aggregateEvents = $this->extractAggregateEvents($reflectionClass, $aggregate); return new AggregateData(aggregateId: $aggregateId, aggregateType: $aggregateType, version: $aggregateVersion, events: $aggregateEvents); } - protected function assertPropertyHasName(ReflectionClass $reflectionClass, string $name): void + private function assertPropertyHasName(ReflectionClass $reflectionClass, string $name): void { if (!$reflectionClass->hasProperty($name)) { throw new ExtractorException(sprintf('Property %s not found in %s', $name, $reflectionClass->getName()));
Coding Standard & Static Analysis: src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L57
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ throw new ExtractorException(sprintf('Property %s not found in %s', $name, $reflectionClass->getName())); } } - protected function extractAggregateTypeFromAggregate(object $aggregate, EventSourcedAggregate $aggregateAttribute, ReflectionClass $reflectionClass): string + private function extractAggregateTypeFromAggregate(object $aggregate, EventSourcedAggregate $aggregateAttribute, ReflectionClass $reflectionClass): string { $aggregateType = get_class($aggregate); if ($aggregateAttribute->aggregateType !== null) {
Coding Standard & Static Analysis: src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L77
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * * @return array<ReflectionAttribute> */ - protected function getAttributes(ReflectionClass $reflectionClass): array + private function getAttributes(ReflectionClass $reflectionClass): array { return $reflectionClass->getAttributes(EventSourcedAggregate::class); }
Unittests (8.2)
Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L54
Escaped Mutant for Mutator "IfNegation": @@ @@ $reflectionClass = new ReflectionClass($this); $domainEventsProperty = $this->findDomainEventsProperty($reflectionClass); if ($domainEventsProperty !== null) { - if ($domainEventsProperty->isPrivate()) { + if (!$domainEventsProperty->isPrivate()) { $domainEventsProperty->setAccessible(true); } $events = $domainEventsProperty->getValue($this);
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L82
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ } return null; } - protected function getEventNameFromEvent(object $event): string + private function getEventNameFromEvent(object $event): string { $eventClass = get_class($event); $eventName = ucfirst(substr($eventClass, strrpos($eventClass, '\\') + 1));
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L85
Escaped Mutant for Mutator "UnwrapUcFirst": @@ @@ protected function getEventNameFromEvent(object $event): string { $eventClass = get_class($event); - $eventName = ucfirst(substr($eventClass, strrpos($eventClass, '\\') + 1)); + $eventName = substr($eventClass, strrpos($eventClass, '\\') + 1); if (!empty(static::EVENT_METHOD_SUFFIX)) { $eventName = substr($eventName, 0, -strlen(static::EVENT_METHOD_SUFFIX)); }
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L100
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws MissingEventHandlerException */ - protected function assertEventHandlerExists(object $event, string $eventName): void + private function assertEventHandlerExists(object $event, string $eventName): void { if (method_exists($this, $eventName)) { return;
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L113
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ } throw MissingEventHandlerException::withNameAndClass($eventName, get_class($event), get_class($this)); } - protected function assertEventMatchesAggregate(object $event): void + private function assertEventMatchesAggregate(object $event): void { if ($event instanceof AggregateIdentityProvidingEventInterface && $this->aggregateId !== $event->getAggregateId()) { throw EventMismatchException::eventDoesNotMatchAggregateWith($event, $this);
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L131
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws EventMismatchException|MissingEventHandlerException */ - protected function applyEvent(object $event): void + private function applyEvent(object $event): void { $eventName = $this->getEventNameFromEvent($event); $this->assertEventHandlerExists($event, $eventName);
Unittests (8.2): src/Aggregate/AbstractEventSourcedAggregate.php#L161
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * @return void * @throws AggregateEventVersionMismatchException */ - protected function assertNextVersion(int $eventVersion): void + private function assertNextVersion(int $eventVersion): void { if ($this->aggregateVersion + 1 !== $eventVersion) { throw AggregateEventVersionMismatchException::fromVersions($this->aggregateVersion, $eventVersion);
Unittests (8.2): src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L46
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ $aggregateEvents = $this->extractAggregateEvents($reflectionClass, $aggregate); return new AggregateData(aggregateId: $aggregateId, aggregateType: $aggregateType, version: $aggregateVersion, events: $aggregateEvents); } - protected function assertPropertyHasName(ReflectionClass $reflectionClass, string $name): void + private function assertPropertyHasName(ReflectionClass $reflectionClass, string $name): void { if (!$reflectionClass->hasProperty($name)) { throw new ExtractorException(sprintf('Property %s not found in %s', $name, $reflectionClass->getName()));
Unittests (8.2): src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L57
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ throw new ExtractorException(sprintf('Property %s not found in %s', $name, $reflectionClass->getName())); } } - protected function extractAggregateTypeFromAggregate(object $aggregate, EventSourcedAggregate $aggregateAttribute, ReflectionClass $reflectionClass): string + private function extractAggregateTypeFromAggregate(object $aggregate, EventSourcedAggregate $aggregateAttribute, ReflectionClass $reflectionClass): string { $aggregateType = get_class($aggregate); if ($aggregateAttribute->aggregateType !== null) {
Unittests (8.2): src/Repository/AggregateExtractor/AttributeBasedExtractor.php#L77
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * * @return array<ReflectionAttribute> */ - protected function getAttributes(ReflectionClass $reflectionClass): array + private function getAttributes(ReflectionClass $reflectionClass): array { return $reflectionClass->getAttributes(EventSourcedAggregate::class); }