Skip to content

Commit 2e9ee9a

Browse files
committed
Make code output stable across multiple runs (#41)
1 parent 0fc7d6b commit 2e9ee9a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Model/Validator/ExtractedMethodValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(
2929
'validate%s_%s_%s',
3030
str_replace(' ', '', ucfirst($property->getAttribute())),
3131
str_replace('Validator', '', substr(strrchr(static::class, '\\'), 1)),
32-
uniqid(),
32+
md5(json_encode($property->getJsonSchema()->getJson())),
3333
);
3434

3535
parent::__construct($property, $template, $templateValues, $exceptionClass, $exceptionParams);

src/Utils/ClassNameGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getClassName(
3232
ucfirst(
3333
isset($json['$id'])
3434
? str_replace('#', '', $json['$id'])
35-
: ($propertyName . ($currentClassName ? uniqid() : '')),
35+
: ($propertyName . ($currentClassName ? md5(json_encode($json)) : '')),
3636
)
3737
);
3838

0 commit comments

Comments
 (0)