Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.8.0 stubs #101

Merged
merged 1 commit into from
Jul 18, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/Acl/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract class AbstractAdapter extends AbstractEventsAware implements \Phalcon\A
*
* @return string|null
*/
public function getActiveAccess(): string|null
public function getActiveAccess(): ?string
{
}

Expand All @@ -68,7 +68,7 @@ public function getActiveAccess(): string|null
*
* @return string|null
*/
public function getActiveComponent(): string|null
public function getActiveComponent(): ?string
{
}

Expand All @@ -78,7 +78,7 @@ public function getActiveComponent(): string|null
*
* @return string|null
*/
public function getActiveRole(): string|null
public function getActiveRole(): ?string
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/Acl/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,23 @@ public function dropComponentAccess(string $componentName, $accessList): void;
*
* @return string|null
*/
public function getActiveAccess(): string|null;
public function getActiveAccess(): ?string;

/**
* Returns the role which the list is checking if it's allowed to certain
* component/access
*
* @return string|null
*/
public function getActiveRole(): string|null;
public function getActiveRole(): ?string;

/**
* Returns the component which the list is checking if some role can access
* it
*
* @return string|null
*/
public function getActiveComponent(): string|null;
public function getActiveComponent(): ?string;

/**
* Return an array with every component registered in the list
Expand Down
6 changes: 3 additions & 3 deletions src/Acl/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public function dropComponentAccess(string $componentName, $accessList): void
*
* @return mixed
*/
public function getActiveFunction(): mixed
public function getActiveFunction()
{
}

Expand All @@ -347,7 +347,7 @@ public function getActiveFunctionCustomArgumentsCount(): int
*
* @return string|null
*/
public function getActiveKey(): string|null
public function getActiveKey(): ?string
{
}

Expand Down Expand Up @@ -466,7 +466,7 @@ private function allowOrDeny(string $roleName, string $componentName, $access, $
* @param string $access
* @return string|bool
*/
private function canAccess(string $roleName, string $componentName, string $access): bool|string
private function canAccess(string $roleName, string $componentName, string $access)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Adapter/Apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(array $options = [])
* @param string $key
* @return bool|Reflection
*/
public function read(string $key): Reflection|bool
public function read(string $key)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Memory extends \Phalcon\Annotations\Adapter\AbstractAdapter
* @param string $key
* @return bool|Reflection
*/
public function read(string $key): Reflection|bool
public function read(string $key)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Adapter/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(array $options = [])
* @param string $key
* @return bool|int|Reflection
*/
public function read(string $key): Reflection|int|bool
public function read(string $key)
{
}

Expand Down
10 changes: 5 additions & 5 deletions src/Annotations/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(array $reflectionData)
* @param mixed $position
* @return mixed|null
*/
public function getArgument($position): mixed
public function getArgument($position)
{
}

Expand Down Expand Up @@ -78,7 +78,7 @@ public function getExprArguments(): array
* @param array $expr
* @return mixed
*/
public function getExpression(array $expr): mixed
public function getExpression(array $expr)
{
}

Expand All @@ -87,7 +87,7 @@ public function getExpression(array $expr): mixed
*
* @return string|null
*/
public function getName(): string|null
public function getName(): ?string
{
}

Expand All @@ -97,7 +97,7 @@ public function getName(): string|null
* @param string $name
* @return mixed|null
*/
public function getNamedArgument(string $name): mixed
public function getNamedArgument(string $name)
{
}

Expand All @@ -107,7 +107,7 @@ public function getNamedArgument(string $name): mixed
* @param string $name
* @return mixed
*/
public function getNamedParameter(string $name): mixed
public function getNamedParameter(string $name)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/AnnotationsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(array $services = [])
* Factory to create an instance from a Config object
* @return mixed
*/
public function load($config): mixed
public function load($config)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function count(): int
*
* @return mixed
*/
public function current(): mixed
public function current()
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(array $reflectionData = [])
*
* @return Collection|null
*/
public function getClassAnnotations(): Collection|null
public function getClassAnnotations(): ?Collection
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Application/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getDefaultModule(): string
*
* @return ManagerInterface|null
*/
public function getEventsManager(): ManagerInterface|null
public function getEventsManager(): ?ManagerInterface
{
}

Expand All @@ -72,7 +72,7 @@ public function getEventsManager(): ManagerInterface|null
* @param string $name *
* @return array|mixed
*/
public function getModule(string $name): object|array
public function getModule(string $name)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Assets/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function getType(): string
*
* @return string|null
*/
public function getVersion(): string|null
public function getVersion(): ?string
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Assets/AssetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getAssetKey(): string;
*
* @return array|null
*/
public function getAttributes(): array|null;
public function getAttributes(): ?array;

/**
* Gets if the asset must be filtered or not.
Expand Down
2 changes: 1 addition & 1 deletion src/Assets/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function has(string $name): bool
* @return string|null
* @throws Exception
*/
public function output(Collection $collection, string $type): string|null
public function output(Collection $collection, string $type): ?string
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Autoload/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function autoload(string $className): bool
*
* @return string|null
*/
public function getCheckedPath(): string|null
public function getCheckedPath(): ?string
{
}

Expand Down Expand Up @@ -209,7 +209,7 @@ public function getFiles(): array
*
* @return string|null
*/
public function getFoundPath(): string|null
public function getFoundPath(): ?string
{
}

Expand Down
43 changes: 41 additions & 2 deletions src/Cache/AbstractCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
use DateInterval;
use Phalcon\Cache\Adapter\AdapterInterface;
use Phalcon\Cache\Exception\InvalidArgumentException;
use Phalcon\Events\EventsAwareInterface;
use Phalcon\Events\ManagerInterface;
use Traversable;

/**
* This component offers caching capabilities for your application.
*/
abstract class AbstractCache implements \Phalcon\Cache\CacheInterface
abstract class AbstractCache implements \Phalcon\Cache\CacheInterface, \Phalcon\Events\EventsAwareInterface
{
/**
* The adapter
Expand All @@ -26,6 +28,13 @@ abstract class AbstractCache implements \Phalcon\Cache\CacheInterface
*/
protected $adapter;

/**
* Event Manager
*
* @var ManagerInterface|null
*/
protected $eventsManager = null;

/**
* Constructor.
*
Expand All @@ -44,6 +53,25 @@ public function getAdapter(): AdapterInterface
{
}

/**
* Sets the event manager
*
* @param \Phalcon\Events\ManagerInterface $eventsManager
* @return void
*/
public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager): void
{
}

/**
* Get the event manager
*
* @return ManagerInterface|null
*/
public function getEventsManager(): ?ManagerInterface
{
}

/**
* Checks the key. If it contains invalid characters an exception is thrown
*
Expand Down Expand Up @@ -114,7 +142,7 @@ protected function doDeleteMultiple($keys): bool
* @throws InvalidArgumentException MUST be thrown if the $key string is
* not a legal value.
*/
protected function doGet(string $key, $defaultValue = null): mixed
protected function doGet(string $key, $defaultValue = null)
{
}

Expand Down Expand Up @@ -176,6 +204,17 @@ protected function doSetMultiple($values, $ttl = null): bool
{
}

/**
* Trigger an event for the eventsManager.
*
* @param string $eventName
* @param mixed $keys
* @return void
*/
protected function fire(string $eventName, $keys): void
{
}

/**
* Returns the exception class that will be used for exceptions thrown
*
Expand Down
1 change: 1 addition & 0 deletions src/Cache/Adapter/Apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Apcu extends \Phalcon\Storage\Adapter\Apcu implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
1 change: 1 addition & 0 deletions src/Cache/Adapter/Libmemcached.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Libmemcached extends \Phalcon\Storage\Adapter\Libmemcached implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
1 change: 1 addition & 0 deletions src/Cache/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Memory extends \Phalcon\Storage\Adapter\Memory implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
1 change: 1 addition & 0 deletions src/Cache/Adapter/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Redis extends \Phalcon\Storage\Adapter\Redis implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
1 change: 1 addition & 0 deletions src/Cache/Adapter/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Stream extends \Phalcon\Storage\Adapter\Stream implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
1 change: 1 addition & 0 deletions src/Cache/Adapter/Weak.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
class Weak extends \Phalcon\Storage\Adapter\Weak implements CacheAdapterInterface
{
protected $eventType = 'cache';
}
4 changes: 2 additions & 2 deletions src/Cli/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Dispatcher extends \Phalcon\Dispatcher\AbstractDispatcher implements \Phal
* @param array $params
* @return mixed
*/
public function callActionMethod($handler, string $actionMethod, array $params = []): mixed
public function callActionMethod($handler, string $actionMethod, array $params = [])
{
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public function getLastTask(): TaskInterface
* @param mixed $defaultValue
* @return mixed
*/
public function getOption($option, $filters = null, $defaultValue = null): mixed
public function getOption($option, $filters = null, $defaultValue = null)
{
}

Expand Down
Loading
Loading