Skip to content

Commit

Permalink
updating stubs for 5.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Aug 16, 2023
1 parent 650f04e commit 7d1f32f
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 13 deletions.
9 changes: 9 additions & 0 deletions src/Autoload/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ public function unregister(): Loader
{
}

/**
* returns isRegister
*
* @return bool
*/
public function isRegistered(): bool
{
}

/**
* If the file exists, require it and return true; false otherwise
*
Expand Down
21 changes: 20 additions & 1 deletion src/Encryption/Security/JWT/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
use Phalcon\Support\Helper\Json\Encode;

/**
* JWT Builder
* Builder
*
* The builder offers
*
* @property CollectionInterface $claims
* @property CollectionInterface $jose
* @property string $passphrase
* @property SignerInterface $signer
*
* @link https://tools.ietf.org/html/rfc7519
*/
Expand Down Expand Up @@ -79,6 +86,18 @@ public function addClaim(string $name, $value): Builder
{
}

/**
* Adds a custom header
*
* @param string $name
* @param mixed $value
*
* @return Builder
*/
public function addHeader(string $name, $value): Builder
{
}

/**
* @return array|string
*/
Expand Down
10 changes: 10 additions & 0 deletions src/Encryption/Security/JWT/Token/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,44 @@ public function __construct(Item $headers, Item $claims, Signature $signature)
}

/**
* Return the registered claims
*
* @return Item
*/
public function getClaims(): Item
{
}

/**
* Return the registered headers
*
* @return Item
*/
public function getHeaders(): Item
{
}

/**
* Return the payload
*
* @return string
*/
public function getPayload(): string
{
}

/**
* Return the signature
*
* @return Signature
*/
public function getSignature(): Signature
{
}

/**
* Return the token
*
* @return string
*/
public function getToken(): string
Expand Down
28 changes: 26 additions & 2 deletions src/Encryption/Security/JWT/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,40 @@ public function __construct(\Phalcon\Encryption\Security\JWT\Token\Token $token,
}

/**
* Return an array with validation errors (if any)
*
* @return array
*/
public function getErrors(): array
{
}

/**
* Return the value of a claim
*
* @param string $claim
* @return mixed|null
*
* @return mixed
*/
public function get(string $claim)
{
}

/**
* Set the value of a claim, for comparison with the token values
*
* @param string $claim
* @param mixed $value
* @param mixed $value
*
* @return Validator
*/
public function set(string $claim, $value): Validator
{
}

/**
* Set the token to be validated
*
* @param Token $token
*
* @return Validator
Expand All @@ -83,6 +93,8 @@ public function setToken(\Phalcon\Encryption\Security\JWT\Token\Token $token): V
}

/**
* Validate the audience
*
* @param string|array $audience
*
* @return Validator
Expand All @@ -93,6 +105,8 @@ public function validateAudience($audience): Validator
}

/**
* Validate the expiration time of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -103,6 +117,8 @@ public function validateExpiration(int $timestamp): Validator
}

/**
* Validate the id of the token
*
* @param string $id
*
* @return Validator
Expand All @@ -113,6 +129,8 @@ public function validateId(string $id): Validator
}

/**
* Validate the issued at (iat) of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -123,6 +141,8 @@ public function validateIssuedAt(int $timestamp): Validator
}

/**
* Validate the issuer of the token
*
* @param string $issuer
*
* @return Validator
Expand All @@ -133,6 +153,8 @@ public function validateIssuer(string $issuer): Validator
}

/**
* Validate the notbefore (nbf) of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -143,6 +165,8 @@ public function validateNotBefore(int $timestamp): Validator
}

/**
* Validate the signature of the token
*
* @param SignerInterface $signer
* @param string $passphrase
*
Expand Down
9 changes: 9 additions & 0 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -986,4 +986,13 @@ public function getFilteredData(string $methodKey, string $method, string $name
private function getPatchPut(string $collection, string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false)
{
}

/**
* parse multipart/form-data from raw data
*
* @return array
*/
private function getFormData(): array
{
}
}
10 changes: 10 additions & 0 deletions src/Mvc/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2220,4 +2220,14 @@ public function validationHasFailed(): bool
private static function caseInsensitiveColumnMap($columnMap, $key): string
{
}

/**
* Append messages to this model from another Model.
*
* @param mixed $model
* @return void
*/
public function appendMessagesFrom($model): void
{
}
}
54 changes: 49 additions & 5 deletions src/Mvc/Model/MetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ final public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param int $index
* @return array|null
*/
final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index)
final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array
{
}

Expand All @@ -468,9 +469,9 @@ final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int
* ```
*
* @param \Phalcon\Mvc\ModelInterface $model
* @return array
* @return array|null
*/
final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): array
final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array
{
}

Expand All @@ -488,8 +489,9 @@ final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): array
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param int $index
* @return array|null
*/
final public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index)
final public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array
{
}

Expand Down Expand Up @@ -622,7 +624,7 @@ final public function writeMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int
}

/**
* Initialize the metadata for certain table
* Initialize old behavior for compatability
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param mixed $key
Expand All @@ -633,6 +635,28 @@ final protected function initialize(\Phalcon\Mvc\ModelInterface $model, $key, $t
{
}

/**
* Initialize the metadata for certain table
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param mixed $key
* @return bool
*/
final protected function initializeMetaData(\Phalcon\Mvc\ModelInterface $model, $key): bool
{
}

/**
* Initialize ColumnMap for a certain table
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param mixed $key
* @return bool
*/
final protected function initializeColumnMap(\Phalcon\Mvc\ModelInterface $model, $key): bool
{
}

/**
* Throws an exception when the metadata cannot be written
*
Expand All @@ -653,4 +677,24 @@ private function throwWriteException($option): void
protected function getArrVal(array $collection, $index, $defaultValue = null)
{
}

/**
* Returns a MetaData Unique key for meta-data is created using className
*
* @return string
* @param \Phalcon\Mvc\ModelInterface $model
*/
final public function getMetaDataUniqueKey(\Phalcon\Mvc\ModelInterface $model): ?string
{
}

/**
* Returns a ColumnMap Unique key for meta-data is created using className
*
* @return string
* @param \Phalcon\Mvc\ModelInterface $model
*/
final public function getColumnMapUniqueKey(\Phalcon\Mvc\ModelInterface $model): ?string
{
}
}
11 changes: 6 additions & 5 deletions src/Mvc/Model/MetaDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,26 @@ public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array;
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param int $index
* @return array|null
*/
public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index);
public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array;

/**
* Reads meta-data for certain model
*
* @param \Phalcon\Mvc\ModelInterface $model
* @return array
* @return array|null
*/
public function readMetaData(\Phalcon\Mvc\ModelInterface $model): array;
public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array;

/**
* Reads meta-data for certain model using a MODEL_ constant
*
* @param \Phalcon\Mvc\ModelInterface $model
* @param int $index
* @return mixed
* @return array|null
*/
public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index);
public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array;

/**
* Resets internal meta-data in order to regenerate it
Expand Down

0 comments on commit 7d1f32f

Please sign in to comment.