Migrations: Added namespace

This commit is contained in:
Igor Scheller 2018-10-24 13:35:31 +02:00 committed by msquare
parent 5f46fd2f15
commit d985d493a3
11 changed files with 21 additions and 4 deletions

View File

@ -25,7 +25,7 @@
"erusev/parsedown": "^1.6", "erusev/parsedown": "^1.6",
"illuminate/container": "5.5.*", "illuminate/container": "5.5.*",
"illuminate/database": "5.5.*", "illuminate/database": "5.5.*",
"illuminate/support": "^5.5", "illuminate/support": "5.5.*",
"nikic/fast-route": "^1.3", "nikic/fast-route": "^1.3",
"psr/container": "^1.0", "psr/container": "^1.0",
"psr/http-server-middleware": "^1.0", "psr/http-server-middleware": "^1.0",
@ -44,7 +44,8 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Engelsystem\\": "src/" "Engelsystem\\": "src/",
"Engelsystem\\Migrations\\": "db/migrations"
}, },
"files": [ "files": [
"src/helpers.php" "src/helpers.php"

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
class ImportInstallSql extends Migration class ImportInstallSql extends Migration

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
class ImportUpdateSql extends Migration class ImportUpdateSql extends Migration

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;

View File

@ -114,7 +114,7 @@ class Migrate
$className = Str::studly(preg_replace('/\d+_/', '', $migration)); $className = Str::studly(preg_replace('/\d+_/', '', $migration));
/** @var Migration $class */ /** @var Migration $class */
$class = $this->app->make($className); $class = $this->app->make('Engelsystem\\Migrations\\' . $className);
if (method_exists($class, $type)) { if (method_exists($class, $type)) {
$class->{$type}(); $class->{$type}();

View File

@ -2,7 +2,7 @@
namespace Engelsystem\Test\Unit\Database; namespace Engelsystem\Test\Unit\Database;
use AnotherStuff; use Engelsystem\Migrations\AnotherStuff;
use Illuminate\Database\Schema\Builder as SchemaBuilder; use Illuminate\Database\Schema\Builder as SchemaBuilder;
use PHPUnit\Framework\MockObject\MockBuilder; use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
class AnotherStuff extends Migration class AnotherStuff extends Migration

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Engelsystem\Migrations;
use Engelsystem\Database\Migration\Migration; use Engelsystem\Database\Migration\Migration;
class AddSomeFeature extends Migration class AddSomeFeature extends Migration