Skip to content

Commit

Permalink
Add missing return types
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Apr 25, 2023
1 parent 382777a commit a5e00de
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ final public function finalize(mixed $value): mixed
/**
* Validates the type of a Node.
*
* @return void
*
* @throws InvalidTypeException when the value is invalid
*/
abstract protected function validateType(mixed $value);
Expand Down
2 changes: 2 additions & 0 deletions Definition/PrototypedArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public function getPrototype(): PrototypeNodeInterface
/**
* Disable adding concrete children for prototyped nodes.
*
* @return never
*
* @throws Exception
*/
public function addChild(NodeInterface $node)
Expand Down
3 changes: 3 additions & 0 deletions FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function __construct(string|array $paths = [])
$this->paths = (array) $paths;
}

/**
* @return string|array
*/
public function locate(string $name, string $currentPath = null, bool $first = true)
{
if ('' === $name) {
Expand Down
6 changes: 5 additions & 1 deletion Loader/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public function __construct(FileLocatorInterface $locator, string $env = null)

/**
* Sets the current directory.
*
* @return void
*/
public function setCurrentDir(string $dir)
{
Expand All @@ -62,6 +64,8 @@ public function getLocator(): FileLocatorInterface
* @param string|null $sourceResource The original resource importing the new resource
* @param string|string[]|null $exclude Glob patterns to exclude from the import
*
* @return mixed
*
* @throws LoaderLoadException
* @throws FileLoaderImportCircularReferenceException
* @throws FileLocatorFileNotFoundException
Expand Down Expand Up @@ -129,7 +133,7 @@ protected function glob(string $pattern, bool $recursive, array|GlobResource &$r
yield from $resource;
}

private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null)
private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null): mixed
{
try {
$loader = $this->resolve($resource, $type);
Expand Down
2 changes: 1 addition & 1 deletion ResourceCheckerConfigCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function getMetaFile(): string
return $this->file.'.meta';
}

private function safelyUnserialize(string $file)
private function safelyUnserialize(string $file): mixed
{
$meta = false;
$content = file_get_contents($file);
Expand Down

0 comments on commit a5e00de

Please sign in to comment.