Skip to content

Commit

Permalink
Fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudboon committed Nov 12, 2020
1 parent 32ae6ad commit ed63cb0
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 43 deletions.
3 changes: 2 additions & 1 deletion src/Phalcon/Application/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public function getEventsManager(): ManagerInterface
* Gets the module definition registered in the application via module name
*
* @param string $name
* @return array|object
*
* @return array
*/
public function getModule(string $name): array
{
Expand Down
7 changes: 4 additions & 3 deletions src/Phalcon/DataMapper/Pdo/Connection/AbstractConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function fetchValue(string $statement, array $values = array())
/**
* Return the inner PDO (if any)
*
* @return PDO
* @return \PDO
*/
public function getAdapter(): \PDO
{
Expand Down Expand Up @@ -361,7 +361,7 @@ public function lastInsertId(string $name = null): string
* @param string $statement
* @param array $values
*
* @return PDOStatement
* @return \PDOStatement
*/
public function perform(string $statement, array $values = array()): \PDOStatement
{
Expand Down Expand Up @@ -440,9 +440,10 @@ public function setProfiler(\Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface $
/**
* Bind a value using the proper PDO::PARAM_ type.
*
* @param PDOStatement $statement
* @param \PDOStatement $statement
* @param mixed $name
* @param mixed $arguments
*
* @return void
*/
protected function performBind(\PDOStatement $statement, $name, $arguments)
Expand Down
4 changes: 2 additions & 2 deletions src/Phalcon/DataMapper/Pdo/Connection/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function fetchValue(string $statement, array $values = array());
/**
* Return the inner PDO (if any)
*
* @return PDO
* @return \PDO
*/
public function getAdapter(): \PDO;

Expand All @@ -200,7 +200,7 @@ public function isConnected(): bool;
* @param string $statement
* @param array $values
*
* @return PDOStatement
* @return \PDOStatement
*/
public function perform(string $statement, array $values = array()): \PDOStatement;

Expand Down
4 changes: 1 addition & 3 deletions src/Phalcon/DataMapper/Pdo/Connection/Decorated.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ class Decorated extends \Phalcon\DataMapper\Pdo\Connection\AbstractConnection
{

/**
*
* Constructor.
*
* This overrides the parent so that it can take an existing PDO instance
* and decorate it with the extended methods.
*
* @param PDO $pdo
* @param \PDO $pdo
* @param ProfilerInterface|null $profiler
*
*/
public function __construct(\PDO $pdo, \Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface $profiler = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Phalcon/DataMapper/Query/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function __construct(\Phalcon\DataMapper\Pdo\Connection $connection, Bind
*
* @param string $table
*
* @return AbstractConditions
* @return self
*/
public function from(string $table): Delete
public function from(string $table): self
{
}

Expand Down
10 changes: 5 additions & 5 deletions src/Phalcon/DataMapper/Query/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function __construct(\Phalcon\DataMapper\Pdo\Connection $connection, Bind
* Sets a column for the `INSERT` query
*
* @param string $column
*
* @return this
* @param mixed $value
* @param int $type
*
* @return self
*/
public function column(string $column, $value = null, int $type = -1): Insert
public function column(string $column, $value = null, int $type = -1): self
{
}

Expand All @@ -45,9 +45,9 @@ public function column(string $column, $value = null, int $type = -1): Insert
*
* @param array $columns
*
* @return this
* @return self
*/
public function columns(array $columns): Insert
public function columns(array $columns): self
{
}

Expand Down
10 changes: 5 additions & 5 deletions src/Phalcon/DataMapper/Query/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function __construct(\Phalcon\DataMapper\Pdo\Connection $connection, Bind
* Sets a column for the `UPDATE` query
*
* @param string $column
*
* @return this
* @param mixed $value
* @param int $type
*
* @return self
*/
public function column(string $column, $value = null, int $type = -1): Update
public function column(string $column, $value = null, int $type = -1): self
{
}

Expand All @@ -45,9 +45,9 @@ public function column(string $column, $value = null, int $type = -1): Update
*
* @param array $columns
*
* @return this
* @return self
*/
public function columns(array $columns): Update
public function columns(array $columns): self
{
}

Expand Down
12 changes: 1 addition & 11 deletions src/Phalcon/Db/Adapter/Pdo/AbstractPdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,7 @@ abstract class AbstractPdo extends AbstractAdapter
/**
* Constructor for Phalcon\Db\Adapter\Pdo
*
* @param array|\Phalcon\Config $descriptor = [
* 'host' => 'localhost',
* 'port' => '3306',
* 'dbname' => 'blog',
* 'username' => 'sigma'
* 'password' => 'secret'
* 'dialectClass' => null,
* 'options' => [],
* 'dsn' => null,
* 'charset' => 'utf8mb4'
* ]
* @param array $descriptor
*/
public function __construct(array $descriptor)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Phalcon/Db/Result/Pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public function __construct(\Phalcon\Db\Adapter\AdapterInterface $connection, \P
* $row = $result->fetch();
* ```
*
* @param long $number
* @param int $number
*
* @return void
*/
public function dataSeek(int $number)
Expand Down
2 changes: 1 addition & 1 deletion src/Phalcon/Db/ResultInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ResultInterface
* Moves internal resultset cursor to another position letting us to fetch a
* certain row
*
* @param long $number
* @param int $number
*/
public function dataSeek(int $number);

Expand Down
4 changes: 1 addition & 3 deletions src/Phalcon/Dispatcher/AbstractDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ 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 object|false 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.
* @return bool
*
* @throws \Exception if any uncaught or unhandled exception occurs during the dispatcher process.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Phalcon/Dispatcher/DispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface DispatcherInterface
/**
* Dispatches a handle action taking into account the routing parameters
*
* @return object|false
* @return bool
*/
public function dispatch(): bool;

Expand Down
3 changes: 2 additions & 1 deletion src/Phalcon/Helper/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ final public static function decode(string $data, bool $associative = false, int
* @param int $options Bitmask of JSON decode options.
* @param int $depth Recursion depth.
*
* @return mixed
* @return string
*
* @throws \InvalidArgumentException if the JSON cannot be encoded.
*
* @link http://www.php.net/manual/en/function.json-encode.php
*/
final public static function encode($data, int $options = 0, int $depth = 512): string
Expand Down
2 changes: 1 addition & 1 deletion src/Phalcon/Html/Helper/AbstractHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class AbstractHelper
/**
* AbstractHelper constructor.
*
* @param Escaper $escaper
* @param EscaperInterface $escaper
*/
public function __construct(\Phalcon\Escaper\EscaperInterface $escaper)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Phalcon/Http/Message/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private function filterPath(string $path): string
*
* @param int|null $port
*
* @return int|null
* @return int
*/
private function filterPort($port): int
{
Expand Down
3 changes: 2 additions & 1 deletion src/Phalcon/Mvc/Model/Binder.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public function bindToHandler($handler, array $params, string $cacheKey, string
/**
* Find the model by param value.
*
* @return object|false
* @return bool
*
* @param mixed $paramValue
* @param string $className
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Phalcon/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public static function startsWith(string $text, string $start, bool $ignoreCase
* ```
*
* @param int $type
* @param long $length
* @param int $length
*
* @return string
*/
public static function random(int $type = 0, int $length = 8): string
Expand Down

0 comments on commit ed63cb0

Please sign in to comment.