Skip to content

Commit

Permalink
added type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 21, 2018
1 parent b24390d commit ec29311
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Bridges/CacheDI/CacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class CacheExtension extends Nette\DI\CompilerExtension
private $tempDir;


public function __construct($tempDir)
public function __construct(string $tempDir)
{
$this->tempDir = $tempDir;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Caching/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Cache
private $namespace;


public function __construct(IStorage $storage, $namespace = null)
public function __construct(IStorage $storage, string $namespace = null)
{
$this->storage = $storage;
$this->namespace = $namespace . self::NAMESPACE_SEPARATOR;
Expand Down
2 changes: 1 addition & 1 deletion src/Caching/Storages/FileStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FileStorage implements Nette\Caching\IStorage
private $locks;


public function __construct($dir, IJournal $journal = null)
public function __construct(string $dir, IJournal $journal = null)
{
if (!is_dir($dir)) {
throw new Nette\DirectoryNotFoundException("Directory '$dir' not found.");
Expand Down
2 changes: 1 addition & 1 deletion src/Caching/Storages/SQLiteStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SQLiteStorage implements Nette\Caching\IStorage, Nette\Caching\IBulkReader
private $pdo;


public function __construct($path)
public function __construct(string $path)
{
if ($path !== ':memory:' && !is_file($path)) {
touch($path); // ensures ordinary file permissions
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Tester\Helpers::purge(TEMP_DIR);


function test(\Closure $function)
function test(\Closure $function): void
{
$function();
}

0 comments on commit ec29311

Please sign in to comment.