Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed some phpdoc #180

Merged
merged 2 commits into from

4 participants

@stof

This fixes some phpdoc in the AbstractPlatform and in some child classes. I haven't checked all child classes to ensure that all phpdoc is right now, but the abstract one is now accurate (but a bunch of method are missing their phpdoc altogether)

@travisbot

This pull request passes (merged 2d995f33 into 4319165).

lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -204,6 +204,7 @@ private function initializeAllDoctrineTypeMappings()
* Gets the SQL snippet used to declare a VARCHAR column type.
*
* @param array $field
+ * @return string
@guilhermeblanco Owner

Missing line break before param and return

@stof
stof added a note

The other code in the platforms does not separate them. This is the only reason why I omitted the empty line

@guilhermeblanco Owner

DBAL code was not closely revised by me during its creation.
This is not an excuse to not implement the standardized code when implementing new one. I don't mean to sound harsh, but whenever you see some code that's not part of our standard, feel free to update and send a PR. We have tons of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -234,6 +235,12 @@ public function getGuidTypeDeclartionSQL(array $field)
return $this->getVarcharTypeDeclarationSQL($field);
}
+ /**
+ * @param int $length
@guilhermeblanco Owner

Missing documentation.
Missing line break between param and return
Missing line break between return and throws

@guilhermeblanco Owner

Prefer the non-abbreviated version of integer instead of int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -265,6 +272,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
*
* @param string $dbType
* @param string $doctrineType
+ * @throws \Doctrine\DBAL\DBALException if the type is not found
@guilhermeblanco Owner

Missing line break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -669,7 +677,7 @@ public function getLowerExpression($str)
* @param string $str literal string
* @param string $substr literal string to find
* @param integer $startPos position to start at, beginning of string by default
- * @return integer
+ * @return string
@guilhermeblanco Owner

Missing line break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -700,9 +708,9 @@ public function getNowExpression()
*/
public function getSubstringExpression($value, $from, $len = null)
{
- if ($len === null)
@guilhermeblanco Owner

Turn this method into a ternary return.

return ($len === null)
    ? sprintf('SUBSTRING(%s FROM %s)', $value, $from)
    : sprintf('SUBSTRING(%s FROM %s FOR %s)', $value, $from, $len);

Unfortunately, we cannot break BC and turn $len into $length variable.

@stof
stof added a note

this is not a BC break. PHP does not support named arguments so we can renamed them :)

@guilhermeblanco Owner

Then feel free to modify it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@travisbot

This pull request passes (merged da06cdb into 807e229).

@asm89 asm89 merged commit 8f783fb into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 7, 2012
  1. @stof

    Fixed some phpdoc

    stof authored
  2. @stof
Something went wrong with that request. Please try again.