Skip to content

Loading…

Strict standards fix #121

Merged
merged 6 commits into from

3 participants

@hhamon
Propel member

Hello,

I tried to integrate Propel2 with Sonar Source to get some metrics and see how quality evolves over the development. The problem is that Sonar executes the following command:

$ phpunit --log-junit=/path/to/Propel2/target/logs/phpunit.xml --coverage-clover=/path/to/Propel2/target/logs/phpunit.coverage.xml

Although the tests suite passes, the code coverage generation failed because of lots of strict standard errors and missing use statements in several classes... I'm suspecting the Propel2 code is not so well coveredd ^^

As of now this command runs to the end without any errors :)

@willdurand willdurand commented on an outdated diff
src/Propel/Generator/Builder/Util/ColumnValue.php
((3 lines not shown))
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+class ColumnValue {
+
+ private $col;
+ private $val;
+
+ public function __construct(Column $col, $val)
@willdurand Propel member

You missed the use statement for Column

@hhamon Propel member
hhamon added a note

Oh yes! I'm updating the PR ;)

@hhamon Propel member
hhamon added a note

Both classes are in the same namespace in fact so no need for the use statement ;)

@hhamon Propel member
hhamon added a note

Oops you're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@willdurand willdurand commented on an outdated diff
src/Propel/Generator/Builder/Util/ColumnValue.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+class ColumnValue {
@willdurand Propel member

The curly bracket should be on its own line

@hhamon Propel member
hhamon added a note

Ok fix thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@willdurand willdurand commented on an outdated diff
src/Propel/Generator/Builder/Util/ColumnValue.php
((1 lines not shown))
+<?php
+
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+class ColumnValue {
+
+ private $col;
+ private $val;
@willdurand Propel member

Add a blank line between attributes declarations.

@hhamon Propel member
hhamon added a note

Fixed thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@willdurand willdurand commented on the diff
src/Propel/Generator/Builder/Util/DataRow.php
((3 lines not shown))
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+class DataRow
+{
+ private $table;
+ private $columnValues;
+
+ public function __construct(Table $table, $columnValues)
@willdurand Propel member

You missed the Table use

@willdurand Propel member

use still missing here

@hhamon Propel member
hhamon added a note

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stloyd stloyd commented on the diff
src/Propel/Generator/Reverse/MysqlSchemaParser.php
@@ -10,18 +10,17 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
+use PDO;
@stloyd
stloyd added a note

Personally I don't like such use. But only personally ;-)

@willdurand Propel member

Personally, I like to use an absolute NS for core classes :)

@hhamon Propel member
hhamon added a note

Personnaly I prefer using the following syntax for core classes:

class MyPdo extends \PDO
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@willdurand willdurand merged commit 05098ba into propelorm:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 229 additions and 261 deletions.
  1. +2 −0 src/Propel/Generator/Builder/Sql/DataSQLBuilder.php
  2. +3 −2 src/Propel/Generator/Builder/Sql/Pgsql/PgsqlDataSQLBuilder.php
  3. +37 −0 src/Propel/Generator/Builder/Util/ColumnValue.php
  4. +35 −0 src/Propel/Generator/Builder/Util/DataRow.php
  5. +23 −11 src/Propel/Generator/Builder/Util/PropelStringReader.php
  6. +2 −52 src/Propel/Generator/Builder/Util/XmlToDataSQL.php
  7. +12 −4 src/Propel/Generator/Model/Column.php
  8. +2 −3 src/Propel/Generator/Model/Table.php
  9. +2 −2 src/Propel/Generator/Platform/DefaultPlatform.php
  10. +7 −2 src/Propel/Generator/Reverse/MssqlSchemaParser.php
  11. +5 −6 src/Propel/Generator/Reverse/MysqlSchemaParser.php
  12. +8 −4 src/Propel/Generator/Reverse/OracleSchemaParser.php
  13. +8 −2 src/Propel/Generator/Reverse/PgsqlSchemaParser.php
  14. +4 −4 src/Propel/Generator/Reverse/SchemaParserInterface.php
  15. +8 −2 src/Propel/Generator/Reverse/SqliteSchemaParser.php
  16. +2 −2 src/Propel/Runtime/Adapter/AdapterInterface.php
  17. +5 −1 src/Propel/Runtime/Adapter/MSSQL/MssqlPropelPDO.php
  18. +0 −112 src/Propel/Runtime/Adapter/NoneAdapter.php
  19. +7 −5 src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php
  20. +6 −6 src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
  21. +3 −3 src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php
  22. +3 −3 src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
  23. +5 −5 src/Propel/Runtime/Adapter/Pdo/PgsqlAdapter.php
  24. +2 −2 src/Propel/Runtime/Adapter/Pdo/SqliteAdapter.php
  25. +10 −8 src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php
  26. +3 −2 src/Propel/Runtime/Map/ColumnMap.php
  27. +2 −2 src/Propel/Runtime/Map/DatabaseMap.php
  28. +1 −1 src/Propel/Runtime/Om/NestedSetRecursiveIterator.php
  29. +1 −2 src/Propel/Runtime/Om/NodeObject.php
  30. +2 −0 src/Propel/Runtime/Om/PreOrderNodeIterator.php
  31. +2 −1 src/Propel/Runtime/Query/Criteria.php
  32. +15 −9 src/Propel/Runtime/Query/CriterionIterator.php
  33. +2 −3 src/Propel/Runtime/Query/ModelCriteria.php
View
2 src/Propel/Generator/Builder/Sql/DataSQLBuilder.php
@@ -11,6 +11,8 @@
namespace Propel\Generator\Builder\Sql;
use Propel\Generator\Builder\DataModelBuilder;
+use Propel\Generator\Builder\Util\ColumnValue;
+use Propel\Generator\Builder\Util\DataRow;
use Propel\Generator\Model\PropelTypes;
/**
View
5 src/Propel/Generator/Builder/Sql/Pgsql/PgsqlDataSQLBuilder.php
@@ -11,6 +11,8 @@
namespace Propel\Generator\Builder\Sql\Pgsql;
use Propel\Generator\Builder\Sql\DataSQLBuilder;
+use Propel\Generator\Builder\Util\ColumnValue;
+use Propel\Generator\Builder\Util\DataRow;
/**
* PostgreSQL class for building data dump SQL.
@@ -102,5 +104,4 @@ protected function getBlobSql($blob)
return "'" . pg_escape_bytea($blob) . "'";
}
-
-}
+}
View
37 src/Propel/Generator/Builder/Util/ColumnValue.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+use Propel\Generator\Model\Column;
+
+class ColumnValue
+{
+
+ private $col;
+
+ private $val;
+
+ public function __construct(Column $col, $val)
+ {
+ $this->col = $col;
+ $this->val = $val;
+ }
+
+ public function getColumn()
+ {
+ return $this->col;
+ }
+
+ public function getValue()
+ {
+ return $this->val;
+ }
+}
View
35 src/Propel/Generator/Builder/Util/DataRow.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Generator\Builder\Util;
+
+use Propel\Generator\Model\Table;
+
+class DataRow
+{
+ private $table;
+ private $columnValues;
+
+ public function __construct(Table $table, $columnValues)
@willdurand Propel member

You missed the Table use

@willdurand Propel member

use still missing here

@hhamon Propel member
hhamon added a note

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ {
+ $this->table = $table;
+ $this->columnValues = $columnValues;
+ }
+
+ public function getTable()
+ {
+ return $this->table;
+ }
+
+ public function getColumnValues()
+ {
+ return $this->columnValues;
+ }
+}
View
34 src/Propel/Generator/Builder/Util/PropelStringReader.php
@@ -10,7 +10,9 @@
namespace Propel\Generator\Builder\Util;
+// @TODO remove
include_once 'phing/system/io/Reader.php';
+use Reader;
/**
* Overrides Phing's StringReader to allow inclusin inside a BufferedReader
@@ -53,15 +55,16 @@ public function read($len = null)
{
if ($len === null) {
return $this->_string;
- } else {
- if ($this->currPos >= strlen($this->_string)) {
- return -1;
- }
- $out = substr($this->_string, $this->currPos, $len);
- $this->currPos += $len;
-
- return $out;
}
+
+ if ($this->currPos >= strlen($this->_string)) {
+ return -1;
+ }
+
+ $out = substr($this->_string, $this->currPos, $len);
+ $this->currPos += $len;
+
+ return $out;
}
public function mark()
@@ -74,11 +77,20 @@ public function reset()
$this->currPos = $this->mark;
}
- public function close() {}
+ public function close()
+ {
+
+ }
- public function open() {}
+ public function open()
+ {
+
+ }
- public function ready() {}
+ public function ready()
+ {
+
+ }
public function markSupported()
{
View
54 src/Propel/Generator/Builder/Util/XmlToDataSQL.php
@@ -17,7 +17,7 @@
*
* @author Hans Lellelid <hans@xmpl.org> (Propel)
*/
-class XmlToDataSQL extends AbstractHandler
+class XmlToDataSQL extends \AbstractHandler
{
/**
@@ -210,54 +210,4 @@ public function endElement($name)
}
}
-} // XmlToData
-
-/**
- * "inner class"
- */
-class DataRow
-{
- private $table;
- private $columnValues;
-
- public function __construct(Table $table, $columnValues)
- {
- $this->table = $table;
- $this->columnValues = $columnValues;
- }
-
- public function getTable()
- {
- return $this->table;
- }
-
- public function getColumnValues()
- {
- return $this->columnValues;
- }
-}
-
-/**
- * "inner" class
- */
-class ColumnValue {
-
- private $col;
- private $val;
-
- public function __construct(Column $col, $val)
- {
- $this->col = $col;
- $this->val = $val;
- }
-
- public function getColumn()
- {
- return $this->col;
- }
-
- public function getValue()
- {
- return $this->val;
- }
-}
+}
View
16 src/Propel/Generator/Model/Column.php
@@ -10,12 +10,11 @@
namespace Propel\Generator\Model;
+use DOMNode;
+use DOMDocument;
use Propel\Generator\Exception\EngineException;
use Propel\Generator\Platform\PlatformInterface;
-use \DOMNode;
-use \DOMDocument;
-
/**
* A Class for holding data about a column used in an Application.
*
@@ -29,19 +28,28 @@
*/
class Column extends XmlElement
{
-
const DEFAULT_TYPE = "VARCHAR";
+
const DEFAULT_VISIBILITY = 'public';
+
static public $validVisibilities = array('public', 'protected', 'private');
private $name;
+
private $description;
+
private $phpName = null;
+
private $phpNamingMethod;
+
private $isNotNull = false;
+
private $size;
+
private $namePrefix;
+
private $accessorVisibility;
+
private $mutatorVisibility;
/**
View
5 src/Propel/Generator/Model/Table.php
@@ -10,12 +10,11 @@
namespace Propel\Generator\Model;
+use DOMNode;
+use DOMDocument;
use Propel\Generator\Exception\EngineException;
use Propel\Generator\Platform\MysqlPlatform;
-use \DOMNode;
-use \DOMDocument;
-
/**
* Data about a table used in an application.
*
View
4 src/Propel/Generator/Platform/DefaultPlatform.php
@@ -1172,7 +1172,7 @@ public function getDateFormatter()
/**
* Get the PHP snippet for binding a value to a column.
- * Warning: duplicates logic from AbstractAdapter::bindValue().
+ * Warning: duplicates logic from AdapterInterface::bindValue().
* Any code modification here must be ported there.
*/
public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = " ")
@@ -1202,7 +1202,7 @@ public function getColumnBindingPHP($column, $identifier, $columnValueAccessor,
/**
* Get the PHP snippet for getting a Pk from the database.
- * Warning: duplicates logic from AbstractAdapter::getId().
+ * Warning: duplicates logic from AdapterInterface::getId().
* Any code modification here must be ported there.
*
* Typical output:
View
9 src/Propel/Generator/Reverse/MssqlSchemaParser.php
@@ -10,10 +10,15 @@
namespace Propel\Generator\Reverse;
-use Propel\Generator\Model\PropelTypes;
-use Propel\Generator\Reverse\AbstractSchemaParser;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
use PDO;
+use Propel\Generator\Model\Table;
+use Propel\Generator\Model\Database;
+use Propel\Generator\Model\PropelTypes;
+use Propel\Generator\Reverse\AbstractSchemaParser;
/**
* Microsoft SQL Server database schema parser.
View
11 src/Propel/Generator/Reverse/MysqlSchemaParser.php
@@ -10,18 +10,17 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
+use PDO;
@stloyd
stloyd added a note

Personally I don't like such use. But only personally ;-)

@willdurand Propel member

Personally, I like to use an absolute NS for core classes :)

@hhamon Propel member
hhamon added a note

Personnaly I prefer using the following syntax for core classes:

class MyPdo extends \PDO
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
use Propel\Generator\Model\Column;
use Propel\Generator\Model\Database;
use Propel\Generator\Model\Table;
use Propel\Generator\Model\PropelTypes;
use Propel\Generator\Model\ColumnDefaultValue;
-use \PDO;
-
-// TODO: to remove
-require_once 'phing/Task.php';
-use \Task;
-
/**
* Mysql database schema parser.
*
View
12 src/Propel/Generator/Reverse/OracleSchemaParser.php
@@ -10,11 +10,16 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
+use PDO;
+use Propel\Generator\Model\Column;
+use Propel\Generator\Model\Database;
use Propel\Generator\Model\PropelTypes;
use Propel\Generator\Reverse\AbstractSchemaParser;
-use \PDO;
-
/**
* Oracle database schema parser.
*
@@ -285,5 +290,4 @@ protected function addPrimaryKey(Table $table)
}
}
-}
-
+}
View
10 src/Propel/Generator/Reverse/PgsqlSchemaParser.php
@@ -10,11 +10,17 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
+use PDO;
+use Propel\Generator\Model\Column;
+use Propel\Generator\Model\Database;
+use Propel\Generator\Model\Table;
use Propel\Generator\Model\PropelTypes;
use Propel\Generator\Reverse\AbstractSchemaParser;
-use \PDO;
-
/**
* Postgresql database schema parser.
*
View
8 src/Propel/Generator/Reverse/SchemaParserInterface.php
@@ -10,14 +10,14 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
use Propel\Generator\Config\GeneratorConfigInterface;
use Propel\Generator\Model\Database;
use Propel\Runtime\Connection\ConnectionInterface;
-// TODO: to remove
-require_once 'phing/Task.php';
-use \Task;
-
/**
* Interface for reverse engineering schema parsers.
*
View
10 src/Propel/Generator/Reverse/SqliteSchemaParser.php
@@ -10,11 +10,17 @@
namespace Propel\Generator\Reverse;
+// TODO: to remove
+require_once 'phing/Task.php';
+use Task;
+
+use PDO;
+use Propel\Generator\Model\Column;
+use Propel\Generator\Model\Database;
+use Propel\Generator\Model\Table;
use Propel\Generator\Model\PropelTypes;
use Propel\Generator\Reverse\AbstractSchemaParser;
-use \PDO;
-
/**
* SQLite database schema parser.
*
View
4 src/Propel/Runtime/Adapter/AdapterInterface.php
@@ -239,7 +239,7 @@ function getDeleteFromClause(Criteria $criteria, $tableName);
/**
* Builds the SELECT part of a SQL statement based on a Criteria
* taking into account select columns and 'as' columns (i.e. columns aliases)
- * Move from BasePeer to AbstractAdapter and turn from static to non static
+ * Move from BasePeer to AdapterInterface and turn from static to non static
*
* @param Propel\Runtime\Map\Criteria $criteria
* @param array $fromClause
@@ -252,7 +252,7 @@ function createSelectSqlPart(Criteria $criteria, &$fromClause, $aliasAll = false
/**
* Ensures uniqueness of select column names by turning them all into aliases
* This is necessary for queries on more than one table when the tables share a column name
- * Moved from BasePeer to AbstractAdapter and turned from static to non static
+ * Moved from BasePeer to AdapterInterface and turned from static to non static
*
* @see http://propel.phpdb.org/trac/ticket/795
*
View
6 src/Propel/Runtime/Adapter/MSSQL/MssqlPropelPDO.php
@@ -10,8 +10,12 @@
namespace Propel\Runtime\Adapter\MSSQL;
+use Propel\Runtime\Connection\PropelPDO;
+use Propel\Runtime\Exception\PropelException;
+
/**
- * dblib doesn't support transactions so we need to add a workaround for transactions, last insert ID, and quoting
+ * dblib doesn't support transactions so we need to add a workaround for
+ * transactions, last insert ID, and quoting
*
*/
class MssqlPropelPDO extends PropelPDO
View
112 src/Propel/Runtime/Adapter/NoneAdapter.php
@@ -1,112 +0,0 @@
-<?php
-
-/**
- * This file is part of the Propel package.
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- *
- * @license MIT License
- */
-
-namespace Propel\Runtime\Adapter;
-
-/**
- * This adapter is used when you do not have a database installed.
- *
- * @author Hans Lellelid <hans@xmpl.org> (Propel)
- * @author Jon S. Stevens <jon@clearink.com> (Torque)
- * @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
- */
-class NoneAdapter extends AbstractAdapter
-{
-
- /**
- * @see AbstractAdapter::initConnection()
- *
- * @param ConnectionInterface $con
- * @param array $settings
- */
- public function initConnection($con, array $settings)
- {
- }
-
- /**
- * This method is used to ignore case.
- *
- * @param string $in The string to transform to upper case.
- * @return string The upper case string.
- */
- public function toUpperCase($in)
- {
- return $in;
- }
-
- /**
- * This method is used to ignore case.
- *
- * @param string $in The string whose case to ignore.
- * @return string The string in a case that can be ignored.
- */
- public function ignoreCase($in)
- {
- return $in;
- }
-
- /**
- * Returns SQL which concatenates the second string to the first.
- *
- * @param string $s1 String to concatenate.
- * @param string $s2 String to append.
- *
- * @return string
- */
- public function concatString($s1, $s2)
- {
- return ($s1 . $s2);
- }
-
- /**
- * Returns SQL which extracts a substring.
- *
- * @param string $s String to extract from.
- * @param integer $pos Offset to start from.
- * @param integer $len Number of characters to extract.
- *
- * @return string
- */
- public function subString($s, $pos, $len)
- {
- return substr($s, $pos, $len);
- }
-
- /**
- * Returns SQL which calculates the length (in chars) of a string.
- *
- * @param string $s String to calculate length of.
- * @return string
- */
- public function strLength($s)
- {
- return strlen($s);
- }
-
- /**
- * Modifies the passed-in SQL to add LIMIT and/or OFFSET.
- *
- * @param string $sql
- * @param integer $offset
- * @param integer $limit
- */
- public function applyLimit(&$sql, $offset, $limit)
- {
- }
-
- /**
- * Gets the SQL string that this adapter uses for getting a random number.
- *
- * @param string $seed (optional) seed value for databases that support this
- */
- public function random($seed = null)
- {
- }
-}
View
12 src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php
@@ -15,6 +15,8 @@
use Propel\Runtime\Adapter\Exception\ColumnNotFoundException;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\InvalidArgumentException;
+use Propel\Runtime\Map\DatabaseMap;
+use Propel\Runtime\Query\Criteria;
/**
* This is used to connect to a MSSQL database.
@@ -26,7 +28,7 @@ class MssqlAdapter extends PdoAdapter implements AdapterInterface
/**
* MS SQL Server does not support SET NAMES
*
- * @see AbstractAdapter::setCharset()
+ * @see AdapterInterface::setCharset()
*
* @param ConnectionInterface $con
* @param string $charset
@@ -74,7 +76,7 @@ public function strLength($s)
}
/**
- * @see AbstractAdapter::quoteIdentifier()
+ * @see AdapterInterface::quoteIdentifier()
*
* @param string $text
* @return string
@@ -85,7 +87,7 @@ public function quoteIdentifier($text)
}
/**
- * @see AbstractAdapter::quoteIdentifierTable()
+ * @see AdapterInterface::quoteIdentifierTable()
*
* @param string $table
* @return string
@@ -97,7 +99,7 @@ public function quoteIdentifierTable($table)
}
/**
- * @see AbstractAdapter::random()
+ * @see AdapterInterface::random()
*
* @param string $seed
* @return string
@@ -113,7 +115,7 @@ public function random($seed = null)
* This rewrites the $sql query to apply the offset and limit.
* some of the ORDER BY logic borrowed from Doctrine MsSqlPlatform
*
- * @see AbstractAdapter::applyLimit()
+ * @see AdapterInterface::applyLimit()
* @author Benjamin Runnels <kraven@kraven.org>
*
* @param string $sql
View
12 src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
@@ -95,7 +95,7 @@ public function unlockTable($con, $table)
}
/**
- * @see AbstractAdapter::quoteIdentifier()
+ * @see AdapterInterface::quoteIdentifier()
*
* @param string $text
* @return string
@@ -106,7 +106,7 @@ public function quoteIdentifier($text)
}
/**
- * @see AbstractAdapter::quoteIdentifierTable()
+ * @see AdapterInterface::quoteIdentifierTable()
*
* @param string $table
* @return string
@@ -118,7 +118,7 @@ public function quoteIdentifierTable($table)
}
/**
- * @see AbstractAdapter::useQuoteIdentifier()
+ * @see AdapterInterface::useQuoteIdentifier()
*
* @return boolean
*/
@@ -128,7 +128,7 @@ public function useQuoteIdentifier()
}
/**
- * @see AbstractAdapter::applyLimit()
+ * @see AdapterInterface::applyLimit()
*
* @param string $sql
* @param integer $offset
@@ -144,7 +144,7 @@ public function applyLimit(&$sql, $offset, $limit)
}
/**
- * @see AbstractAdapter::random()
+ * @see AdapterInterface::random()
*
* @param string $seed
* @return string
@@ -155,7 +155,7 @@ public function random($seed = null)
}
/**
- * @see AbstractAdapter::bindValue()
+ * @see AdapterInterface::bindValue()
*
* @param StatementInterface $stmt
* @param string $parameter
View
6 src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php
@@ -94,7 +94,7 @@ public function strLength($s)
}
/**
- * @see AbstractAdapter::applyLimit()
+ * @see AdapterInterface::applyLimit()
*
* @param string $sql
* @param integer $offset
@@ -128,7 +128,7 @@ public function applyLimit(&$sql, $offset, $limit, $criteria = null)
*/
protected function getIdMethod()
{
- return AbstractAdapter::ID_METHOD_SEQUENCE;
+ return AdapterInterface::ID_METHOD_SEQUENCE;
}
/**
@@ -199,7 +199,7 @@ public function turnSelectColumnsToAliases(Criteria $criteria)
}
/**
- * @see AbstractAdapter::bindValue()
+ * @see AdapterInterface::bindValue()
*
* @param StatementInterface $stmt
* @param string $parameter
View
6 src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
@@ -10,9 +10,12 @@
namespace Propel\Runtime\Adapter\Pdo;
+use PDO;
+use PDOException;
use Propel\Runtime\Adapter\AdapterInterface;
use Propel\Runtime\Adapter\Exception\AdapterException;
use Propel\Runtime\Connection\ConnectionInterface;
+use Propel\Runtime\Adapter\Pdo\PdoConnection;
use Propel\Runtime\Connection\StatementInterface;
use Propel\Runtime\Exception\InvalidArgumentException;
use Propel\Runtime\Map\ColumnMap;
@@ -21,9 +24,6 @@
use Propel\Runtime\Util\PropelDateTime;
use Propel\Runtime\Util\PropelColumnTypes;
-use \PDO;
-use \PDOException;
-
/**
* Base for PDO database adapters.
*/
View
10 src/Propel/Runtime/Adapter/Pdo/PgsqlAdapter.php
@@ -67,13 +67,13 @@ public function strLength($s)
}
/**
- * @see AbstractAdapter::getIdMethod()
+ * @see AdapterInterface::getIdMethod()
*
* @return integer
*/
protected function getIdMethod()
{
- return AbstractAdapter::ID_METHOD_SEQUENCE;
+ return AdapterInterface::ID_METHOD_SEQUENCE;
}
/**
@@ -115,7 +115,7 @@ public function getTimeFormatter()
}
/**
- * @see AbstractAdapter::applyLimit()
+ * @see AdapterInterface::applyLimit()
*
* @param string $sql
* @param integer $offset
@@ -132,7 +132,7 @@ public function applyLimit(&$sql, $offset, $limit)
}
/**
- * @see AbstractAdapter::random()
+ * @see AdapterInterface::random()
*
* @param string $seed
* @return string
@@ -172,7 +172,7 @@ public function getDeleteFromClause(Criteria $criteria, $tableName)
}
/**
- * @see AbstractAdapter::quoteIdentifierTable()
+ * @see AdapterInterface::quoteIdentifierTable()
*
* @param string $table
* @return string
View
4 src/Propel/Runtime/Adapter/Pdo/SqliteAdapter.php
@@ -75,7 +75,7 @@ public function strLength($s)
}
/**
- * @see AbstractAdapter::quoteIdentifier()
+ * @see AdapterInterface::quoteIdentifier()
*
* @param string $text
* @return string
@@ -86,7 +86,7 @@ public function quoteIdentifier($text)
}
/**
- * @see AbstractAdapter::applyLimit()
+ * @see AdapterInterface::applyLimit()
*
* @param string $sql
* @param integer $offset
View
18 src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php
@@ -10,12 +10,14 @@
namespace Propel\Runtime\Adapter\Pdo;
+use PDO;
use Propel\Runtime\Adapter\AdapterInterface;
+use Propel\Runtime\Adapter\Exception\UnsupportedEncodingException;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Connection\StatementInterface;
-use Propel\Runtime\Adapter\Exception\UnsupportedEncodingException;
-
-use \PDO;
+use Propel\Runtime\Query\Criteria;
+use Propel\Runtime\Map\ColumnMap;
+use Propel\Runtime\Map\DatabaseMap;
/**
* This is used to connect to a MSSQL database using pdo_sqlsrv driver.
@@ -27,10 +29,10 @@ class SqlsrvAdapter extends MssqlAdapter implements AdapterInterface
/**
* @see parent::initConnection()
*
- * @param PDO $con
- * @param array $settings
+ * @param Propel\Runtime\Connection\ConnectionInterface $con
+ * @param array $settings An array of settings.
*/
- public function initConnection($con, array $settings)
+ public function initConnection(ConnectionInterface $con, array $settings)
{
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$con->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
@@ -89,7 +91,7 @@ public function cleanupSQL(&$sql, array &$params, Criteria $values, DatabaseMap
}
/**
- * @see AbstractAdapter::bindValue()
+ * @see AdapterInterface::bindValue()
*
* @param PDOStatement $stmt
* @param string $parameter
@@ -111,7 +113,7 @@ public function bindValue(StatementInterface $stmt, $parameter, $value, ColumnMa
// driver option can be utilized. This requires a unique blob parameter because the bindParam
// value is passed by reference and if we didn't do this then the referenced parameter value
// would change on the next loop
- $blob = "blob".$position;
+ $blob = 'blob'.$position;
$$blob = $value;
return $stmt->bindParam($parameter, ${$blob}, PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY);
View
5 src/Propel/Runtime/Map/ColumnMap.php
@@ -10,6 +10,7 @@
namespace Propel\Runtime\Map;
+use Propel\Runtime\Adapter\AdapterInterface;
use Propel\Runtime\Map\Exception\ForeignKeyNotFoundException;
use Propel\Runtime\Util\PropelColumnTypes;
@@ -475,9 +476,9 @@ public function getValueSetKey($value)
* Performs DB-specific ignore case, but only if the column type necessitates it.
*
* @param string $str The expression we want to apply the ignore case formatting to (e.g. the column name).
- * @param \Propel\Runtime\Adapter\AbstractAdapter $db
+ * @param \Propel\Runtime\Adapter\AdapterInterface $db
*/
- public function ignoreCase($str, AbstractAdapter $db)
+ public function ignoreCase($str, AdapterInterface $db)
{
if ($this->isText()) {
return $db->ignoreCase($str);
View
4 src/Propel/Runtime/Map/DatabaseMap.php
@@ -190,10 +190,10 @@ public function getTableByPhpName($phpName)
}
/**
- * Convenience method to get the AbstractAdapter registered with Propel for this database.
+ * Convenience method to get the AdapterInterface registered with Propel for this database.
* @see Propel::getServiceContainer()->getAdapter(string).
*
- * @return \Propel\Runtime\Adapter\AbstractAdapter
+ * @return \Propel\Runtime\Adapter\AdapterInterface
*/
public function getAbstractAdapter()
{
View
2 src/Propel/Runtime/Om/NestedSetRecursiveIterator.php
@@ -10,7 +10,7 @@
namespace Propel\Runtime\Om;
-use \RecursiveIterator;
+use RecursiveIterator;
/**
* Pre-order node iterator for Node objects.
View
3 src/Propel/Runtime/Om/NodeObject.php
@@ -10,10 +10,9 @@
namespace Propel\Runtime\Om;
+use IteratorAggregate;
use Propel\Runtime\Connection\ConnectionInterface;
-use \IteratorAggregate;
-
/**
* This interface defines methods that must be implemented by all
* business objects within the system to handle Node object.
View
2 src/Propel/Runtime/Om/PreOrderNodeIterator.php
@@ -10,6 +10,8 @@
namespace Propel\Runtime\Om;
+use Iterator;
+
/**
* Pre-order node iterator for Node objects.
*
View
3 src/Propel/Runtime/Query/Criteria.php
@@ -10,6 +10,7 @@
namespace Propel\Runtime\Query;
+use IteratorAggregate;
use Propel\Runtime\Propel;
use Propel\Runtime\Exception\LogicException;
use Propel\Runtime\Util\BasePeer;
@@ -29,7 +30,7 @@
* @author Henning P. Schmiedehausen <hps@intermeta.de> (Torque)
* @author Sam Joseph <sam@neurogrid.com> (Torque)
*/
-class Criteria implements \IteratorAggregate
+class Criteria implements IteratorAggregate
{
/** Comparison type. */
View
24 src/Propel/Runtime/Query/CriterionIterator.php
@@ -10,6 +10,8 @@
namespace Propel\Runtime\Query;
+use Iterator;
+
/**
* Class that implements SPL Iterator interface. This allows foreach () to
* be used w/ Criteria objects. Probably there is no performance advantage
@@ -19,36 +21,40 @@
*/
class CriterionIterator implements Iterator
{
-
private $idx = 0;
private $criteria;
private $criteriaKeys;
private $criteriaSize;
- public function __construct(Criteria $criteria) {
+ public function __construct(Criteria $criteria)
+ {
$this->criteria = $criteria;
$this->criteriaKeys = $criteria->keys();
$this->criteriaSize = count($this->criteriaKeys);
}
- public function rewind() {
+ public function rewind()
+ {
$this->idx = 0;
}
- public function valid() {
+ public function valid()
+ {
return $this->idx < $this->criteriaSize;
}
- public function key() {
+ public function key()
+ {
return $this->criteriaKeys[$this->idx];
}
- public function current() {
+ public function current()
+ {
return $this->criteria->getCriterion($this->criteriaKeys[$this->idx]);
}
- public function next() {
+ public function next()
+ {
$this->idx++;
}
-
-}
+}
View
5 src/Propel/Runtime/Query/ModelCriteria.php
@@ -10,6 +10,8 @@
namespace Propel\Runtime\Query;
+use PDO;
+use PDOStatement;
use Propel\Runtime\Propel;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\ClassNotFoundException;
@@ -28,9 +30,6 @@
use Propel\Runtime\Query\Exception\UnknownModelException;
use Propel\Runtime\Query\Exception\UnknownRelationException;
-use \PDO;
-use \PDOStatement;
-
/**
* This class extends the Criteria by adding runtime introspection abilities
* in order to ease the building of queries.
Something went wrong with that request. Please try again.