-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from ruudboon/4.x
Bumped Stubs to RC.2
- Loading branch information
Showing
462 changed files
with
1,189 additions
and
5,335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
use Phalcon\Cache\Adapter\AdapterInterface; | ||
use Phalcon\Cache\Exception\InvalidArgumentException; | ||
use Psr\SimpleCache\CacheInterface; | ||
|
||
/** | ||
* This component offers caching capabilities for your application. | ||
* Phalcon\Cache implements PSR-16. | ||
*/ | ||
class Cache implements CacheInterface | ||
class Cache implements \Psr\SimpleCache\CacheInterface | ||
{ | ||
/** | ||
* The adapter | ||
|
@@ -49,7 +41,7 @@ public function __construct(\Phalcon\Cache\Adapter\AdapterInterface $adapter) | |
/** | ||
* Wipes clean the entire cache's keys. | ||
* | ||
* @return bool | ||
* @return bool True on success and false on failure. | ||
*/ | ||
public function clear(): bool | ||
{ | ||
|
@@ -62,9 +54,7 @@ public function clear(): bool | |
* | ||
* @return bool True if the item was successfully removed. False if there was an error. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
* @param mixed $key | ||
* @return bool | ||
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
*/ | ||
public function delete($key): bool | ||
{ | ||
|
@@ -77,9 +67,7 @@ public function delete($key): bool | |
* | ||
* @return bool True if the items were successfully removed. False if there was an error. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value. | ||
* @param mixed $keys | ||
* @return bool | ||
* @throws InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value. | ||
*/ | ||
public function deleteMultiple($keys): bool | ||
{ | ||
|
@@ -88,14 +76,12 @@ public function deleteMultiple($keys): bool | |
/** | ||
* Fetches a value from the cache. | ||
* | ||
* @param mixed $default Default value to return if the key does not exist. | ||
* @param string $key The unique key of this item in the cache. | ||
* @param mixed $defaultValue Default value to return if the key does not exist. | ||
* | ||
* @return mixed The value of the item from the cache, or $default in case of cache miss. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
* @param string $key The unique key of this item in the cache. | ||
* @param mixed $defaultValue | ||
* @return mixed | ||
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
*/ | ||
public function get($key, $defaultValue = null) | ||
{ | ||
|
@@ -104,14 +90,12 @@ public function get($key, $defaultValue = null) | |
/** | ||
* Obtains multiple cache items by their unique keys. | ||
* | ||
* @param mixed $default Default value to return for keys that do not exist. | ||
* @param iterable $keys A list of keys that can obtained in a single operation. | ||
* @param mixed $defaultValue Default value to return for keys that do not exist. | ||
* | ||
* @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value. | ||
* @param iterable $keys A list of keys that can obtained in a single operation. | ||
* @param mixed $defaultValue | ||
* @return mixed | ||
* @throws InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value. | ||
*/ | ||
public function getMultiple($keys, $defaultValue = null) | ||
{ | ||
|
@@ -124,9 +108,7 @@ public function getMultiple($keys, $defaultValue = null) | |
* | ||
* @return bool | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
* @param mixed $key | ||
* @return bool | ||
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
*/ | ||
public function has($key): bool | ||
{ | ||
|
@@ -135,17 +117,15 @@ public function has($key): bool | |
/** | ||
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. | ||
* | ||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and | ||
* @param string $key The key of the item to store. | ||
* @param mixed $value The value of the item to store. Must be serializable. | ||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and | ||
* the driver supports TTL then the library may set a default value | ||
* for it or let the driver take care of that. | ||
* | ||
* @return bool True on success and false on failure. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
* @param string $key The key of the item to store. | ||
* @param mixed $value The value of the item to store. Must be serializable. | ||
* @param mixed $ttl | ||
* @return bool | ||
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value. | ||
*/ | ||
public function set($key, $value, $ttl = null): bool | ||
{ | ||
|
@@ -154,16 +134,14 @@ public function set($key, $value, $ttl = null): bool | |
/** | ||
* Persists a set of key => value pairs in the cache, with an optional TTL. | ||
* | ||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and | ||
* @param iterable $values A list of key => value pairs for a multiple-set operation. | ||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and | ||
* the driver supports TTL then the library may set a default value | ||
* for it or let the driver take care of that. | ||
* | ||
* @return bool True on success and false on failure. | ||
* | ||
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $values is neither an array nor a Traversable, or if any of the $values are not a legal value. | ||
* @param iterable $values A list of key => value pairs for a multiple-set operation. | ||
* @param mixed $ttl | ||
* @return bool | ||
* @throws InvalidArgumentException MUST be thrown if $values is neither an array nor a Traversable, or if any of the $values are not a legal value. | ||
*/ | ||
public function setMultiple($values, $ttl = null): bool | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
use ArrayAccess; | ||
use Countable; | ||
use IteratorAggregate; | ||
use JsonSerializable; | ||
use Serializable; | ||
use Traversable; | ||
|
||
/** | ||
* `Phalcon\Collection` is a supercharged object oriented array. It implements [ArrayAccess](https://www.php.net/manual/en/class.arrayaccess.php), [Countable](https://www.php.net/manual/en/class.countable.php), [IteratorAggregate](https://www.php.net/manual/en/class.iteratoraggregate.php), [JsonSerializable](https://www.php.net/manual/en/class.jsonserializable.php), [Serializable](https://www.php.net/manual/en/class.serializable.php) | ||
* `Phalcon\Collection` is a supercharged object oriented array. It implements: | ||
* - [ArrayAccess](https://www.php.net/manual/en/class.arrayaccess.php) | ||
* - [Countable](https://www.php.net/manual/en/class.countable.php) | ||
* - [IteratorAggregate](https://www.php.net/manual/en/class.iteratoraggregate.php) | ||
* - [JsonSerializable](https://www.php.net/manual/en/class.jsonserializable.php) | ||
* - [Serializable](https://www.php.net/manual/en/class.serializable.php) | ||
* | ||
* It can be used in any part of the application that needs collection of data | ||
* Such implementations are for instance accessing globals `$_GET`, `$_POST` | ||
* etc. | ||
*/ | ||
class Collection implements | ||
ArrayAccess, | ||
Countable, | ||
IteratorAggregate, | ||
JsonSerializable, | ||
Serializable | ||
class Collection implements \ArrayAccess, \Countable, \IteratorAggregate, \JsonSerializable, \Serializable | ||
{ | ||
/** | ||
* @var array | ||
|
@@ -119,9 +105,10 @@ public function count(): int | |
* | ||
* @param string $element | ||
* @param mixed $defaultValue | ||
* @param string $cast | ||
* @return mixed | ||
*/ | ||
public function get(string $element, $defaultValue = null) | ||
public function get(string $element, $defaultValue = null, string $cast = null) | ||
{ | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
/** | ||
|
@@ -17,7 +8,7 @@ | |
* based user interface for accessing this configuration data within application | ||
* code. | ||
* | ||
*```php | ||
* ```php | ||
* $config = new \Phalcon\Config( | ||
* [ | ||
* "database" => [ | ||
|
@@ -34,7 +25,7 @@ | |
* ], | ||
* ] | ||
* ); | ||
*``` | ||
* ``` | ||
*/ | ||
class Config extends Collection | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
use Phalcon\Di\DiInterface; | ||
use Psr\Container\ContainerInterface; | ||
|
||
/** | ||
* PSR-11 Wrapper for `Phalcon\Di` | ||
*/ | ||
class Container implements ContainerInterface | ||
class Container implements \Psr\Container\ContainerInterface | ||
{ | ||
/** | ||
* @var <DiInterface> | ||
* @var DiInterface | ||
*/ | ||
protected $container; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
use Phalcon\Crypt\CryptInterface; | ||
|
@@ -31,7 +22,7 @@ | |
* echo $crypt->decrypt($encrypted, $key); | ||
* ``` | ||
*/ | ||
class Crypt implements CryptInterface | ||
class Crypt implements \Phalcon\Crypt\CryptInterface | ||
{ | ||
|
||
const PADDING_ANSI_X_923 = 1; | ||
|
@@ -165,11 +156,11 @@ public function decrypt(string $text, string $key = null): string | |
/** | ||
* Decrypt a text that is coded as a base64 string. | ||
* | ||
* @throws \Phalcon\Crypt\Mismatch | ||
* @param string $text | ||
* @param mixed $key | ||
* @param bool $safe | ||
* @return string | ||
* @throws \Phalcon\Crypt\Mismatch | ||
*/ | ||
public function decryptBase64(string $text, $key = null, bool $safe = false): string | ||
{ | ||
|
@@ -293,9 +284,9 @@ public function setCipher(string $cipher): CryptInterface | |
/** | ||
* Set the name of hashing algorithm. | ||
* | ||
* @throws \Phalcon\Crypt\Exception | ||
* @param string $hashAlgo | ||
* @return \Phalcon\Crypt\CryptInterface | ||
* @throws \Phalcon\Crypt\Exception | ||
*/ | ||
public function setHashAlgo(string $hashAlgo): CryptInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon; | ||
|
||
use Phalcon\Di\DiInterface; | ||
use Phalcon\Di\Exception\ServiceResolutionException; | ||
use Phalcon\Di\ServiceInterface; | ||
use Phalcon\Events\ManagerInterface; | ||
|
||
|
@@ -34,7 +24,7 @@ | |
* Additionally, this pattern increases testability in the code, thus making it | ||
* less prone to errors. | ||
* | ||
*```php | ||
* ```php | ||
* use Phalcon\Di; | ||
* use Phalcon\Http\Request; | ||
* | ||
|
@@ -52,9 +42,9 @@ | |
* ); | ||
* | ||
* $request = $di->getRequest(); | ||
*``` | ||
* ``` | ||
*/ | ||
class Di implements DiInterface | ||
class Di implements \Phalcon\Di\DiInterface | ||
{ | ||
/** | ||
* List of registered services | ||
|
Oops, something went wrong.