Skip to content

Expose contracts

Expose contracts #189

Triggered via pull request January 17, 2025 23:14
Status Success
Total duration 2m 2s
Artifacts

test.yml

on: pull_request
Matrix: deptrac
Matrix: infection
Matrix: unit-tests
Fit to window
Zoom out
Zoom in

Annotations

42 warnings
deptrac (ubuntu-24.04, 8.1)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
infection (ubuntu-24.04, 8.3)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
deptrac (ubuntu-24.04, 8.3)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
infection (ubuntu-24.04, 8.2)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
infection (ubuntu-24.04, 8.1)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
deptrac (ubuntu-24.04, 8.2)
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
deptrac (ubuntu-24.04, 8.1)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
deptrac (ubuntu-24.04, 8.3)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
deptrac (ubuntu-24.04, 8.2)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
infection (ubuntu-24.04, 8.3): src/Contract/Analyser/EventHelper.php#L41
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ public function shouldViolationBeSkipped(string $depender, string $dependent) : bool { $skippedViolation = $this->skippedViolations[$depender] ?? []; - $matched = [] !== $skippedViolation && in_array($dependent, $skippedViolation, true); + $matched = [] !== $skippedViolation || in_array($dependent, $skippedViolation, true); if (!$matched) { return false; }
infection (ubuntu-24.04, 8.3): src/Contract/Ast/AstMap/FileReference.php#L35
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ /** @psalm-suppress ImpureFunctionCall */ $this->classLikeReferences = array_map(fn(ClassLikeReference $classReference): ClassLikeReference => $classReference->withFileReference($this), $classLikeReferences); /** @psalm-suppress ImpureFunctionCall */ - $this->functionReferences = array_map(fn(FunctionReference $functionReference): FunctionReference => $functionReference->withFileReference($this), $functionReferences); + $this->functionReferences = $functionReferences; } public function getFilepath() : string {
infection (ubuntu-24.04, 8.3): src/Contract/Config/CollectorConfig.php#L20
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ return $this; } /** @return array{'type': string, 'private': bool, ...} */ - public function toArray() : array + protected function toArray() : array { return ['type' => $this->collectorType->value, 'private' => $this->private]; } }
infection (ubuntu-24.04, 8.3): src/Contract/Config/DeptracConfig.php#L134
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->formatters) { $config['formatters'] = array_map(static fn(FormatterConfigInterface $formatterConfig) => $formatterConfig->toArray(), $this->formatters); } - if ([] !== $this->excludeFiles) { + if ([] === $this->excludeFiles) { $config['exclude_files'] = $this->excludeFiles; } if ([] !== $this->layers) {
infection (ubuntu-24.04, 8.3): src/Contract/Config/DeptracConfig.php#L146
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->rulesets) { $config['ruleset'] = array_map(static fn(Ruleset $rulesetConfig) => $rulesetConfig->toArray(), $this->rulesets); } - if ([] !== $this->skipViolations) { + if ([] === $this->skipViolations) { $config['skip_violations'] = $this->skipViolations; } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses;
infection (ubuntu-24.04, 8.3): src/Contract/Config/DeptracConfig.php#L153
Escaped Mutant for Mutator "ArrayOneItem": --- Original +++ New @@ @@ } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses; $config['cache_file'] = $this->cacheFile; - return $config; + return count($config) > 1 ? array_slice($config, 0, 1, true) : $config; } public function getExtensionAlias() : string {
infection (ubuntu-24.04, 8.3): src/Core/Ast/AstMap.php#L101
Escaped Mutant for Mutator "AssignCoalesce": --- Original +++ New @@ @@ */ private function recursivelyResolveDependencies(AstInherit $inheritDependency, ?ArrayObject $alreadyResolved = null, ?SplStack $pathStack = null) : iterable { - $alreadyResolved ??= new ArrayObject(); + $alreadyResolved = new ArrayObject(); /** @var ArrayObject<string, true> $alreadyResolved */ if (null === $pathStack) { /** @var SplStack<AstInherit> $pathStack */
infection (ubuntu-24.04, 8.3): src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php#L26
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ } public function set(FileReference $fileReference) : void { - $filepath = (string) realpath($fileReference->filepath); + $filepath = realpath($fileReference->filepath); $this->cache[$filepath] = $fileReference; } }
infection (ubuntu-24.04, 8.3): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ private function resolvePHPParserType(TypeScope $typeScope, NodeAbstract $node) : array { return match (true) { - $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types),
infection (ubuntu-24.04, 8.3): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), - $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), $node instanceof IntersectionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), default => [], };
infection (ubuntu-24.04, 8.3)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
infection (ubuntu-24.04, 8.1): src/Contract/Analyser/EventHelper.php#L41
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ public function shouldViolationBeSkipped(string $depender, string $dependent) : bool { $skippedViolation = $this->skippedViolations[$depender] ?? []; - $matched = [] !== $skippedViolation && in_array($dependent, $skippedViolation, true); + $matched = [] !== $skippedViolation || in_array($dependent, $skippedViolation, true); if (!$matched) { return false; }
infection (ubuntu-24.04, 8.1): src/Contract/Ast/AstMap/FileReference.php#L35
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ /** @psalm-suppress ImpureFunctionCall */ $this->classLikeReferences = array_map(fn(ClassLikeReference $classReference): ClassLikeReference => $classReference->withFileReference($this), $classLikeReferences); /** @psalm-suppress ImpureFunctionCall */ - $this->functionReferences = array_map(fn(FunctionReference $functionReference): FunctionReference => $functionReference->withFileReference($this), $functionReferences); + $this->functionReferences = $functionReferences; } public function getFilepath() : string {
infection (ubuntu-24.04, 8.1): src/Contract/Config/CollectorConfig.php#L20
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ return $this; } /** @return array{'type': string, 'private': bool, ...} */ - public function toArray() : array + protected function toArray() : array { return ['type' => $this->collectorType->value, 'private' => $this->private]; } }
infection (ubuntu-24.04, 8.1): src/Contract/Config/DeptracConfig.php#L134
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->formatters) { $config['formatters'] = array_map(static fn(FormatterConfigInterface $formatterConfig) => $formatterConfig->toArray(), $this->formatters); } - if ([] !== $this->excludeFiles) { + if ([] === $this->excludeFiles) { $config['exclude_files'] = $this->excludeFiles; } if ([] !== $this->layers) {
infection (ubuntu-24.04, 8.1): src/Contract/Config/DeptracConfig.php#L146
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->rulesets) { $config['ruleset'] = array_map(static fn(Ruleset $rulesetConfig) => $rulesetConfig->toArray(), $this->rulesets); } - if ([] !== $this->skipViolations) { + if ([] === $this->skipViolations) { $config['skip_violations'] = $this->skipViolations; } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses;
infection (ubuntu-24.04, 8.1): src/Contract/Config/DeptracConfig.php#L153
Escaped Mutant for Mutator "ArrayOneItem": --- Original +++ New @@ @@ } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses; $config['cache_file'] = $this->cacheFile; - return $config; + return count($config) > 1 ? array_slice($config, 0, 1, true) : $config; } public function getExtensionAlias() : string {
infection (ubuntu-24.04, 8.1): src/Core/Ast/AstMap.php#L101
Escaped Mutant for Mutator "AssignCoalesce": --- Original +++ New @@ @@ */ private function recursivelyResolveDependencies(AstInherit $inheritDependency, ?ArrayObject $alreadyResolved = null, ?SplStack $pathStack = null) : iterable { - $alreadyResolved ??= new ArrayObject(); + $alreadyResolved = new ArrayObject(); /** @var ArrayObject<string, true> $alreadyResolved */ if (null === $pathStack) { /** @var SplStack<AstInherit> $pathStack */
infection (ubuntu-24.04, 8.1): src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php#L26
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ } public function set(FileReference $fileReference) : void { - $filepath = (string) realpath($fileReference->filepath); + $filepath = realpath($fileReference->filepath); $this->cache[$filepath] = $fileReference; } }
infection (ubuntu-24.04, 8.1): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ private function resolvePHPParserType(TypeScope $typeScope, NodeAbstract $node) : array { return match (true) { - $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types),
infection (ubuntu-24.04, 8.1): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), - $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), $node instanceof IntersectionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), default => [], };
infection (ubuntu-24.04, 8.1)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
infection (ubuntu-24.04, 8.2): src/Contract/Analyser/EventHelper.php#L41
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ public function shouldViolationBeSkipped(string $depender, string $dependent) : bool { $skippedViolation = $this->skippedViolations[$depender] ?? []; - $matched = [] !== $skippedViolation && in_array($dependent, $skippedViolation, true); + $matched = [] !== $skippedViolation || in_array($dependent, $skippedViolation, true); if (!$matched) { return false; }
infection (ubuntu-24.04, 8.2): src/Contract/Ast/AstMap/FileReference.php#L35
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ /** @psalm-suppress ImpureFunctionCall */ $this->classLikeReferences = array_map(fn(ClassLikeReference $classReference): ClassLikeReference => $classReference->withFileReference($this), $classLikeReferences); /** @psalm-suppress ImpureFunctionCall */ - $this->functionReferences = array_map(fn(FunctionReference $functionReference): FunctionReference => $functionReference->withFileReference($this), $functionReferences); + $this->functionReferences = $functionReferences; } public function getFilepath() : string {
infection (ubuntu-24.04, 8.2): src/Contract/Config/CollectorConfig.php#L20
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ return $this; } /** @return array{'type': string, 'private': bool, ...} */ - public function toArray() : array + protected function toArray() : array { return ['type' => $this->collectorType->value, 'private' => $this->private]; } }
infection (ubuntu-24.04, 8.2): src/Contract/Config/DeptracConfig.php#L134
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->formatters) { $config['formatters'] = array_map(static fn(FormatterConfigInterface $formatterConfig) => $formatterConfig->toArray(), $this->formatters); } - if ([] !== $this->excludeFiles) { + if ([] === $this->excludeFiles) { $config['exclude_files'] = $this->excludeFiles; } if ([] !== $this->layers) {
infection (ubuntu-24.04, 8.2): src/Contract/Config/DeptracConfig.php#L146
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ if ([] !== $this->rulesets) { $config['ruleset'] = array_map(static fn(Ruleset $rulesetConfig) => $rulesetConfig->toArray(), $this->rulesets); } - if ([] !== $this->skipViolations) { + if ([] === $this->skipViolations) { $config['skip_violations'] = $this->skipViolations; } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses;
infection (ubuntu-24.04, 8.2): src/Contract/Config/DeptracConfig.php#L153
Escaped Mutant for Mutator "ArrayOneItem": --- Original +++ New @@ @@ } $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses; $config['cache_file'] = $this->cacheFile; - return $config; + return count($config) > 1 ? array_slice($config, 0, 1, true) : $config; } public function getExtensionAlias() : string {
infection (ubuntu-24.04, 8.2): src/Core/Ast/AstMap.php#L101
Escaped Mutant for Mutator "AssignCoalesce": --- Original +++ New @@ @@ */ private function recursivelyResolveDependencies(AstInherit $inheritDependency, ?ArrayObject $alreadyResolved = null, ?SplStack $pathStack = null) : iterable { - $alreadyResolved ??= new ArrayObject(); + $alreadyResolved = new ArrayObject(); /** @var ArrayObject<string, true> $alreadyResolved */ if (null === $pathStack) { /** @var SplStack<AstInherit> $pathStack */
infection (ubuntu-24.04, 8.2): src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php#L26
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ } public function set(FileReference $fileReference) : void { - $filepath = (string) realpath($fileReference->filepath); + $filepath = realpath($fileReference->filepath); $this->cache[$filepath] = $fileReference; } }
infection (ubuntu-24.04, 8.2): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ private function resolvePHPParserType(TypeScope $typeScope, NodeAbstract $node) : array { return match (true) { - $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types),
infection (ubuntu-24.04, 8.2): src/Core/Ast/Parser/NikicTypeResolver.php#L63
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), - $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), $node instanceof IntersectionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), default => [], };
infection (ubuntu-24.04, 8.2)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/