Skip to content

Commit f2ff74e

Browse files
committed
Fix root directory to data path
1 parent a44b55a commit f2ff74e

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/Validator.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,14 @@ public function __construct(protected File|Json $data, protected File|Json $sche
6262
* Returns the root directory of this project.
6363
*
6464
* @return string
65-
* @throws FileNotFoundException
6665
*/
6766
private function getDirectoryRoot(): string
6867
{
69-
if (!is_null($this->directoryRoot)) {
70-
return $this->directoryRoot;
71-
}
72-
73-
$reflection = new ReflectionClass(ClassLoader::class);
74-
75-
$fileName = $reflection->getFileName();
76-
77-
if ($fileName === false) {
78-
throw new FileNotFoundException('reflection-class');
68+
if (is_null($this->directoryRoot)) {
69+
$this->directoryRoot = dirname(__FILE__, 2);
7970
}
8071

81-
return dirname($fileName, 3);
72+
return $this->directoryRoot;
8273
}
8374

8475
/**

0 commit comments

Comments
 (0)