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

resolving namespace conflicts #14

Merged
merged 1 commit into from
Sep 15, 2024
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
],
"autoload": {
"psr-4": {
"Umbrellio\\Deploy\\": "src/"
"Umbrellio\\RollbackMissingMigrations\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Umbrellio\\Deploy\\Tests\\": "tests/"
"Umbrellio\\RollbackMissingMigrations\\Tests\\": "tests/"
}
},
"require": {
Expand All @@ -55,7 +55,7 @@
"extra": {
"laravel": {
"providers": [
"Umbrellio\\Deploy\\RollbackMissingMigrationServiceProvider"
"Umbrellio\\RollbackMissingMigrations\\RollbackMissingMigrationServiceProvider"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Console/RollbackMissingMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Console;
namespace Umbrellio\RollbackMissingMigrations\Console;

use Illuminate\Database\Console\Migrations\BaseCommand;
use Illuminate\Support\Facades\App;
use Symfony\Component\Process\Process;
use Umbrellio\Deploy\Helpers\DbHelper;
use Umbrellio\RollbackMissingMigrations\Helpers\DbHelper;

class RollbackMissingMigrations extends BaseCommand
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/RollbackNewMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Console;
namespace Umbrellio\RollbackMissingMigrations\Console;

use Illuminate\Console\Command;
use Illuminate\Database\Migrations\Migration;
Expand Down Expand Up @@ -30,7 +30,7 @@
$gitMigrationsPath = $this->option('git_migrations_path') ?? 'database/migrations/';
$gitCommand = str_replace('{git_migrations_path}', $gitMigrationsPath, self::COMMAND_PATTERN);

$migrationsFromMaster = collect(explode(PHP_EOL, shell_exec($gitCommand)))

Check notice on line 33 in src/Console/RollbackNewMigrations.php

View check run for this annotation

Scrutinizer / Inspection

src/Console/RollbackNewMigrations.php#L33

``explode(Umbrellio\RollbackMissingMigrations\Console\PHP_EOL, shell_exec($gitCommand))`` of type ``string[]`` is incompatible with the type ``Illuminate\Contracts\Support\Arrayable`` expected by parameter ``$value`` of ``collect()``.
->filter()
->map(fn (string $path) => new SplFileInfo(base_path($path)));
$migrationsFromCurrent = collect(File::files(base_path('database/migrations')));
Expand All @@ -57,7 +57,7 @@
private function downMigrationFile(SplFileInfo $f): void
{
$migration = require_once $f;
$filename = explode('.php', $f->getRelativePathname())[0];

Check failure on line 60 in src/Console/RollbackNewMigrations.php

View check run for this annotation

Scrutinizer / Inspection

src/Console/RollbackNewMigrations.php#L60

The method ``getRelativePathname()`` does not exist on ``SplFileInfo``. It seems like you code against a sub-type of ``SplFileInfo`` such as ``RectorPrefix202409\Symfony\Component\Finder\SplFileInfo`` or ``RectorPrefix202409\Nette\Utils\FileInfo`` or ``Nette\Utils\FileInfo`` or ``Psy\Readline\Hoa\IteratorSplFileInfo`` or ``ECSPrefix20211002\Symfony\Component\Finder\SplFileInfo`` or ``Symfony\Component\Finder\SplFileInfo`` or ``Illuminate\Http\UploadedFile``.
if (!$migration instanceof Migration) {
$class = Str::studly(implode('_', array_slice(explode('_', $filename), 4)));
$migration = new $class();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/RollbackMissingMigrationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Exceptions;
namespace Umbrellio\RollbackMissingMigrations\Exceptions;

use Exception;
use Illuminate\Support\Collection;
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/DbHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Helpers;
namespace Umbrellio\RollbackMissingMigrations\Helpers;

use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Umbrellio\Deploy\Exceptions\RollbackMissingMigrationException;
use Umbrellio\RollbackMissingMigrations\Exceptions\RollbackMissingMigrationException;

class DbHelper
{
Expand Down
6 changes: 3 additions & 3 deletions src/RollbackMissingMigrationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Umbrellio\Deploy;
namespace Umbrellio\RollbackMissingMigrations;

use Illuminate\Support\ServiceProvider;
use Umbrellio\Deploy\Console\RollbackMissingMigrations;
use Umbrellio\Deploy\Console\RollbackNewMigrations;
use Umbrellio\RollbackMissingMigrations\Console\RollbackMissingMigrations;
use Umbrellio\RollbackMissingMigrations\Console\RollbackNewMigrations;

class RollbackMissingMigrationServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion tests/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Tests;
namespace Umbrellio\RollbackMissingMigrations\Tests;

use Illuminate\Foundation\Application;
use Orchestra\Testbench\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Tests;
namespace Umbrellio\RollbackMissingMigrations\Tests;

use PHPUnit\Framework\TestCase;

Expand Down
8 changes: 4 additions & 4 deletions tests/functional/Console/RollbackMissingMigrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace Umbrellio\Deploy\Tests\functional\Console;
namespace Umbrellio\RollbackMissingMigrations\Tests\functional\Console;

use Generator;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use Umbrellio\Deploy\Exceptions\RollbackMissingMigrationException;
use Umbrellio\Deploy\RollbackMissingMigrationServiceProvider;
use Umbrellio\Deploy\Tests\FunctionalTestCase;
use Umbrellio\RollbackMissingMigrations\Exceptions\RollbackMissingMigrationException;
use Umbrellio\RollbackMissingMigrations\RollbackMissingMigrationServiceProvider;
use Umbrellio\RollbackMissingMigrations\Tests\FunctionalTestCase;

class RollbackMissingMigrationsTest extends FunctionalTestCase
{
Expand Down
Loading