Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
stubFiles:
- stubs/Application/Routers/RouteList.stub
- stubs/Application/UI/Component.stub
- stubs/Caching/Cache.stub
- stubs/ComponentModel/IComponent.stub
- stubs/Database/ResultSet.stub
- stubs/Database/Table/ActiveRow.stub
Expand Down
82 changes: 82 additions & 0 deletions stubs/Caching/Cache.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

namespace Nette\Caching;

use Nette\InvalidArgumentException;


/**
* @phpstan-type cache-dependencies array{ priority?: int, expire?: string|int|\DateTimeInterface, sliding?: mixed, tags?: list<string>, files?: list<string>, items?: list<string>, const?: list<string>|string, callbacks?: list<array{0: (callable(): bool)}&array<mixed>>, namespaces?: list<string> }
* @phpstan-type clean-conditions array{ priority?: int, tags?: list<string>, all?: true }
*/
class Cache
{

/**
* @template T
* @param mixed $key
* @param (callable(cache-dependencies &$dependencies): T)|null $generator
* @return T
*/
public function load($key, callable $generator = null)
{
// nothing
}

/**
* @template T of array
* @param array<mixed> $key
* @param (callable(mixed, cache-dependencies &$dependencies): T)|null $generator
* @return T
*/
public function bulkLoad($key, callable $generator = null)
{
// nothing
}

/**
* @template T
* @param mixed $key
* @param T $data
* @param cache-dependencies|null $dependencies
* @return T
* @throws InvalidArgumentException
*/
public function save($key, $data, array $dependencies = null)
{
// nothing
}


/**
* @param clean-conditions|null $conditions
*/
public function clean(array $conditions = null): void
{
// nothing
}


/**
* @template T
* @param (callable(): T) $function
* @return T
*/
public function call(callable $function)
{
// nothing
}


/**
* @template T
* @param (callable(): T) $function
* @param cache-dependencies|null $dependencies
* @return (\Closure(): T)
*/
public function wrap(callable $function, array $dependencies = null): \Closure
{
// nothing
}

}