Skip to content

Commit

Permalink
Merge pull request #91 from niden/master
Browse files Browse the repository at this point in the history
updating stubs for 5.2.3
  • Loading branch information
niden authored Jul 26, 2023
2 parents a9e3686 + 081565c commit 650f04e
Show file tree
Hide file tree
Showing 17 changed files with 294 additions and 110 deletions.
20 changes: 20 additions & 0 deletions src/Cache/Adapter/Weak.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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\Cache\Adapter;

use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface;
use Phalcon\Storage\Adapter\Weak as StorageWeak;

/**
* WeakCache implementation based on WeakReference
*/
class Weak extends \Phalcon\Storage\Adapter\Weak implements CacheAdapterInterface
{
}
14 changes: 1 addition & 13 deletions src/Config/Adapter/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
namespace Phalcon\Config\Adapter;

use InvalidArgumentException;
use Phalcon\Config\Config;
use Phalcon\Support\Helper\Json\Decode;

/**
* Reads JSON files and converts them to Phalcon\Config\Config objects.
Expand Down Expand Up @@ -42,16 +42,4 @@ class Json extends Config
public function __construct(string $filePath)
{
}

/**
* @todo This will be removed when traits are introduced
* @param string $data
* @param bool $associative
* @param int $depth
* @param int $options
* @return mixed
*/
private function decode(string $data, bool $associative = false, int $depth = 512, int $options = 0)
{
}
}
18 changes: 6 additions & 12 deletions src/DataMapper/Pdo/Profiler/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
namespace Phalcon\DataMapper\Pdo\Profiler;

use InvalidArgumentException;
use Phalcon\DataMapper\Pdo\Exception\Exception;
use Phalcon\Logger\Enum;
use Phalcon\Logger\LoggerInterface;
use Phalcon\Support\Helper\Json\Encode;

/**
* Sends query profiles to a logger.
Expand Down Expand Up @@ -44,6 +44,11 @@ class Profiler implements \Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface
*/
protected $logger;

/**
* @var Encode
*/
private $encode;

/**
* Constructor.
*
Expand Down Expand Up @@ -142,15 +147,4 @@ public function setLogLevel(string $logLevel): ProfilerInterface
public function start(string $method): void
{
}

/**
* @todo This will be removed when traits are introduced
* @param mixed $data
* @param int $options
* @param int $depth
* @return string
*/
private function encode($data, int $options = 0, int $depth = 512): string
{
}
}
3 changes: 2 additions & 1 deletion src/Di/Injectable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace Phalcon\Di;

use stdClass;
use Phalcon\Di\Di;
use Phalcon\Session\BagInterface;

Expand Down Expand Up @@ -41,7 +42,7 @@
* @property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent
* @property \Phalcon\Mvc\View|\Phalcon\Mvc\ViewInterface $view
*/
abstract class Injectable implements \Phalcon\Di\InjectionAwareInterface
abstract class Injectable extends stdClass implements \Phalcon\Di\InjectionAwareInterface
{
/**
* Dependency Injector
Expand Down
22 changes: 8 additions & 14 deletions src/Encryption/Security/JWT/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
namespace Phalcon\Encryption\Security\JWT;

use InvalidArgumentException;
use Phalcon\Support\Collection;
use Phalcon\Support\Collection\CollectionInterface;
use Phalcon\Encryption\Security\JWT\Exceptions\ValidatorException;
use Phalcon\Encryption\Security\JWT\Signer\SignerInterface;
use Phalcon\Encryption\Security\JWT\Token\Enum;
use Phalcon\Encryption\Security\JWT\Token\Item;
use Phalcon\Encryption\Security\JWT\Token\Signature;
use Phalcon\Encryption\Security\JWT\Token\Token;
use Phalcon\Support\Collection;
use Phalcon\Support\Collection\CollectionInterface;
use Phalcon\Support\Helper\Json\Encode;

/**
* JWT Builder
Expand All @@ -31,6 +31,11 @@ class Builder
*/
private $claims;

/**
* @var Encode
*/
private $encode;

/**
* @var CollectionInterface
*/
Expand Down Expand Up @@ -321,15 +326,4 @@ protected function setClaim(string $name, $value): Builder
private function encodeUrl(string $input): string
{
}

/**
* @todo This will be removed when traits are introduced
* @param mixed $data
* @param int $options
* @param int $depth
* @return string
*/
private function encode($data, int $options = 0, int $depth = 512): string
{
}
}
25 changes: 13 additions & 12 deletions src/Encryption/Security/JWT/Token/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Phalcon\Encryption\Security\JWT\Token;

use InvalidArgumentException;
use Phalcon\Support\Helper\Json\Decode;

/**
* Token Parser class.
Expand All @@ -20,6 +21,18 @@
*/
class Parser
{
/**
* @var Decode
*/
private $decode;

/**
* @param \Phalcon\Support\Helper\Json\Decode $decode
*/
public function __construct(\Phalcon\Support\Helper\Json\Decode $decode = null)
{
}

/**
* Parse a token and return it
*
Expand Down Expand Up @@ -76,18 +89,6 @@ private function parseToken(string $token): array
{
}

/**
* @todo This will be removed when traits are introduced
* @param string $data
* @param bool $associative
* @param int $depth
* @param int $options
* @return mixed
*/
private function decode(string $data, bool $associative = false, int $depth = 512, int $options = 0)
{
}

/**
* @todo This will be removed when traits are introduced
* @param string $input
Expand Down
1 change: 1 addition & 0 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Phalcon\Http\Request\File;
use Phalcon\Http\Request\FileInterface;
use Phalcon\Http\Request\Exception;
use Phalcon\Support\Helper\Json\Decode;
use UnexpectedValueException;
use stdClass;

Expand Down
26 changes: 10 additions & 16 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@

use DateTime;
use DateTimeZone;
use InvalidArgumentException;
use Phalcon\Di\Di;
use Phalcon\Di\DiInterface;
use Phalcon\Di\InjectionAwareInterface;
use Phalcon\Events\EventsAwareInterface;
use Phalcon\Events\ManagerInterface;
use Phalcon\Http\Message\ResponseStatusCodeInterface;
use Phalcon\Http\Response\CookiesInterface;
use Phalcon\Http\Response\Exception;
use Phalcon\Http\Response\HeadersInterface;
use Phalcon\Http\Response\CookiesInterface;
use Phalcon\Mvc\Url\UrlInterface;
use Phalcon\Mvc\ViewInterface;
use Phalcon\Http\Response\Headers;
use Phalcon\Di\InjectionAwareInterface;
use Phalcon\Events\EventsAwareInterface;
use Phalcon\Events\ManagerInterface;
use Phalcon\Support\Helper\Json\Encode;

/**
* Part of the HTTP cycle is return responses to the clients.
Expand Down Expand Up @@ -81,6 +81,11 @@ class Response implements \Phalcon\Http\ResponseInterface, \Phalcon\Di\Injection
*/
protected $statusCodes = [];

/**
* @var Encode
*/
private $encode;

/**
* Phalcon\Http\Response constructor
*
Expand Down Expand Up @@ -517,15 +522,4 @@ public function setRawHeader(string $header): ResponseInterface
private function getBasename(string $uri, $suffix = null): string
{
}

/**
* @todo This will be removed when traits are introduced
* @param mixed $data
* @param int $options
* @param int $depth
* @return string
*/
private function encode($data, int $options = 0, int $depth = 512): string
{
}
}
9 changes: 9 additions & 0 deletions src/Mvc/Model/MetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ abstract class MetaData implements \Phalcon\Di\InjectionAwareInterface, \Phalcon
*/
protected $strategy = null;

/**
* Return the internal cache adapter
*
* @return CacheAdapterInterface|null
*/
public function getAdapter(): ?CacheAdapterInterface
{
}

/**
* Returns table attributes names (fields)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Mvc/Model/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* This component allows Phalcon\Mvc\Model to return rows without an associated entity.
* This objects implements the ArrayAccess interface to allow access the object as object->x or array[x].
*/
class Row implements \Phalcon\Mvc\EntityInterface, \Phalcon\Mvc\Model\ResultInterface, \ArrayAccess, \JsonSerializable
class Row extends \stdClass implements \Phalcon\Mvc\EntityInterface, \Phalcon\Mvc\Model\ResultInterface, \ArrayAccess, \JsonSerializable
{
/**
* Serializes the object for json_encode
Expand Down
1 change: 1 addition & 0 deletions src/Mvc/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ public function getRender(string $controllerName, string $actionName, array $par
/**
* Returns a parameter previously set in the view
*
* @return mixed|null
* @param string $key
*/
public function getVar(string $key)
Expand Down
12 changes: 12 additions & 0 deletions src/Storage/Adapter/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ private function getFilepath(string $key): string
{
}

/**
* Check if the key has the prefix and remove it, otherwise just return the
* key unaltered
*
* @param string $key
*
* @return string
*/
private function getKeyWithoutPrefix(string $key): string
{
}

/**
* Returns an iterator for the directory contents
*
Expand Down
Loading

0 comments on commit 650f04e

Please sign in to comment.