Skip to content

Commit cc79943

Browse files
authored
Merge pull request #101 from marcuspmd/5.8.0
5.8.0 stubs
2 parents dbf1a87 + b62eac4 commit cc79943

File tree

164 files changed

+621
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+621
-528
lines changed

src/Acl/Adapter/AbstractAdapter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ abstract class AbstractAdapter extends AbstractEventsAware implements \Phalcon\A
5959
*
6060
* @return string|null
6161
*/
62-
public function getActiveAccess(): string|null
62+
public function getActiveAccess(): ?string
6363
{
6464
}
6565

@@ -68,7 +68,7 @@ public function getActiveAccess(): string|null
6868
*
6969
* @return string|null
7070
*/
71-
public function getActiveComponent(): string|null
71+
public function getActiveComponent(): ?string
7272
{
7373
}
7474

@@ -78,7 +78,7 @@ public function getActiveComponent(): string|null
7878
*
7979
* @return string|null
8080
*/
81-
public function getActiveRole(): string|null
81+
public function getActiveRole(): ?string
8282
{
8383
}
8484

src/Acl/Adapter/AdapterInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ public function dropComponentAccess(string $componentName, $accessList): void;
9393
*
9494
* @return string|null
9595
*/
96-
public function getActiveAccess(): string|null;
96+
public function getActiveAccess(): ?string;
9797

9898
/**
9999
* Returns the role which the list is checking if it's allowed to certain
100100
* component/access
101101
*
102102
* @return string|null
103103
*/
104-
public function getActiveRole(): string|null;
104+
public function getActiveRole(): ?string;
105105

106106
/**
107107
* Returns the component which the list is checking if some role can access
108108
* it
109109
*
110110
* @return string|null
111111
*/
112-
public function getActiveComponent(): string|null;
112+
public function getActiveComponent(): ?string;
113113

114114
/**
115115
* Return an array with every component registered in the list

src/Acl/Adapter/Memory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function dropComponentAccess(string $componentName, $accessList): void
329329
*
330330
* @return mixed
331331
*/
332-
public function getActiveFunction(): mixed
332+
public function getActiveFunction()
333333
{
334334
}
335335

@@ -347,7 +347,7 @@ public function getActiveFunctionCustomArgumentsCount(): int
347347
*
348348
* @return string|null
349349
*/
350-
public function getActiveKey(): string|null
350+
public function getActiveKey(): ?string
351351
{
352352
}
353353

@@ -466,7 +466,7 @@ private function allowOrDeny(string $roleName, string $componentName, $access, $
466466
* @param string $access
467467
* @return string|bool
468468
*/
469-
private function canAccess(string $roleName, string $componentName, string $access): bool|string
469+
private function canAccess(string $roleName, string $componentName, string $access)
470470
{
471471
}
472472

src/Annotations/Adapter/Apcu.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(array $options = [])
5050
* @param string $key
5151
* @return bool|Reflection
5252
*/
53-
public function read(string $key): Reflection|bool
53+
public function read(string $key)
5454
{
5555
}
5656

src/Annotations/Adapter/Memory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Memory extends \Phalcon\Annotations\Adapter\AbstractAdapter
2828
* @param string $key
2929
* @return bool|Reflection
3030
*/
31-
public function read(string $key): Reflection|bool
31+
public function read(string $key)
3232
{
3333
}
3434

src/Annotations/Adapter/Stream.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(array $options = [])
5050
* @param string $key
5151
* @return bool|int|Reflection
5252
*/
53-
public function read(string $key): Reflection|int|bool
53+
public function read(string $key)
5454
{
5555
}
5656

src/Annotations/Annotation.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(array $reflectionData)
5050
* @param mixed $position
5151
* @return mixed|null
5252
*/
53-
public function getArgument($position): mixed
53+
public function getArgument($position)
5454
{
5555
}
5656

@@ -78,7 +78,7 @@ public function getExprArguments(): array
7878
* @param array $expr
7979
* @return mixed
8080
*/
81-
public function getExpression(array $expr): mixed
81+
public function getExpression(array $expr)
8282
{
8383
}
8484

@@ -87,7 +87,7 @@ public function getExpression(array $expr): mixed
8787
*
8888
* @return string|null
8989
*/
90-
public function getName(): string|null
90+
public function getName(): ?string
9191
{
9292
}
9393

@@ -97,7 +97,7 @@ public function getName(): string|null
9797
* @param string $name
9898
* @return mixed|null
9999
*/
100-
public function getNamedArgument(string $name): mixed
100+
public function getNamedArgument(string $name)
101101
{
102102
}
103103

@@ -107,7 +107,7 @@ public function getNamedArgument(string $name): mixed
107107
* @param string $name
108108
* @return mixed
109109
*/
110-
public function getNamedParameter(string $name): mixed
110+
public function getNamedParameter(string $name)
111111
{
112112
}
113113

src/Annotations/AnnotationsFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(array $services = [])
4040
* Factory to create an instance from a Config object
4141
* @return mixed
4242
*/
43-
public function load($config): mixed
43+
public function load($config)
4444
{
4545
}
4646

src/Annotations/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function count(): int
6464
*
6565
* @return mixed
6666
*/
67-
public function current(): mixed
67+
public function current()
6868
{
6969
}
7070

src/Annotations/Reflection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(array $reflectionData = [])
6666
*
6767
* @return Collection|null
6868
*/
69-
public function getClassAnnotations(): Collection|null
69+
public function getClassAnnotations(): ?Collection
7070
{
7171
}
7272

src/Application/AbstractApplication.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function getDefaultModule(): string
6262
*
6363
* @return ManagerInterface|null
6464
*/
65-
public function getEventsManager(): ManagerInterface|null
65+
public function getEventsManager(): ?ManagerInterface
6666
{
6767
}
6868

@@ -72,7 +72,7 @@ public function getEventsManager(): ManagerInterface|null
7272
* @param string $name *
7373
* @return array|mixed
7474
*/
75-
public function getModule(string $name): object|array
75+
public function getModule(string $name)
7676
{
7777
}
7878

src/Assets/Asset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function getType(): string
194194
*
195195
* @return string|null
196196
*/
197-
public function getVersion(): string|null
197+
public function getVersion(): ?string
198198
{
199199
}
200200

src/Assets/AssetInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getAssetKey(): string;
2626
*
2727
* @return array|null
2828
*/
29-
public function getAttributes(): array|null;
29+
public function getAttributes(): ?array;
3030

3131
/**
3232
* Gets if the asset must be filtered or not.

src/Assets/Manager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function has(string $name): bool
272272
* @return string|null
273273
* @throws Exception
274274
*/
275-
public function output(Collection $collection, string $type): string|null
275+
public function output(Collection $collection, string $type): ?string
276276
{
277277
}
278278

src/Autoload/Loader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function autoload(string $className): bool
155155
*
156156
* @return string|null
157157
*/
158-
public function getCheckedPath(): string|null
158+
public function getCheckedPath(): ?string
159159
{
160160
}
161161

@@ -209,7 +209,7 @@ public function getFiles(): array
209209
*
210210
* @return string|null
211211
*/
212-
public function getFoundPath(): string|null
212+
public function getFoundPath(): ?string
213213
{
214214
}
215215

src/Cache/AbstractCache.php

+41-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
use DateInterval;
1313
use Phalcon\Cache\Adapter\AdapterInterface;
1414
use Phalcon\Cache\Exception\InvalidArgumentException;
15+
use Phalcon\Events\EventsAwareInterface;
16+
use Phalcon\Events\ManagerInterface;
1517
use Traversable;
1618

1719
/**
1820
* This component offers caching capabilities for your application.
1921
*/
20-
abstract class AbstractCache implements \Phalcon\Cache\CacheInterface
22+
abstract class AbstractCache implements \Phalcon\Cache\CacheInterface, \Phalcon\Events\EventsAwareInterface
2123
{
2224
/**
2325
* The adapter
@@ -26,6 +28,13 @@ abstract class AbstractCache implements \Phalcon\Cache\CacheInterface
2628
*/
2729
protected $adapter;
2830

31+
/**
32+
* Event Manager
33+
*
34+
* @var ManagerInterface|null
35+
*/
36+
protected $eventsManager = null;
37+
2938
/**
3039
* Constructor.
3140
*
@@ -44,6 +53,25 @@ public function getAdapter(): AdapterInterface
4453
{
4554
}
4655

56+
/**
57+
* Sets the event manager
58+
*
59+
* @param \Phalcon\Events\ManagerInterface $eventsManager
60+
* @return void
61+
*/
62+
public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager): void
63+
{
64+
}
65+
66+
/**
67+
* Get the event manager
68+
*
69+
* @return ManagerInterface|null
70+
*/
71+
public function getEventsManager(): ?ManagerInterface
72+
{
73+
}
74+
4775
/**
4876
* Checks the key. If it contains invalid characters an exception is thrown
4977
*
@@ -114,7 +142,7 @@ protected function doDeleteMultiple($keys): bool
114142
* @throws InvalidArgumentException MUST be thrown if the $key string is
115143
* not a legal value.
116144
*/
117-
protected function doGet(string $key, $defaultValue = null): mixed
145+
protected function doGet(string $key, $defaultValue = null)
118146
{
119147
}
120148

@@ -176,6 +204,17 @@ protected function doSetMultiple($values, $ttl = null): bool
176204
{
177205
}
178206

207+
/**
208+
* Trigger an event for the eventsManager.
209+
*
210+
* @param string $eventName
211+
* @param mixed $keys
212+
* @return void
213+
*/
214+
protected function fire(string $eventName, $keys): void
215+
{
216+
}
217+
179218
/**
180219
* Returns the exception class that will be used for exceptions thrown
181220
*

src/Cache/Adapter/Apcu.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Apcu extends \Phalcon\Storage\Adapter\Apcu implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cache/Adapter/Libmemcached.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Libmemcached extends \Phalcon\Storage\Adapter\Libmemcached implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cache/Adapter/Memory.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Memory extends \Phalcon\Storage\Adapter\Memory implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cache/Adapter/Redis.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Redis extends \Phalcon\Storage\Adapter\Redis implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cache/Adapter/Stream.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Stream extends \Phalcon\Storage\Adapter\Stream implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cache/Adapter/Weak.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
*/
1818
class Weak extends \Phalcon\Storage\Adapter\Weak implements CacheAdapterInterface
1919
{
20+
protected $eventType = 'cache';
2021
}

src/Cli/Dispatcher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Dispatcher extends \Phalcon\Dispatcher\AbstractDispatcher implements \Phal
6666
* @param array $params
6767
* @return mixed
6868
*/
69-
public function callActionMethod($handler, string $actionMethod, array $params = []): mixed
69+
public function callActionMethod($handler, string $actionMethod, array $params = [])
7070
{
7171
}
7272

@@ -96,7 +96,7 @@ public function getLastTask(): TaskInterface
9696
* @param mixed $defaultValue
9797
* @return mixed
9898
*/
99-
public function getOption($option, $filters = null, $defaultValue = null): mixed
99+
public function getOption($option, $filters = null, $defaultValue = null)
100100
{
101101
}
102102

0 commit comments

Comments
 (0)