Skip to content

Commit ce89b6a

Browse files
committed
added PHP 8 typehints
1 parent 00ba774 commit ce89b6a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/RobotLoader/RobotLoader.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __destruct()
7777
/**
7878
* Register autoloader.
7979
*/
80-
public function register(bool $prepend = false): self
80+
public function register(bool $prepend = false): static
8181
{
8282
spl_autoload_register([$this, 'tryLoad'], true, $prepend);
8383
return $this;
@@ -128,16 +128,15 @@ public function tryLoad(string $type): void
128128

129129
/**
130130
* Add path or paths to list.
131-
* @param string ...$paths absolute path
132131
*/
133-
public function addDirectory(...$paths): self
132+
public function addDirectory(string ...$paths): static
134133
{
135134
$this->scanPaths = array_merge($this->scanPaths, $paths);
136135
return $this;
137136
}
138137

139138

140-
public function reportParseErrors(bool $on = true): self
139+
public function reportParseErrors(bool $on = true): static
141140
{
142141
$this->reportParseErrors = $on;
143142
return $this;
@@ -146,9 +145,8 @@ public function reportParseErrors(bool $on = true): self
146145

147146
/**
148147
* Excludes path or paths from list.
149-
* @param string ...$paths absolute path
150148
*/
151-
public function excludeDirectory(...$paths): self
149+
public function excludeDirectory(string ...$paths): static
152150
{
153151
$this->excludeDirs = array_merge($this->excludeDirs, $paths);
154152
return $this;
@@ -418,7 +416,7 @@ private function scanPhp(string $file): array
418416
/**
419417
* Sets auto-refresh mode.
420418
*/
421-
public function setAutoRefresh(bool $on = true): self
419+
public function setAutoRefresh(bool $on = true): static
422420
{
423421
$this->autoRebuild = $on;
424422
return $this;
@@ -428,7 +426,7 @@ public function setAutoRefresh(bool $on = true): self
428426
/**
429427
* Sets path to temporary directory.
430428
*/
431-
public function setTempDirectory(string $dir): self
429+
public function setTempDirectory(string $dir): static
432430
{
433431
Nette\Utils\FileSystem::createDir($dir);
434432
$this->tempDirectory = $dir;

0 commit comments

Comments
 (0)