Skip to content

Commit

Permalink
fix: default Laravel namespace conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Jun 11, 2024
1 parent 67f58e1 commit 06406d2
Show file tree
Hide file tree
Showing 38 changed files with 60 additions and 160 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_FORWARD_PORT=16379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
Expand Down
8 changes: 4 additions & 4 deletions app/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
|
*/

$app = (new Laravel\Application(
$app = (new Bridge\Laravel\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
));

Expand All @@ -28,17 +28,17 @@

$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
Laravel\HttpKernel::class
Bridge\Laravel\HttpKernel::class
);

$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
Laravel\ConsoleKernel::class
Bridge\Laravel\ConsoleKernel::class
);

$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
Laravel\Exceptions\Handler::class
Bridge\Laravel\Exceptions\Handler::class
);

/*
Expand Down
2 changes: 1 addition & 1 deletion app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"Bridge\\Laravel\\": "src/Bridge/Laravel/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Domain\\": "src/Domain/",
"Laravel\\": "src/Bridge/Laravel/",
"Support\\": "src/Support/"
}
},
Expand Down
14 changes: 7 additions & 7 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@
/*
* Application Service Providers...
*/
Laravel\Providers\AppServiceProvider::class,
Laravel\Providers\AuthServiceProvider::class,
Laravel\Providers\EventServiceProvider::class,
Laravel\Providers\RouteServiceProvider::class,
Bridge\Laravel\Providers\AppServiceProvider::class,
Bridge\Laravel\Providers\AuthServiceProvider::class,
Bridge\Laravel\Providers\EventServiceProvider::class,
Bridge\Laravel\Providers\RouteServiceProvider::class,

/*
* Domain Service Providers
*/
Laravel\Providers\Domain\UserServiceProvider::class,
Laravel\Providers\Domain\CategoryServiceProvider::class,
Laravel\Providers\Domain\ProductServiceProvider::class,
Bridge\Laravel\Providers\Domain\UserServiceProvider::class,
Bridge\Laravel\Providers\Domain\CategoryServiceProvider::class,
Bridge\Laravel\Providers\Domain\ProductServiceProvider::class,
])->toArray(),

/*
Expand Down
104 changes: 0 additions & 104 deletions app/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,108 +261,4 @@
<code><![CDATA[function () {]]></code>
</MissingClosureReturnType>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Console/Command.php">
<LessSpecificReturnStatement>
<code><![CDATA[$this]]></code>
</LessSpecificReturnStatement>
<MixedArgument>
<code><![CDATA[$arguments]]></code>
<code><![CDATA[$options]]></code>
<code><![CDATA[$this->name = $name]]></code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code><![CDATA[(array) $this->aliases]]></code>
</MixedArgumentTypeCoercion>
<MixedAssignment>
<code><![CDATA[$this->name]]></code>
</MixedAssignment>
<RedundantCast>
<code><![CDATA[(string) $this->help]]></code>
</RedundantCast>
<RedundantCastGivenDocblockType>
<code><![CDATA[(array) $this->aliases]]></code>
</RedundantCastGivenDocblockType>
<UninitializedProperty>
<code><![CDATA[$this->name]]></code>
</UninitializedProperty>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/HasFactory.php">
<MixedArgumentTypeCoercion>
<code><![CDATA[is_callable($count) || is_array($count) ? $count : $state]]></code>
<code><![CDATA[is_callable($count) || is_array($count) ? $count : $state]]></code>
<code><![CDATA[is_callable($count) || is_array($count) ? $count : $state]]></code>
</MixedArgumentTypeCoercion>
<RedundantCondition>
<code><![CDATA[static::newFactory()]]></code>
<code><![CDATA[static::newFactory()]]></code>
<code><![CDATA[static::newFactory()]]></code>
</RedundantCondition>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php">
<MissingConstructor>
<code><![CDATA[$table]]></code>
<code><![CDATA[$table]]></code>
<code><![CDATA[$table]]></code>
</MissingConstructor>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Foundation/Application.php">
<MissingConstructor>
<code><![CDATA[$appPath]]></code>
<code><![CDATA[$basePath]]></code>
<code><![CDATA[$bootstrapPath]]></code>
<code><![CDATA[$configPath]]></code>
<code><![CDATA[$databasePath]]></code>
<code><![CDATA[$environmentPath]]></code>
<code><![CDATA[$langPath]]></code>
<code><![CDATA[$publicPath]]></code>
<code><![CDATA[$storagePath]]></code>
</MissingConstructor>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php">
<ArgumentTypeCoercion>
<code><![CDATA[$model]]></code>
</ArgumentTypeCoercion>
<MixedArgument>
<code><![CDATA[$ability]]></code>
<code><![CDATA[$ability]]></code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code><![CDATA[$model]]></code>
<code><![CDATA[$parameter]]></code>
</MixedArgumentTypeCoercion>
<MixedAssignment>
<code><![CDATA[$ability]]></code>
</MixedAssignment>
<MixedInferredReturnType>
<code><![CDATA[string]]></code>
</MixedInferredReturnType>
<PossiblyUnusedParam>
<code><![CDATA[$request]]></code>
</PossiblyUnusedParam>
<RiskyTruthyFalsyComparison>
<code><![CDATA[$parameter]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php">
<DeprecatedProperty>
<code><![CDATA[$this->routeMiddleware]]></code>
</DeprecatedProperty>
<MoreSpecificImplementedParamType>
<code><![CDATA[$request]]></code>
<code><![CDATA[$request]]></code>
<code><![CDATA[$response]]></code>
</MoreSpecificImplementedParamType>
</file>
<file src="vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php">
<MixedArgument>
<code><![CDATA[$validator->getRulesWithoutPlaceholders()]]></code>
<code><![CDATA[$validator->getRulesWithoutPlaceholders()]]></code>
</MixedArgument>
<UndefinedInterfaceMethod>
<code><![CDATA[getRulesWithoutPlaceholders]]></code>
<code><![CDATA[getRulesWithoutPlaceholders]]></code>
<code><![CDATA[setRules]]></code>
<code><![CDATA[setRules]]></code>
</UndefinedInterfaceMethod>
</file>
</files>
3 changes: 3 additions & 0 deletions app/psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<directory name="src/"/>
<directory name="tests/"/>
<directory name="routes/"/>
<ignoreFiles>
<directory name="vendor/"/>
</ignoreFiles>
<file name=".php-cs-fixer.dist.php"/>
</projectFiles>
</psalm>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Laravel\Admin\Category\Controllers;
namespace Bridge\Laravel\Admin\Category\Controllers;

use Bridge\Laravel\Admin\Category\Queries\IndexQuery;
use Bridge\Laravel\Admin\Category\Transformers\CategoryTransformer;
use Bridge\Laravel\Http\Controller;
use Domain\Category\Models\Category;
use Illuminate\Http\JsonResponse;
use Laravel\Admin\Category\Queries\IndexQuery;
use Laravel\Admin\Category\Transformers\CategoryTransformer;
use Laravel\Http\Controller;
use Spatie\RouteAttributes\Attributes\Resource;

#[Resource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Admin\Category\Queries;
namespace Bridge\Laravel\Admin\Category\Queries;

use Domain\Category\Models\Category;
use Illuminate\Http\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Admin\Category\Transformers;
namespace Bridge\Laravel\Admin\Category\Transformers;

use Domain\Category\Models\Category;
use League\Fractal\TransformerAbstract;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Laravel\Admin\Network\Controllers;
namespace Bridge\Laravel\Admin\Network\Controllers;

use Laravel\Http\Controller;
use Bridge\Laravel\Http\Controller;
use Spatie\RouteAttributes\Attributes\Resource;

#[Resource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Laravel\Admin\Product\Controllers;
namespace Bridge\Laravel\Admin\Product\Controllers;

use Laravel\Http\Controller;
use Bridge\Laravel\Http\Controller;
use Spatie\RouteAttributes\Attributes\Resource;

#[Resource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Laravel\Admin\User\Controllers;
namespace Bridge\Laravel\Admin\User\Controllers;

use Laravel\Http\Controller;
use Bridge\Laravel\Http\Controller;
use Spatie\RouteAttributes\Attributes\Resource;

#[Resource(
Expand Down
4 changes: 2 additions & 2 deletions app/src/Bridge/Laravel/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Laravel;
namespace Bridge\Laravel;

use Illuminate\Foundation\Application as LaravelApplication;

class Application extends LaravelApplication
{
protected $namespace = 'Laravel\\';
protected $namespace = 'Bridge\\Laravel\\';

public function path($path = ''): string
{
Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Console/Commands/DemoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Console\Commands;
namespace Bridge\Laravel\Console\Commands;

use Illuminate\Console\Command;

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/ConsoleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel;
namespace Bridge\Laravel;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as BaseConsoleKernel;
Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Exceptions;
namespace Bridge\Laravel\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Http/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http;
namespace Bridge\Laravel\Http;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Bridge\Laravel\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Laravel\Providers\RouteServiceProvider;
use Symfony\Component\HttpFoundation\Response;

final class RedirectIfAuthenticated
Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Http/Middleware/TrustHosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Illuminate\Http\Middleware\TrustHosts as Middleware;

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Symfony\Component\HttpFoundation\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Http\Middleware;
namespace Bridge\Laravel\Http\Middleware;

use Illuminate\Routing\Middleware\ValidateSignature as Middleware;

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel;
namespace Bridge\Laravel;

use Illuminate\Foundation\Http\Kernel;

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bridge/Laravel/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Laravel\Providers;
namespace Bridge\Laravel\Providers;

use Illuminate\Support\ServiceProvider;

Expand Down
Loading

0 comments on commit 06406d2

Please sign in to comment.