Skip to content

Commit

Permalink
Add PHPDoc blocks to AbstractMigration
Browse files Browse the repository at this point in the history
  • Loading branch information
koninka committed Aug 31, 2020
1 parent 4eef7b0 commit b45758d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Doctrine/Migrations/AbstractMigration.php
Expand Up @@ -60,11 +60,22 @@ public function isTransactional() : bool
return true;
}

/**
* Description of this migration.
*
* @return string
*/
public function getDescription() : string
{
return '';
}

/**
* Warn with a message if some condition is met.
*
* @param bool $condition
* @param string $message
*/
public function warnIf(bool $condition, string $message = 'Unknown Reason') : void
{
if (! $condition) {
Expand Down Expand Up @@ -155,6 +166,11 @@ public function getSql() : array
return $this->plannedSql;
}

/**
* Write some debug information to the console.
*
* @param string $message
*/
protected function write(string $message) : void
{
$this->logger->notice($message, ['migration' => $this]);
Expand Down
8 changes: 8 additions & 0 deletions phpcs.xml.dist
Expand Up @@ -42,4 +42,12 @@
<exclude-pattern>lib/Doctrine/Migrations/Configuration/Loader/AbstractFileLoader.php</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
<exclude-pattern>lib/Doctrine/Migrations/AbstractMigration.php</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
<exclude-pattern>lib/Doctrine/Migrations/AbstractMigration.php</exclude-pattern>
</rule>

</ruleset>

0 comments on commit b45758d

Please sign in to comment.