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

Minor fixes: typos, documentation, etc. #6493

Merged
merged 1 commit into from
Jun 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
use Doctrine\ORM\Cache\QueryCacheKey;
use Doctrine\DBAL\Cache\QueryCacheProfile;

use Doctrine\ORM\Cache;
use Doctrine\ORM\Query\ResultSetMapping;

/**
* Base contract for ORM queries. Base class for Query and NativeQuery.
*
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/ORM/Cache/DefaultCacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use Doctrine\ORM\Cache\Persister\Entity\NonStrictReadWriteCachedEntityPersister;
use Doctrine\ORM\Cache\Persister\Entity\ReadOnlyCachedEntityPersister;
use Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister;
use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\Cache\Region\DefaultMultiGetRegion;
use Doctrine\ORM\Cache\Region\DefaultRegion;
use Doctrine\ORM\Cache\Region\FileLockRegion;
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/ORM/Cache/Region/DefaultMultiGetRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace Doctrine\ORM\Cache\Region;

use Doctrine\Common\Cache\MultiGetCache;
use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\Cache\CollectionCacheEntry;

/**
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

namespace Doctrine\ORM;

use Doctrine\ORM\Mapping\MappingException;
use Exception;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Connection;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ protected function hydrateRowData(array $row, array &$result)

if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) {
// we only need to take action if this value is null,
// we refresh the entity or its an unitialized proxy.
// we refresh the entity or its an uninitialized proxy.
if (isset($nonemptyComponents[$dqlAlias])) {
$element = $this->getEntity($data, $dqlAlias);
$reflField->setValue($parentObject, $element);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ public function getSqlResultSetMappings()
*
* @param array $mapping The field mapping to validate & complete.
*
* @return array The validated and completed field mapping.
* @return void
*
* @throws MappingException
*/
Expand Down Expand Up @@ -2034,7 +2034,7 @@ public function getTypeOfField($fieldName)
*
* @return \Doctrine\DBAL\Types\Type|string|null
*
* @deprecated 3.0 remove this. this method is bogous and unreliable, since it cannot resolve the type of a column
* @deprecated 3.0 remove this. this method is bogus and unreliable, since it cannot resolve the type of a column
* that is derived by a referenced field on a different entity.
*/
public function getTypeOfColumn($columnName)
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private function buildFieldMapping($tableName, Column $column)
'fieldName' => $this->getFieldNameForColumn($tableName, $column->getName(), false),
'columnName' => $column->getName(),
'type' => $column->getType()->getName(),
'nullable' => ( ! $column->getNotNull()),
'nullable' => ( ! $column->getNotnull()),
];

// Type specific elements
Expand Down Expand Up @@ -482,7 +482,7 @@ private function buildToOneAssociationMappings(ClassMetadataInfo $metadata)
}

/**
* Retreive schema table definition foreign keys.
* Retrieve schema table definition foreign keys.
*
* @param \Doctrine\DBAL\Schema\Table $table
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
$inheritanceType = (string) $xmlRoot['inheritance-type'];
$metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType));

if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) {
// Evaluate <discriminator-column...>
if (isset($xmlRoot->{'discriminator-column'})) {
$discrColumn = $xmlRoot->{'discriminator-column'};
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
if (isset($element['inheritanceType'])) {
$metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType'])));

if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) {
// Evaluate discriminatorColumn
if (isset($element['discriminatorColumn'])) {
$discrColumn = $element['discriminatorColumn'];
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/Mapping/NamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ function propertyToColumnName($propertyName, $className = null);
/**
* Returns a column name for an embedded property.
*
* @param string $propertyName
* @param string $embeddedColumnName
* @param string $propertyName
* @param string $embeddedColumnName
* @param string $className
* @param string $embeddedClassName
*
* @return string
*/
Expand All @@ -70,12 +72,10 @@ function referenceColumnName();
* Returns a join column name for a property.
*
* @param string $propertyName A property name.
* @param string|null $className The fully-qualified class name.
* This parameter is omitted from the signature due to BC
*
* @return string A join column name.
*/
function joinColumnName($propertyName/*, $className = null*/);
function joinColumnName($propertyName);

/**
* Returns a join table name.
Expand Down
13 changes: 7 additions & 6 deletions lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,11 +1064,11 @@ public function getSelectSQL($criteria, $assoc = null, $lockMode = null, $limit

switch ($lockMode) {
case LockMode::PESSIMISTIC_READ:
$lockSql = ' ' . $this->platform->getReadLockSql();
$lockSql = ' ' . $this->platform->getReadLockSQL();
break;

case LockMode::PESSIMISTIC_WRITE:
$lockSql = ' ' . $this->platform->getWriteLockSql();
$lockSql = ' ' . $this->platform->getWriteLockSQL();
break;
}

Expand Down Expand Up @@ -1520,12 +1520,12 @@ public function lock(array $criteria, $lockMode)

switch ($lockMode) {
case LockMode::PESSIMISTIC_READ:
$lockSql = $this->platform->getReadLockSql();
$lockSql = $this->platform->getReadLockSQL();

break;
case LockMode::PESSIMISTIC_WRITE:

$lockSql = $this->platform->getWriteLockSql();
$lockSql = $this->platform->getWriteLockSQL();
break;
}

Expand Down Expand Up @@ -1870,8 +1870,9 @@ private function expandToManyParameters($criteria)
/**
* Infers field types to be used by parameter type casting.
*
* @param string $field
* @param mixed $value
* @param string $field
* @param mixed $value
* @param ClassMetadata $class
*
* @return array
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ public function getSelectSQL($criteria, $assoc = null, $lockMode = null, $limit
switch ($lockMode) {
case LockMode::PESSIMISTIC_READ:

$lockSql = ' ' . $this->platform->getReadLockSql();
$lockSql = ' ' . $this->platform->getReadLockSQL();

break;

case LockMode::PESSIMISTIC_WRITE:

$lockSql = ' ' . $this->platform->getWriteLockSql();
$lockSql = ' ' . $this->platform->getWriteLockSQL();

break;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/ORM/Persisters/PersisterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
class PersisterException extends ORMException
{
/**
* @param string $class
* @param string $associationName
*
* @return PersisterException
*/
static public function matchingAssocationFieldRequiresObject($class, $associationName)
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Persisters/SqlValueVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SqlValueVisitor extends ExpressionVisitor
*
* @param \Doctrine\Common\Collections\Expr\Comparison $comparison
*
* @return mixed
* @return void
*/
public function walkComparison(Comparison $comparison)
{
Expand All @@ -69,7 +69,7 @@ public function walkComparison(Comparison $comparison)
*
* @param \Doctrine\Common\Collections\Expr\CompositeExpression $expr
*
* @return mixed
* @return void
*/
public function walkCompositeExpression(CompositeExpression $expr)
{
Expand Down
5 changes: 2 additions & 3 deletions lib/Doctrine/ORM/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

namespace Doctrine\ORM;

use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\Query\Exec\AbstractSqlExecutor;
use Doctrine\ORM\Query\Parser;
Expand Down Expand Up @@ -204,7 +203,7 @@ final class Query extends AbstractQuery
*/
public function getSQL()
{
return $this->_parse()->getSQLExecutor()->getSQLStatements();
return $this->_parse()->getSqlExecutor()->getSqlStatements();
}

/**
Expand Down Expand Up @@ -738,7 +737,7 @@ protected function _getQueryCacheId()
->getName();

return md5(
$this->getDql() . serialize($this->_hints) .
$this->getDQL() . serialize($this->_hints) .
'&platform=' . $platform .
($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') .
'&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults .
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AbsFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -51,6 +52,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class BitAndFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -49,6 +50,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class BitOrFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -49,6 +50,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ConcatFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -58,6 +59,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CurrentDateFunction extends FunctionNode
{
/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -44,6 +45,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CurrentTimeFunction extends FunctionNode
{
/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -44,6 +45,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CurrentTimestampFunction extends FunctionNode
{
/**
* @override
* @inheritdoc
*/
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
Expand All @@ -44,6 +45,7 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class DateAddFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(SqlWalker $sqlWalker)
{
Expand Down Expand Up @@ -77,6 +78,7 @@ public function getSql(SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(Parser $parser)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DateDiffFunction extends FunctionNode

/**
* @override
* @inheritdoc
*/
public function getSql(SqlWalker $sqlWalker)
{
Expand All @@ -49,6 +50,7 @@ public function getSql(SqlWalker $sqlWalker)

/**
* @override
* @inheritdoc
*/
public function parse(Parser $parser)
{
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DateSubFunction extends DateAddFunction
{
/**
* @override
* @inheritdoc
*/
public function getSql(SqlWalker $sqlWalker)
{
Expand Down
Loading