Skip to content

Commit

Permalink
Removing support for older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
forxer committed Dec 19, 2022
1 parent df8b782 commit e89ed21
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

2.0.0 (2022-12-19)
------------------

- PHP < 8.1 support removed
- doctrine/dbal < 3.5 support


1.3.2 (2022-12-01)
------------------

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"php": "^8.1",
"illuminate/support": "^8.0 || ^9.0",
"illuminate/database": "^8.0 || ^9.0",
"doctrine/dbal": "^2.13|^3.1"
"doctrine/dbal": "^3.5"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function register()

$this->publishes([
__DIR__.'/../database/migrations/transform_pk_int_to_bigint.php.stub' =>
database_path('migrations/' . now()->format('Y_m_d_His') . '_transform_pk_int_to_bigint.php'),
database_path('migrations/'.now()->format('Y_m_d_His').'_transform_pk_int_to_bigint.php'),
], 'pk-int-to-bigint-migration');
}
}
16 changes: 10 additions & 6 deletions src/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class Transformer

protected SchemaBuilder $schemaBuilder;

protected $command = null;
protected ?Command $command = null;

private array $intColumnsInfo = [];

private array $foreignKeysConstraintsInfo = [];

/**
* @param Connection $connection
Expand All @@ -35,7 +39,7 @@ public function __construct(Connection $connection)
* @param Command $command
* @return void
*/
public function setConsoleCommand(Command $command)
public function setConsoleCommand(Command $command): void
{
$this->command = $command;
}
Expand All @@ -47,7 +51,7 @@ public function setConsoleCommand(Command $command)
*
* @return void
*/
public function transform()
public function transform(): void
{
$this->extractSchemaInfos();

Expand Down Expand Up @@ -120,7 +124,7 @@ public function transform()
*
* @return void
*/
protected function extractSchemaInfos()
private function extractSchemaInfos(): void
{
$this->intColumnsInfo = [];
$this->foreignKeysConstraintsInfo = [];
Expand Down Expand Up @@ -191,7 +195,7 @@ protected function extractSchemaInfos()
* @param array $constraint
* @return bool
*/
protected function hasConstraintAnomaly(array $constraint)
private function hasConstraintAnomaly(array $constraint): bool
{
return $this->connection
->table($constraint['table'])
Expand All @@ -211,7 +215,7 @@ protected function hasConstraintAnomaly(array $constraint)
* @param string $style
* @return void
*/
protected function message($message, $style = 'info')
protected function message(string $message, string $style = 'info'): void
{
if ($this->command !== null) {
$this->command->line($message, $style);
Expand Down

0 comments on commit e89ed21

Please sign in to comment.