Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7898871
feat: Vendor JSON-Schema-Test-Suite draft2020-12 with deterministic s…
milinsky Oct 22, 2026
f5c3d40
feat: Add schema resource identification fields (id, anchor, dynamicA…
milinsky Oct 22, 2026
5e2c724
feat: Collect unknown schema keywords into Schema extras via KnownSch…
milinsky Oct 22, 2026
3254b4c
refactor: Rebind suite sections allOf/anyOf/oneOf/properties/prefixIt…
milinsky Oct 22, 2026
40ff5da
feat: Propagate resource identity fields and extras through schema si…
milinsky Oct 22, 2026
210f05a
feat: Collect schema annotations in validation context
milinsky Oct 22, 2026
1fb09bf
feat: Index document resources in lazy per-document ResourceRegistry
milinsky Oct 22, 2026
54ca8ca
feat: Resolve defs pointers and plain-name anchor fragments through t…
milinsky Oct 22, 2026
f0d3fff
feat: Track dynamic scope of schema resources in validation context
milinsky Oct 22, 2026
847f929
feat: Support multi-document validation via DocumentRepository and bu…
milinsky Oct 23, 2026
50fefe6
refactor: Rebind orphaned suite sections and activate five green sect…
milinsky Oct 23, 2026
111a65f
feat: Implement dynamicRef with dynamic scope resolution per Appendix C
milinsky Oct 23, 2026
1964119
feat: Add withExternalRefResolver extension point to the validator bu…
milinsky Oct 23, 2026
e2b0b8d
docs: Note ref chain sibling keywords application in changelog
milinsky Oct 23, 2026
7274d9a
feat: Guard document vocabularies and warn on legacy draft-07 keywords
milinsky Oct 23, 2026
5e97bd6
feat: Carry dialect profile through resolver, context and parser buil…
milinsky Oct 23, 2026
90a9ff5
feat: Reject type arrays in OpenAPI 3.0 schemas
milinsky Oct 23, 2026
2537795
feat: Ignore ref sibling keywords in OpenAPI 3.0 documents
milinsky Oct 23, 2026
80e98e6
refactor: Activate green suite sections and park cross-draft after tr…
milinsky Oct 23, 2026
130b25c
feat: Require explicit type for nullable in OpenAPI 3.0 schemas
milinsky Oct 23, 2026
c3da6ee
feat: Add dependentRequired keyword with legacy dependencies translation
milinsky Oct 23, 2026
8d70d2d
feat: Treat content keywords as annotations by default
milinsky Oct 23, 2026
561b5e5
docs: Add dependentRequired entry and consolidate changelog sections
milinsky Oct 23, 2026
9ed3d14
feat: Assert full RFC 4648 and quoted-printable encodings in content …
milinsky Oct 23, 2026
e42860f
feat: Add content assertion pipeline with lazy validation result
milinsky Oct 23, 2026
b78f123
feat: Ignore contentMediaType when media type is set externally
milinsky Oct 23, 2026
c38e2b9
refactor: Introduce keyword validator registry with a public contract
milinsky Oct 23, 2026
4d1a05b
test: Revise the confinement cache budget after a flake hunt
milinsky Oct 24, 2026
6b1d7a5
feat: Add withKeywordValidator and custom keyword dispatch
milinsky Oct 24, 2026
deb4e54
feat: Reject unknown schema keywords by default with strict keywords
milinsky Oct 24, 2026
aa7a279
feat: Add the format assertion mode switch to the validator builder
milinsky Oct 24, 2026
c60e72c
feat: Fail closed on unknown response media types by default
milinsky Oct 24, 2026
053b0ab
feat: Classify media types by kind with the response routing gate
milinsky Oct 24, 2026
f136942
feat: Accept multiple content type values in encoding objects
milinsky Oct 24, 2026
2b4fb2c
feat: Apply nested encoding to multipart request parts
milinsky Oct 24, 2026
fb7eda1
chore: Mark the multipart encoding applier as internal
milinsky Oct 24, 2026
4987799
feat: Support ordered unnamed multipart with part headers
milinsky Oct 24, 2026
d7a1daa
feat: Recurse into nested multipart parts with a depth limit
milinsky Oct 24, 2026
9f05e7a
chore: Mark the ordered multipart plan as internal
milinsky Oct 24, 2026
9a497b2
test: Pin the schema default content type decoding functionally
milinsky Oct 24, 2026
0f74437
feat: Stream multipart requests with byte range part parsing
milinsky Oct 24, 2026
e3830f3
feat: Map XML request bodies by the XML object schema
milinsky Oct 25, 2026
e428511
feat: Support security scheme fields of OpenAPI 3.2
milinsky Oct 25, 2026
8638644
refactor: Dispatch security schemes through a handler registry
milinsky Oct 25, 2026
a323098
feat: Validate basic and digest security scheme credentials
milinsky Oct 25, 2026
174b6d8
feat: Validate mtls, oauth2 and oidc security schemes
milinsky Oct 25, 2026
d5cc21a
feat: Add the security scheme handler extension point
milinsky Oct 25, 2026
11e7bd4
feat: Activate the core instance semantics suite sections
milinsky Oct 25, 2026
25d4af8
feat: Address content validation results by data path
milinsky Oct 26, 2026
de96007
feat: Repair format validators to the conformance suite
milinsky Oct 28, 2026
b80ea87
test: Activate the format suite section in the annotation profile
milinsky Oct 28, 2026
0cbca05
docs: Consolidate the feature coverage readme and changelog
milinsky Oct 29, 2026
b75f71e
test: Close the final completeness audit with nullable gate tail fixes
milinsky Oct 29, 2026
884bc58
test: Pin the multipart close tail anchoring and the ref chain contract
milinsky Oct 31, 2026
2b6a2f8
refactor: Sweep dead code and consolidate the release documentation
milinsky Oct 31, 2026
3dac282
feat: Distinguish JSON object and array instance shapes across valida…
milinsky Oct 31, 2026
717e6d4
fix: Resolve canonical-compliance audit findings across the validator
milinsky Nov 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.idea/
.ai/
vendor/
coverage/
.phpunit.cache/
composer.lock
/.php-cs-fixer.cache
/coverage.xml
/coverage-text.txt
/coverage-summary.txt
/infection.log
.DS_Store
788 changes: 776 additions & 12 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cs-fix:

.PHONY: rector
rector:
docker-compose run --rm php vendor/bin/rector
docker-compose run --rm php vendor/bin/rector --dry-run

.PHONY: shell
shell:
Expand Down
382 changes: 330 additions & 52 deletions README.md

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions bin/fetch-json-schema-suite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/sh

set -eu

SUITE_REPO="json-schema-org/JSON-Schema-Test-Suite"
SUITE_DEFAULT_COMMIT="89e83a74014617ffbe79a56d83d14d054cd11417"
SUITE_COMMIT="${1:-$SUITE_DEFAULT_COMMIT}"

if ! printf '%s' "$SUITE_COMMIT" | grep -Eq '^[0-9a-f]{40}$'; then
echo "fetch-json-schema-suite: invalid commit sha: $SUITE_COMMIT (expected 40 lowercase hex characters)" >&2
exit 1
fi

PACKAGE_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
TARGET_DIR="$PACKAGE_ROOT/tests/Fixture/JsonSchemaTestSuite"
VERSION_FILE="$TARGET_DIR/VERSION"
LICENSE_FILE="$TARGET_DIR/LICENSE"
DRAFT_DIR="$TARGET_DIR/draft2020-12"
REMOTES_DIR="$TARGET_DIR/remotes"

if [ -f "$VERSION_FILE" ] && [ -f "$LICENSE_FILE" ] && [ -d "$DRAFT_DIR" ] && [ -n "$(find "$DRAFT_DIR" -name '*.json' -print -quit 2>/dev/null)" ]; then
pinned=$(sed -n 's/^commit: //p' "$VERSION_FILE")
if [ "$pinned" = "$SUITE_COMMIT" ]; then
echo "fetch-json-schema-suite: already vendored at commit $SUITE_COMMIT"
exit 0
fi
fi

WORK_DIR=$(mktemp -d)
trap 'rm -rf "$WORK_DIR"' EXIT

archive="$WORK_DIR/suite.tar.gz"
curl -sSL --fail -o "$archive" "https://github.com/$SUITE_REPO/archive/$SUITE_COMMIT.tar.gz"

extract_dir="$WORK_DIR/src"
mkdir -p "$extract_dir"
tar -xzf "$archive" -C "$extract_dir" --strip-components=1

suite_draft_dir="$extract_dir/tests/draft2020-12"
suite_remotes_dir="$extract_dir/remotes"
suite_license_file="$extract_dir/LICENSE"

if [ ! -d "$suite_draft_dir" ] || [ ! -d "$suite_remotes_dir" ] || [ ! -f "$suite_license_file" ]; then
echo "fetch-json-schema-suite: archive for $SUITE_COMMIT has no tests/draft2020-12, remotes/ or LICENSE" >&2
exit 1
fi

rm -rf "$DRAFT_DIR" "$REMOTES_DIR"
mkdir -p "$TARGET_DIR"

cp -R "$suite_draft_dir" "$DRAFT_DIR"
cp -R "$suite_remotes_dir" "$REMOTES_DIR"
cp "$suite_license_file" "$LICENSE_FILE"

find "$DRAFT_DIR" -name '*.json' -exec chmod 644 {} +
find "$REMOTES_DIR" -name '*.json' -exec chmod 644 {} +
chmod 644 "$LICENSE_FILE"

cat > "$VERSION_FILE" <<EOF
source: $SUITE_REPO
url: https://github.com/$SUITE_REPO
commit: $SUITE_COMMIT
license: MIT
section: tests/draft2020-12
remotes: remotes/
note: upstream per-draft branches are consolidated into main; tests/draft2020-12 is the draft2020-12 suite
EOF

echo "fetch-json-schema-suite: vendored $SUITE_COMMIT"
echo "fetch-json-schema-suite: sections: $(find "$DRAFT_DIR" -name '*.json' | wc -l | tr -d ' ') files"
echo "fetch-json-schema-suite: remotes: $(find "$REMOTES_DIR" -name '*.json' | wc -l | tr -d ' ') files"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"giorgiosironi/eris": "^1.0"
},
"suggest": {
"ext-intl": "Required for full SMTPUTF8 (RFC 6531) and IDNA hostname validation; permissive regex fallback when absent",
"ext-intl": "Enables full UTS#46 IDNA2008 idn-hostname validation and hostname/idn-hostname xn-- A-label verification; without it those validators fail closed (reject non-ASCII input and A-labels)",
"nyholm/psr7": "PSR-7 implementation used in tests; use any PSR-7 implementation in production",
"psr/http-server-middleware": "Required if you implement the PSR-15 middleware example from README",
"symfony/cache": "PSR-6 cache implementation for SchemaCache",
Expand Down
61 changes: 0 additions & 61 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,66 +94,6 @@
<code><![CDATA[$exclusiveMaximum]]></code>
<code><![CDATA[$exclusiveMinimum]]></code>
</MixedAssignment>
<MixedReturnTypeCoercion>
<code><![CDATA[[
'multipleOf' => $multipleOf,
'maximum' => TypeHelper::asFloatOrNull($data['maximum'] ?? null),
'exclusiveMaximum' => $this->resolveExclusiveMaximum($data),
'minimum' => TypeHelper::asFloatOrNull($data['minimum'] ?? null),
'exclusiveMinimum' => $this->resolveExclusiveMinimum($data),
'maxLength' => TypeHelper::asIntOrNull($data['maxLength'] ?? null),
'minLength' => TypeHelper::asIntOrNull($data['minLength'] ?? null),
'pattern' => TypeHelper::asStringOrNull($data['pattern'] ?? null),
'format' => TypeHelper::asStringOrNull($data['format'] ?? null),
'title' => TypeHelper::asStringOrNull($data['title'] ?? null),
'description' => TypeHelper::asStringOrNull($data['description'] ?? null),
'default' => $data['default'] ?? null,
'hasDefault' => array_key_exists('default', $data),
'deprecated' => (bool) ($data['deprecated'] ?? false),
'readOnly' => (bool) ($data['readOnly'] ?? false),
'writeOnly' => (bool) ($data['writeOnly'] ?? false),
'type' => $this->resolveType($data),
'nullable' => (bool) ($data['nullable'] ?? false),
'const' => $data['const'] ?? null,
'hasConst' => array_key_exists('const', $data),
'contentEncoding' => TypeHelper::asStringOrNull($data['contentEncoding'] ?? null),
'contentMediaType' => TypeHelper::asStringOrNull($data['contentMediaType'] ?? null),
'jsonSchemaDialect' => TypeHelper::asStringOrNull($data['$schema'] ?? null),
'example' => $data['example'] ?? null,
'examples' => isset($data['examples']) && is_array($data['examples'])
? TypeHelper::asStringMixedMapOrNull($data['examples'])
: null,
'enum' => TypeHelper::asEnumListOrNull($data['enum'] ?? null),
]]]></code>
<code><![CDATA[array{
* multipleOf: ?float,
* maximum: ?float,
* exclusiveMaximum: ?float,
* minimum: ?float,
* exclusiveMinimum: ?float,
* maxLength: ?int,
* minLength: ?int,
* pattern: ?string,
* format: ?string,
* title: ?string,
* description: ?string,
* default: mixed|null,
* hasDefault: bool,
* deprecated: bool,
* readOnly: bool,
* writeOnly: bool,
* type: string|array<int, string|null>|null,
* nullable: bool,
* const: mixed|null,
* hasConst: bool,
* contentEncoding: ?string,
* contentMediaType: ?string,
* jsonSchemaDialect: ?string,
* example: mixed|null,
* examples: array<string, mixed>|null,
* enum: list<mixed>|null,
* }]]></code>
</MixedReturnTypeCoercion>
</file>
<file src="src/Schema/Parser/SchemaFromArrayConverter.php">
<ArgumentTypeCoercion>
Expand Down Expand Up @@ -189,7 +129,6 @@
</file>
<file src="src/Validator/Link/LinkResolver.php">
<MixedAssignment>
<code><![CDATA[$current]]></code>
<code><![CDATA[$expression]]></code>
<code><![CDATA[$resolved[$name]]]></code>
</MixedAssignment>
Expand Down
32 changes: 32 additions & 0 deletions src/Builder/Dto/BuilderConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
namespace Duyler\OpenApi\Builder\Dto;

use Duyler\OpenApi\Cache\SchemaCache;
use Duyler\OpenApi\Schema\Parser\DocumentRepository;
use Duyler\OpenApi\Validator\EmptyArrayStrategy;
use Duyler\OpenApi\Validator\Error\Formatter\ErrorFormatterInterface;
use Duyler\OpenApi\Validator\Format\FormatRegistry;
use Duyler\OpenApi\Validator\FormatAssertionMode;
use Duyler\OpenApi\Validator\Schema\ExternalRefResolverInterface;
use Duyler\OpenApi\Validator\Schema\KeywordValidatorRegistry;
use Duyler\OpenApi\Validator\Security\SecuritySchemeHandlerRegistry;
use Duyler\OpenApi\Validator\ValidatorPool;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;

final readonly class BuilderConfig
{
/**
* @param list<string>|null $allowedUnknownKeywords
*/
public function __construct(
public readonly ?string $specPath = null,
public readonly ?string $specContent = null,
Expand Down Expand Up @@ -43,6 +51,18 @@ public function __construct(
public readonly ?bool $strictCoercion = null,
public readonly ?int $maxSpecSizeBytes = null,
public readonly ?int $maxSpecDepth = null,
public readonly ?DocumentRepository $documentRepository = null,
public readonly ?ExternalRefResolverInterface $externalRefResolver = null,
public readonly ?bool $contentAssertionsEnabled = null,
public readonly ?KeywordValidatorRegistry $keywordValidators = null,
public readonly ?bool $strictKeywords = null,
public readonly ?array $allowedUnknownKeywords = null,
public readonly ?FormatAssertionMode $formatAssertionMode = null,
public readonly ?bool $lenientResponses = null,
public readonly ?SecuritySchemeHandlerRegistry $securitySchemeHandlers = null,
public readonly ?bool $legacyExplodeDefaults = null,
public readonly ?bool $enforceRequiredForReadOnly = null,
public readonly ?bool $decisiveDiscriminator = null,
) {}

public function merge(self $overrides): self
Expand Down Expand Up @@ -76,6 +96,18 @@ public function merge(self $overrides): self
strictCoercion: $overrides->strictCoercion ?? $this->strictCoercion,
maxSpecSizeBytes: $overrides->maxSpecSizeBytes ?? $this->maxSpecSizeBytes,
maxSpecDepth: $overrides->maxSpecDepth ?? $this->maxSpecDepth,
documentRepository: $overrides->documentRepository ?? $this->documentRepository,
externalRefResolver: $overrides->externalRefResolver ?? $this->externalRefResolver,
contentAssertionsEnabled: $overrides->contentAssertionsEnabled ?? $this->contentAssertionsEnabled,
keywordValidators: $overrides->keywordValidators ?? $this->keywordValidators,
strictKeywords: $overrides->strictKeywords ?? $this->strictKeywords,
allowedUnknownKeywords: $overrides->allowedUnknownKeywords ?? $this->allowedUnknownKeywords,
formatAssertionMode: $overrides->formatAssertionMode ?? $this->formatAssertionMode,
lenientResponses: $overrides->lenientResponses ?? $this->lenientResponses,
securitySchemeHandlers: $overrides->securitySchemeHandlers ?? $this->securitySchemeHandlers,
legacyExplodeDefaults: $overrides->legacyExplodeDefaults ?? $this->legacyExplodeDefaults,
enforceRequiredForReadOnly: $overrides->enforceRequiredForReadOnly ?? $this->enforceRequiredForReadOnly,
decisiveDiscriminator: $overrides->decisiveDiscriminator ?? $this->decisiveDiscriminator,
);
}
}
6 changes: 5 additions & 1 deletion src/Builder/Internal/CacheKeyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Duyler\OpenApi\Builder\Internal;

use Duyler\OpenApi\Builder\Dto\BuilderConfig;
use Duyler\OpenApi\PackageInfo;
use Duyler\OpenApi\Schema\Parser\YamlParser;
use Duyler\OpenApi\Validator\Schema\FileExternalRefResolver;

Expand All @@ -19,15 +20,16 @@

public function __construct(
private BuilderConfig $config,
private string $packageVersion = PackageInfo::VERSION,
) {}

public function forFile(string $path, string $content): string
{
$realPath = realpath($path);
$pathComponent = false === $realPath ? $path : $realPath;

Check warning on line 29 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Ternary": @@ @@ public function forFile(string $path, string $content): string { $realPath = realpath($path); - $pathComponent = false === $realPath ? $path : $realPath; + $pathComponent = false === $realPath ? $realPath : $path; $contentHash = hash('sha256', $content); return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint());

Check warning on line 29 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Ternary": @@ @@ public function forFile(string $path, string $content): string { $realPath = realpath($path); - $pathComponent = false === $realPath ? $path : $realPath; + $pathComponent = false === $realPath ? $realPath : $path; $contentHash = hash('sha256', $content); return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint());
$contentHash = hash('sha256', $content);

return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint());

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . $this->buildFingerprint() . '|'); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . '|' . $contentHash . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . $contentHash . '|' . '|' . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', '|' . $pathComponent . $contentHash . '|' . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . $contentHash . '|' . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . $this->buildFingerprint() . '|'); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . '|' . $contentHash . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . $contentHash . '|' . '|' . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', $pathComponent . $contentHash . '|' . $this->buildFingerprint()); } public function forString(string $content): string

Check warning on line 32 in src/Builder/Internal/CacheKeyBuilder.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Concat": @@ @@ $pathComponent = false === $realPath ? $path : $realPath; $contentHash = hash('sha256', $content); - return self::FILE_PREFIX . hash('sha256', $pathComponent . '|' . $contentHash . '|' . $this->buildFingerprint()); + return self::FILE_PREFIX . hash('sha256', '|' . $pathComponent . $contentHash . '|' . $this->buildFingerprint()); } public function forString(string $content): string
}

public function forString(string $content): string
Expand All @@ -40,11 +42,13 @@
private function buildFingerprint(): string
{
return sprintf(
'maxSpecDepth=%d|maxSpecSizeBytes=%d|externalRefAllowedRoot=%s|externalRefMaxBytes=%d',
'packageVersion=%s|maxSpecDepth=%d|maxSpecSizeBytes=%d|externalRefAllowedRoot=%s|externalRefMaxBytes=%d|documentRepository=%s',
$this->packageVersion,
$this->config->maxSpecDepth ?? YamlParser::DEFAULT_MAX_SPEC_DEPTH,
$this->config->maxSpecSizeBytes ?? YamlParser::DEFAULT_MAX_SPEC_BYTES,
$this->config->externalRefAllowedRoot ?? '',
$this->config->externalRefMaxBytes ?? FileExternalRefResolver::DEFAULT_MAX_REF_BYTES,
$this->config->documentRepository?->fingerprint() ?? '',
);
}
}
Loading
Loading