Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error interface method parameters type #2768

Merged
merged 3 commits into from
Sep 4, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix error interface method parameters type
  • Loading branch information
dreamsxin committed Sep 4, 2014
commit 0cb82c09e569512996ce64ae0f3749aa09813b06
4 changes: 3 additions & 1 deletion phalcon/annotations/adapterinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace Phalcon\Annotations;

use Phalcon\Annotations\ReaderInterface;

/**
* Phalcon\Annotations\AdapterInterface
*
Expand All @@ -32,7 +34,7 @@ interface AdapterInterface
*
* @param Phalcon\Annotations\ReaderInterface reader
*/
public function setReader(reader);
public function setReader(<ReaderInterface> reader);

/**
* Returns the annotation reader
Expand Down
12 changes: 6 additions & 6 deletions phalcon/db/adapterinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ interface AdapterInterface
* @param Phalcon\Db\ColumnInterface column
* @return boolean
*/
public function addColumn(tableName, schemaName, column);
public function addColumn(tableName, schemaName, <\Phalcon\Db\ColumnInterface> column);

/**
* Modifies a table column based on a definition
Expand All @@ -197,7 +197,7 @@ interface AdapterInterface
* @param Phalcon\Db\ColumnInterface column
* @return boolean
*/
public function modifyColumn(tableName, schemaName, column);
public function modifyColumn(tableName, schemaName, <\Phalcon\Db\ColumnInterface> column);

/**
* Drops a column from a table
Expand All @@ -217,7 +217,7 @@ interface AdapterInterface
* @param Phalcon\Db\IndexInterface index
* @return boolean
*/
public function addIndex(tableName, schemaName, index);
public function addIndex(tableName, schemaName, <\Phalcon\Db\IndexInterface> index);

/**
* Drop an index from a table
Expand All @@ -237,7 +237,7 @@ interface AdapterInterface
* @param Phalcon\Db\IndexInterface index
* @return boolean
*/
public function addPrimaryKey(tableName, schemaName, index);
public function addPrimaryKey(tableName, schemaName, <\Phalcon\Db\IndexInterface> index);

/**
* Drops primary key from a table
Expand All @@ -256,7 +256,7 @@ interface AdapterInterface
* @param Phalcon\Db\ReferenceInterface reference
* @return boolean true
*/
public function addForeignKey(tableName, schemaName, reference);
public function addForeignKey(tableName, schemaName, <\Phalcon\Db\ReferenceInterface> reference);

/**
* Drops a foreign key from a table
Expand All @@ -274,7 +274,7 @@ interface AdapterInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function getColumnDefinition(column);
public function getColumnDefinition(<\Phalcon\Db\ColumnInterface> column);

/**
* List all tables on a database
Expand Down
18 changes: 10 additions & 8 deletions phalcon/db/dialect/postgresql.zep
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace Phalcon\Db\Dialect;
use Phalcon\Db\Exception;
use Phalcon\Db\Dialect;
use Phalcon\Db\DialectInterface;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\ReferenceInterface;

/**
* Phalcon\Db\Dialect\Postgresql
Expand All @@ -40,7 +42,7 @@ class Postgresql extends Dialect implements DialectInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function getColumnDefinition(column) -> string
public function getColumnDefinition(<ColumnInterface> column) -> string
{
var size, columnType, columnSql;

Expand Down Expand Up @@ -94,7 +96,7 @@ class Postgresql extends Dialect implements DialectInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function addColumn(tableName, schemaName, column)
public function addColumn(tableName, schemaName, <ColumnInterface> column)
{
throw new Exception("Not implemented yet");
}
Expand All @@ -107,7 +109,7 @@ class Postgresql extends Dialect implements DialectInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function modifyColumn(tableName, schemaName, column)
public function modifyColumn(tableName, schemaName, <ColumnInterface> column)
{
throw new Exception("Not implemented yet");
}
Expand All @@ -130,10 +132,10 @@ class Postgresql extends Dialect implements DialectInterface
*
* @param string tableName
* @param string schemaName
* @param Phalcon\Db\Index index
* @param Phalcon\Db\IndexInterface index
* @return string
*/
public function addIndex(tableName, schemaName, index)
public function addIndex(tableName, schemaName, <\Phalcon\Db\IndexInterface> index)
{
throw new Exception("Not implemented yet");
}
Expand All @@ -156,10 +158,10 @@ class Postgresql extends Dialect implements DialectInterface
*
* @param string tableName
* @param string schemaName
* @param Phalcon\Db\Index index
* @param Phalcon\Db\IndexInterface index
* @return string
*/
public function addPrimaryKey(tableName, schemaName, index)
public function addPrimaryKey(tableName, schemaName, <\Phalcon\Db\IndexInterface> index)
{
throw new Exception("Not implemented yet");
}
Expand All @@ -184,7 +186,7 @@ class Postgresql extends Dialect implements DialectInterface
* @param Phalcon\Db\ReferenceInterface reference
* @return string
*/
public function addForeignKey(tableName, schemaName, reference)
public function addForeignKey(tableName, schemaName, <ReferenceInterface> reference)
{
throw new Exception("Not implemented yet");
}
Expand Down
12 changes: 6 additions & 6 deletions phalcon/db/dialectinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface DialectInterface
*
* @param Phalcon\Db\ColumnInterface column
*/
public function getColumnDefinition(column);
public function getColumnDefinition(<\Phalcon\Db\ColumnInterface> column);

/**
* Generates SQL to add a column to a table
Expand All @@ -83,7 +83,7 @@ interface DialectInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function addColumn(tableName, schemaName, column);
public function addColumn(tableName, schemaName, <\Phalcon\Db\ColumnInterface> column);

/**
* Generates SQL to modify a column in a table
Expand All @@ -93,7 +93,7 @@ interface DialectInterface
* @param Phalcon\Db\ColumnInterface column
* @return string
*/
public function modifyColumn(tableName, schemaName, column);
public function modifyColumn(tableName, schemaName, <\Phalcon\Db\ColumnInterface> column);
/**
* Generates SQL to delete a column from a table
*
Expand All @@ -112,7 +112,7 @@ interface DialectInterface
* @param Phalcon\Db\IndexInterface index
* @return string
*/
public function addIndex(tableName, schemaName, index);
public function addIndex(tableName, schemaName, <\Phalcon\Db\IndexInterface> index);

/**
* Generates SQL to delete an index from a table
Expand All @@ -132,7 +132,7 @@ interface DialectInterface
* @param Phalcon\Db\IndexInterface index
* @return string
*/
public function addPrimaryKey(tableName, schemaName, index);
public function addPrimaryKey(tableName, schemaName, <\Phalcon\Db\IndexInterface> index);

/**
* Generates SQL to delete primary key from a table
Expand All @@ -151,7 +151,7 @@ interface DialectInterface
* @param Phalcon\Db\ReferenceInterface reference
* @return string
*/
public function addForeignKey(tableName, schemaName, reference);
public function addForeignKey(tableName, schemaName, <\Phalcon\Db\ReferenceInterface> reference);

/**
* Generates SQL to delete a foreign key from a table
Expand Down
4 changes: 2 additions & 2 deletions phalcon/db/resultinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ interface ResultInterface
* Phalcon\Db\Result\Pdo constructor
*
* @param Phalcon\Db\AdapterInterface connection
* @param \PDOStatement result
* @param string sqlStatement
* @param array bindParams
* @param array bindTypes
* @param \PDOStatement result
*/
public function __construct(connection, result, sqlStatement=null, bindParams=null, bindTypes=null);
public function __construct(<\Phalcon\Db\AdapterInterface> connection, <\PDOStatement> result, sqlStatement=null, bindParams=null, bindTypes=null);

/**
* Allows to executes the statement again. Some database systems don't support scrollable cursors,
Expand Down
7 changes: 5 additions & 2 deletions phalcon/diinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

namespace Phalcon;

use Phalcon\DiInterface;
use Phalcon\Di\ServiceInterface;

/**
* Phalcon\DiInterface
*
Expand Down Expand Up @@ -90,7 +93,7 @@ interface DiInterface extends \ArrayAccess
* @param Phalcon\Di\ServiceInterface rawDefinition
* @return Phalcon\Di\ServiceInterface
*/
public function setRaw(name, rawDefinition);
public function setRaw(name, <ServiceInterface> rawDefinition);

/**
* Returns a service definition without resolving
Expand Down Expand Up @@ -135,7 +138,7 @@ interface DiInterface extends \ArrayAccess
*
* @param Phalcon\DiInterface dependencyInjector
*/
public static function setDefault(dependencyInjector);
public static function setDefault(<DiInterface> dependencyInjector);

/**
* Return the last DI created
Expand Down
4 changes: 2 additions & 2 deletions phalcon/forms/elementinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ interface ElementInterface
* @param Phalcon\Validation\Message\Group group
* @return Phalcon\Forms\ElementInterface
*/
public function setMessages(group);
public function setMessages(<\Phalcon\Validation\Message\Group> group);

/**
* Appends a message to the internal message list
*
* @param Phalcon\Validation\Message message
* @return Phalcon\Forms\ElementInterface
*/
public function appendMessage(message);
public function appendMessage(<\Phalcon\Validation\Message> message);

/**
* Clears every element in the form to its default value
Expand Down
2 changes: 1 addition & 1 deletion phalcon/http/responseinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface ResponseInterface
* @param DateTime datetime
* @return Phalcon\Http\ResponseInterface
*/
public function setExpires(datetime);
public function setExpires(<\DateTime> datetime);
/**
* Sends a Not-Modified response
*
Expand Down
2 changes: 1 addition & 1 deletion phalcon/mvc/collectioninterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ interface CollectionInterface
* @param array document
* @return Phalcon\Mvc\Collection
*/
public static function cloneResult(collection, document);
public static function cloneResult(<\Phalcon\Mvc\Collection> collection, document);

/**
* Fires an event, implicitly calls behaviors and listeners in the events manager are notified
Expand Down
4 changes: 2 additions & 2 deletions phalcon/mvc/model.zep
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,10 @@ abstract class Model implements ModelInterface, ResultInterface, InjectionAwareI
*));
*</code>
*
* @param Phalcon\Mvc\Model $base
* @param Phalcon\Mvc\ModelInterface $base
* @param array data
* @param int dirtyState
* @return Phalcon\Mvc\Model
* @return Phalcon\Mvc\ModelInterface
*/
public static function cloneResult(<ModelInterface> base, var data, int dirtyState=0)
{
Expand Down
2 changes: 1 addition & 1 deletion phalcon/mvc/model/behaviorinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ interface BehaviorInterface
* @param string method
* @param array arguments
*/
public function missingMethod(string !model, string !method, arguments=null);
public function missingMethod(<\Phalcon\Mvc\ModelInterface> model, string !method, arguments=null);

}
4 changes: 3 additions & 1 deletion phalcon/mvc/model/criteriainterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace Phalcon\Mvc\Model;

use Phalcon\DiInterface;

/**
* Phalcon\Mvc\Model\CriteriaInterface
*
Expand Down Expand Up @@ -225,7 +227,7 @@ interface CriteriaInterface
* @param array data
* @return static
*/
public static function fromInput(<\Phalcon\DiInterfac> dependencyInjector, string modelName, array! data);
public static function fromInput(<DiInterface> dependencyInjector, string modelName, array! data);

/**
* Executes a find using the parameters built with the criteria
Expand Down
8 changes: 4 additions & 4 deletions phalcon/mvc/model/manager.zep
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, \Phalcon\Eve
/**
* Sets the mapped source for a model
*
* @param Phalcon\Mvc\Model model
* @param Phalcon\Mvc\ModelInterface model
* @param string source
*/
public function setModelSource(<ModelInterface> model, string! source) -> void
Expand Down Expand Up @@ -1463,7 +1463,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, \Phalcon\Eve
* @param array parameters
* @return Phalcon\Mvc\Model\ResultsetInterface
*/
public function getBelongsToRecords(string! method, string! modelName, <ModelInterface> modelRelation, record, parameters = null)
public function getBelongsToRecords(string! method, string! modelName, modelRelation, <ModelInterface> record, parameters = null)
-> <ResultsetInterface> | boolean
{

Expand Down Expand Up @@ -1501,7 +1501,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, \Phalcon\Eve
* @param array parameters
* @return Phalcon\Mvc\Model\ResultsetInterface
*/
public function getHasManyRecords(string! method, string! modelName, <ModelInterface> modelRelation, record, parameters = null)
public function getHasManyRecords(string! method, string! modelName, modelRelation, <ModelInterface> record, parameters = null)
-> <ResultsetInterface> | boolean
{

Expand Down Expand Up @@ -1539,7 +1539,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, \Phalcon\Eve
* @param array parameters
* @return Phalcon\Mvc\ModelInterface
*/
public function getHasOneRecords(string! method, string! modelName, <ModelInterface> modelRelation, record, parameters = null)
public function getHasOneRecords(string! method, string! modelName, modelRelation, <ModelInterface> record, parameters = null)
-> <ModelInterface> | boolean
{
var hasOne, keyRelation, relations;
Expand Down
Loading