Skip to content

Commit

Permalink
Merge pull request #67 from phalcon/v5-alpha.6
Browse files Browse the repository at this point in the history
Update stubs of Phalcon v5.0.0-alpha.6
  • Loading branch information
Jeckerson authored Sep 17, 2021
2 parents c11c17d + dad9498 commit 45af05d
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 56 deletions.
4 changes: 2 additions & 2 deletions src/Application/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function getEventsManager(): ?ManagerInterface
* Gets the module definition registered in the application via module name
*
* @param string $name *
* @return array
* @return array|object
*/
public function getModule(string $name): array
public function getModule(string $name)
{
}

Expand Down
13 changes: 7 additions & 6 deletions src/Db/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function begin(bool $nesting = true): bool;
* Closes active connection returning success. Phalcon automatically closes
* and destroys active connections within Phalcon\Db\Pool
*
* @return bool
* @return void
*/
public function close(): bool;
public function close(): void;

/**
* Commits the active transaction in the connection
Expand All @@ -99,9 +99,9 @@ public function commit(bool $nesting = true): bool;
* constructor. Call it when you need to restore a database connection
*
* @param array $descriptor
* @return bool
* @return void
*/
public function connect(array $descriptor = null): bool;
public function connect(array $descriptor = []): void;

/**
* Creates a new savepoint
Expand Down Expand Up @@ -486,9 +486,10 @@ public function isUnderTransaction(): bool;
* Returns insert id for the auto_increment column inserted in the last SQL
* statement
*
* @param mixed $sequenceName
* @param string|null $name Name of the sequence object from which the ID should be returned.
* @return string|bool
*/
public function lastInsertId($sequenceName = null);
public function lastInsertId(string $name = null);

/**
* Appends a LIMIT clause to sqlQuery argument
Expand Down
18 changes: 10 additions & 8 deletions src/Db/Adapter/Pdo/AbstractPdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public function commit(bool $nesting = true): bool
* Closes the active connection returning success. Phalcon automatically
* closes and destroys active connections when the request ends
*
* @return bool
* @return void
*/
public function close(): bool
public function close(): void
{
}

Expand Down Expand Up @@ -143,9 +143,9 @@ public function close(): bool
* ```
*
* @param array $descriptor
* @return bool
* @return void
*/
public function connect(array $descriptor = null): bool
public function connect(array $descriptor = []): void
{
}

Expand Down Expand Up @@ -248,8 +248,10 @@ public function executePrepared(\PDOStatement $statement, array $placeholders, $

/**
* Return the error info, if any
*
* @return array
*/
public function getErrorInfo()
public function getErrorInfo(): array
{
}

Expand Down Expand Up @@ -311,10 +313,10 @@ public function isUnderTransaction(): bool
* $id = $connection->lastInsertId();
* ```
*
* @param mixed $sequenceName
* @return int|bool
* @param string|null $name
* @return string|bool
*/
public function lastInsertId($sequenceName = null)
public function lastInsertId(string $name = null)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Db/Adapter/Pdo/Postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function __construct(array $descriptor)
* constructor. Call it when you need to restore a database connection.
*
* @param array $descriptor
* @return bool
* @return void
*/
public function connect(array $descriptor = null): bool
public function connect(array $descriptor = []): void
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Db/Adapter/Pdo/Sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public function __construct(array $descriptor)
* constructor. Call it when you need to restore a database connection.
*
* @param array $descriptor
* @return bool
* @return void
*/
public function connect(array $descriptor = null): bool
public function connect(array $descriptor = []): void
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Dispatcher/AbstractDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ public function callActionMethod($handler, string $actionMethod, array $params =
* Process the results of the router by calling into the appropriate
* controller action(s) including any routing data or injected parameters.
*
* @return bool Returns the dispatched handler class (the Controller for Mvc dispatching or a Task
* @return mixed Returns the dispatched handler class (the Controller for Mvc dispatching or a Task
* for CLI dispatching) or <tt>false</tt> if an exception occurred and the operation was
* stopped by returning <tt>false</tt> in the exception handler.
*
* @throws \Exception if any uncaught or unhandled exception occurs during the dispatcher process.
*/
public function dispatch(): bool
public function dispatch()
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Dispatcher/DispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ interface DispatcherInterface
/**
* Dispatches a handle action taking into account the routing parameters
*
* @return bool
* @return mixed
*/
public function dispatch(): bool;
public function dispatch();

/**
* Forwards the execution flow to another controller/action
Expand Down
2 changes: 0 additions & 2 deletions src/Http/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ abstract class AbstractRequest extends \Phalcon\Http\Message\AbstractMessage imp


/**
*
* Retrieves the HTTP method of the request.
*
* @return string
Expand All @@ -54,7 +53,6 @@ public function getMethod(): string
}

/**
*
* Retrieves the URI instance.
*
* This method MUST return a UriInterface instance.
Expand Down
8 changes: 0 additions & 8 deletions src/Http/Message/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,13 @@ final class Response extends AbstractMessage implements \Psr\Http\Message\Respon


/**
*
* Gets the response reason phrase associated with the status code.
*
* Because a reason phrase is not a required element in a response
*
* status line, the reason phrase value MAY be empty. Implementations MAY
*
* choose to return the default RFC 7231 recommended reason phrase (or
*
* those
*
* listed in the IANA HTTP Status Code Registry) for the response's
*
* status code.
*
* @return string
Expand All @@ -70,11 +64,9 @@ public function getReasonPhrase(): string
}

/**
*
* Gets the response status code.
*
* The status code is a 3-digit integer result code of the server's attempt
*
* to understand and satisfy the request.
*
* @return int
Expand Down
18 changes: 0 additions & 18 deletions src/Http/Message/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ final class ServerRequest extends \Phalcon\Http\Message\AbstractRequest implemen


/**
*
* Retrieve cookies.
*
* Retrieves cookies sent by the client to the server.
*
* The data MUST be compatible with the structure of the $_COOKIE
*
* superglobal.
*
* @return array
Expand All @@ -112,21 +110,15 @@ public function getCookieParams(): array
}

/**
*
* Retrieve any parameters provided in the request body.
*
* If the request Content-Type is either application/x-www-form-urlencoded
*
* or multipart/form-data, and the request method is POST, this method MUST
*
* return the contents of $_POST.
*
* Otherwise, this method may return any results of deserializing
*
* the request body content; as parsing returns structured content, the
*
* potential types MUST be arrays or objects only. A null value indicates
*
* the absence of body content.
*
* @return mixed
Expand All @@ -136,17 +128,13 @@ public function getParsedBody()
}

/**
*
* Retrieve query string arguments.
*
* Retrieves the deserialized query string arguments, if any.
*
* Note: the query params might not be in sync with the URI or server
*
* params. If you need to ensure you are only getting the original
*
* values, you may need to parse the query string from
*
* `getUri()->getQuery()` or from the `QUERY_STRING` server param.
*
* @return array
Expand All @@ -156,13 +144,10 @@ public function getQueryParams(): array
}

/**
*
* Retrieve server parameters.
*
* Retrieves data related to the incoming request environment,
*
* typically derived from PHP's $_SERVER superglobal. The data IS NOT
*
* REQUIRED to originate from $_SERVER.
*
* @return array
Expand All @@ -172,15 +157,12 @@ public function getServerParams(): array
}

/**
*
* Retrieve normalized file upload data.
*
* This method returns upload metadata in a normalized tree, with each leaf
*
* an instance of Psr\Http\Message\UploadedFileInterface.
*
* These values MAY be prepared from $_FILES or the message body during
*
* instantiation, or MAY be injected via withUploadedFiles().
*
* @return array
Expand Down
4 changes: 2 additions & 2 deletions src/Mvc/Model/Binder.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ public function bindToHandler($handler, array $params, string $cacheKey, string
/**
* Find the model by param value.
*
* @return bool
* @return mixed
* @param mixed $paramValue
* @param string $className
*/
protected function findBoundModel($paramValue, string $className): bool
protected function findBoundModel($paramValue, string $className)
{
}

Expand Down
12 changes: 12 additions & 0 deletions src/Security/JWT/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ public function init(): Builder
{
}

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

/**
* @return array|string
*/
Expand Down
2 changes: 0 additions & 2 deletions src/Storage/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ abstract class AbstractAdapter implements \Phalcon\Storage\Adapter\AdapterInterf


/**
*
* Name of the default serializer class
*
* @return string
Expand All @@ -77,7 +76,6 @@ public function getDefaultSerializer(): string
}

/**
*
* Name of the default serializer class
*
* @param string $defaultSerializer
Expand Down

0 comments on commit 45af05d

Please sign in to comment.