Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
  • Loading branch information
MasterOdin committed Jun 19, 2021
1 parent f8d4391 commit f385bbb
Show file tree
Hide file tree
Showing 27 changed files with 89 additions and 93 deletions.
7 changes: 3 additions & 4 deletions src/Phinx/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class AbstractCommand extends Command
protected const DEFAULT_SEED_TEMPLATE = '/../../Seed/Seed.template.php.dist';

/**
* @var \Phinx\Config\ConfigInterface
* @var \Phinx\Config\ConfigInterface|null
*/
protected $config;

Expand Down Expand Up @@ -107,7 +107,6 @@ protected function configure(): void
*/
public function bootstrap(InputInterface $input, OutputInterface $output): void
{
/** @var \Phinx\Config\ConfigInterface|null $config */
$config = $this->getConfig();
if (!$config) {
$this->loadConfig($input, $output);
Expand Down Expand Up @@ -159,9 +158,9 @@ public function setConfig(ConfigInterface $config)
/**
* Gets the config.
*
* @return \Phinx\Config\ConfigInterface
* @return \Phinx\Config\ConfigInterface|null
*/
public function getConfig(): ConfigInterface
public function getConfig(): ?ConfigInterface
{
return $this->config;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Phinx/Db/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ abstract class AbstractAdapter implements AdapterInterface
protected $options = [];

/**
* @var \Symfony\Component\Console\Input\InputInterface
* @var \Symfony\Component\Console\Input\InputInterface|null
*/
protected $input;
protected $input = null;

/**
* @var \Symfony\Component\Console\Output\OutputInterface
Expand Down Expand Up @@ -135,7 +135,7 @@ public function setInput(InputInterface $input): AdapterInterface
/**
* @inheritDoc
*/
public function getInput(): InputInterface
public function getInput(): ?InputInterface
{
return $this->input;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Phinx/Db/Adapter/AdapterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public static function instance(): AdapterFactory
* Add or replace an adapter with a fully qualified class name.
*
* @param string $name Name
* @param string $class Class
* @param object $class Class
* @throws \RuntimeException
* @return $this
*/
public function registerAdapter(string $name, string $class)
public function registerAdapter(string $name, $class)
{
if (!is_subclass_of($class, 'Phinx\Db\Adapter\AdapterInterface')) {
throw new RuntimeException(sprintf(
Expand All @@ -86,9 +86,9 @@ public function registerAdapter(string $name, string $class)
*
* @param string $name Name
* @throws \RuntimeException
* @return string
* @return object
*/
protected function getClass(string $name): string
protected function getClass(string $name)
{
if (empty($this->adapters[$name])) {
throw new RuntimeException(sprintf(
Expand Down
4 changes: 2 additions & 2 deletions src/Phinx/Db/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public function setInput(InputInterface $input): AdapterInterface;
/**
* Gets the console input.
*
* @return \Symfony\Component\Console\Input\InputInterface
* @return \Symfony\Component\Console\Input\InputInterface|null
*/
public function getInput(): InputInterface;
public function getInput(): ?InputInterface;

/**
* Sets the console output.
Expand Down
8 changes: 2 additions & 6 deletions src/Phinx/Db/Adapter/PdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,12 @@ public function getConnection(): PDO
/**
* @inheritDoc
*/
public function connect(): void
{
}
abstract public function connect(): void;

/**
* @inheritDoc
*/
public function disconnect(): void
{
}
abstract public function disconnect(): void;

/**
* @inheritDoc
Expand Down
4 changes: 3 additions & 1 deletion src/Phinx/Db/Adapter/SQLiteAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1394,9 +1394,11 @@ protected function getDropForeignKeyByColumnsInstructions(string $tableName, arr
/**
* {@inheritDoc}
*
* @param string|\Phinx\Db\Literal $type Type
* @param int|null $limit Limit
* @throws \Phinx\Db\Adapter\UnsupportedColumnTypeException
*/
public function getSqlType(string $type, ?int $limit = null): array
public function getSqlType($type, ?int $limit = null): array
{
$typeLC = strtolower($type);
if ($type instanceof Literal) {
Expand Down
34 changes: 17 additions & 17 deletions src/Phinx/Db/Table/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class Column
protected $type;

/**
* @var int
* @var int|null
*/
protected $limit;
protected $limit = null;

/**
* @var bool
Expand Down Expand Up @@ -96,7 +96,7 @@ class Column
/**
* @var int
*/
protected $scale;
protected $scale = null;

/**
* @var string
Expand All @@ -109,9 +109,9 @@ class Column
protected $update;

/**
* @var string
* @var string|null
*/
protected $comment;
protected $comment = null;

/**
* @var bool
Expand Down Expand Up @@ -197,10 +197,10 @@ public function getType()
/**
* Sets the column limit.
*
* @param int $limit Limit
* @param int|null $limit Limit
* @return $this
*/
public function setLimit(int $limit)
public function setLimit(?int $limit)
{
$this->limit = $limit;

Expand All @@ -212,7 +212,7 @@ public function setLimit(int $limit)
*
* @return int
*/
public function getLimit(): int
public function getLimit(): ?int
{
return $this->limit;
}
Expand Down Expand Up @@ -358,10 +358,10 @@ public function getUpdate(): string
* For example `DECIMAL(5,2)`, 5 is the precision and 2 is the scale,
* and the column could store value from -999.99 to 999.99.
*
* @param int $precision Number precision
* @param int|null $precision Number precision
* @return $this
*/
public function setPrecision(int $precision)
public function setPrecision(?int $precision)
{
$this->setLimit($precision);

Expand All @@ -376,7 +376,7 @@ public function setPrecision(int $precision)
*
* @return int
*/
public function getPrecision(): int
public function getPrecision(): ?int
{
return $this->limit;
}
Expand Down Expand Up @@ -433,10 +433,10 @@ public function setIncrement(int $increment)
* For example `DECIMAL(5,2)`, 5 is the precision and 2 is the scale,
* and the column could store value from -999.99 to 999.99.
*
* @param int $scale Number scale
* @param int|null $scale Number scale
* @return $this
*/
public function setScale(int $scale)
public function setScale(?int $scale)
{
$this->scale = $scale;

Expand All @@ -451,7 +451,7 @@ public function setScale(int $scale)
*
* @return int
*/
public function getScale(): int
public function getScale(): ?int
{
return $this->scale;
}
Expand All @@ -477,10 +477,10 @@ public function setPrecisionAndScale(int $precision, int $scale)
/**
* Sets the column comment.
*
* @param string $comment Comment
* @param string|null $comment Comment
* @return $this
*/
public function setComment(string $comment)
public function setComment(?string $comment)
{
$this->comment = $comment;

Expand All @@ -492,7 +492,7 @@ public function setComment(string $comment)
*
* @return string
*/
public function getComment(): string
public function getComment(): ?string
{
return $this->comment;
}
Expand Down
18 changes: 9 additions & 9 deletions src/Phinx/Db/Table/ForeignKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ class ForeignKey
protected $referencedColumns = [];

/**
* @var string
* @var string|null
*/
protected $onDelete;
protected $onDelete = null;

/**
* @var string
* @var string|null
*/
protected $onUpdate;
protected $onUpdate = null;

/**
* @var string|null
*/
protected $constraint;
protected $constraint = null;

/**
* Sets the foreign key columns.
Expand Down Expand Up @@ -132,19 +132,19 @@ public function setOnDelete(string $onDelete)
/**
* Gets ON DELETE action for the foreign key.
*
* @return string
* @return string|null
*/
public function getOnDelete(): string
public function getOnDelete(): ?string
{
return $this->onDelete;
}

/**
* Gets ON UPDATE action for the foreign key.
*
* @return string
* @return string|null
*/
public function getOnUpdate(): string
public function getOnUpdate(): ?string
{
return $this->onUpdate;
}
Expand Down
18 changes: 9 additions & 9 deletions src/Phinx/Migration/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ abstract class AbstractMigration implements MigrationInterface
protected $version;

/**
* @var \Phinx\Db\Adapter\AdapterInterface
* @var \Phinx\Db\Adapter\AdapterInterface|null
*/
protected $adapter;
protected $adapter = null;

/**
* @var \Symfony\Component\Console\Output\OutputInterface
* @var \Symfony\Component\Console\Output\OutputInterface|null
*/
protected $output;
protected $output = null;

/**
* @var \Symfony\Component\Console\Input\InputInterface
* @var \Symfony\Component\Console\Input\InputInterface|null
*/
protected $input;
protected $input = null;

/**
* Whether this migration is being applied or reverted
Expand Down Expand Up @@ -97,7 +97,7 @@ public function setAdapter(AdapterInterface $adapter): MigrationInterface
/**
* @inheritDoc
*/
public function getAdapter(): AdapterInterface
public function getAdapter(): ?AdapterInterface
{
return $this->adapter;
}
Expand All @@ -115,7 +115,7 @@ public function setInput(InputInterface $input): MigrationInterface
/**
* @inheritDoc
*/
public function getInput(): InputInterface
public function getInput(): ?InputInterface
{
return $this->input;
}
Expand All @@ -133,7 +133,7 @@ public function setOutput(OutputInterface $output): MigrationInterface
/**
* @inheritDoc
*/
public function getOutput(): OutputInterface
public function getOutput(): ?OutputInterface
{
return $this->output;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Phinx/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class Manager
/**
* @var \Phinx\Migration\MigrationInterface[]
*/
protected $migrations = [];
protected $migrations;

/**
* @var \Phinx\Seed\SeedInterface[]
*/
protected $seeds = [];
protected $seeds;

/**
* @var \Psr\Container\ContainerInterface
Expand Down Expand Up @@ -1035,7 +1035,6 @@ public function toggleBreakpoint(string $environment, ?int $version): void
protected function markBreakpoint(string $environment, ?int $version, int $mark): void
{
$migrations = $this->getMigrations($environment);
$this->getMigrations($environment);
$env = $this->getEnvironment($environment);
$versions = $env->getVersionLog();

Expand Down

0 comments on commit f385bbb

Please sign in to comment.