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

feat: add composer dependencies #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
],
"require": {
"php": "^8.2",
"illuminate/contracts": "^10.48 || ^11.0"
"illuminate/contracts": "^10.48 || ^11.0",
"illuminate/support": "^10.48 || ^11.0",
"illuminate/http": "^10.48 || ^11.0",
"spiral/data-grid": "^3.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
Expand All @@ -31,11 +34,13 @@
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "^10.5",
"roave/security-advisories": "dev-latest",
"wayofdev/cs-fixer-config": "^1.2"
"wayofdev/cs-fixer-config": "^1.2",
"wayofdev/laravel-cycle-orm-adapter": "^4.10",
"wayofdev/laravel-cycle-orm-factories": "^1.1"
},
"autoload": {
"psr-4": {
"WayOfDev\\Package\\": "src/"
"WayOfDev\\QueryBuilder\\": "src/"
}
},
"autoload-dev": {
Expand Down Expand Up @@ -65,7 +70,7 @@
"extra": {
"laravel": {
"providers": [
"WayOfDev\\Package\\Bridge\\Laravel\\Providers\\PackageServiceProvider"
"WayOfDev\\QueryBuilder\\Bridge\\Laravel\\Providers\\QueryBuilderServiceProvider"
]
},
"composer-normalize": {
Expand Down
7,172 changes: 4,310 additions & 2,862 deletions composer.lock

Large diffs are not rendered by default.

File renamed without changes.
26 changes: 0 additions & 26 deletions src/Bridge/Laravel/Providers/PackageServiceProvider.php

This file was deleted.

37 changes: 37 additions & 0 deletions src/Bridge/Laravel/Providers/QueryBuilderServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace WayOfDev\QueryBuilder\Bridge\Laravel\Providers;

use Illuminate\Support\ServiceProvider;

final class QueryBuilderServiceProvider extends ServiceProvider
{
public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../../../../config/query-builder.php' => config_path('query-builder.php'),
], 'config');

$this->registerConsoleCommands();
}
}

public function register(): void
{
// @phpstan-ignore-next-line
if (! $this->app->configurationIsCached()) {
$this->mergeConfigFrom(
__DIR__ . '/../../../../config/query-builder.php',
'query-builder'
);
}
}

private function registerConsoleCommands(): void
{
$this->commands([]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
namespace WayOfDev\Tests\Bridge\Laravel\Providers;

use PHPUnit\Framework\Attributes\Test;
use WayOfDev\Package\Bridge\Laravel\Providers\PackageServiceProvider;
use WayOfDev\QueryBuilder\Bridge\Laravel\Providers\QueryBuilderServiceProvider;
use WayOfDev\Tests\TestCase;

class PackageServiceProviderTest extends TestCase
class QueryBuilderServiceProviderTest extends TestCase
{
#[Test]
public function it_publishes_configuration(): void
{
$this->artisan('vendor:publish', [
'--provider' => PackageServiceProvider::class,
'--provider' => QueryBuilderServiceProvider::class,
])->assertExitCode(0);

$this::assertFileExists(config_path('package.php'));
Expand Down
4 changes: 2 additions & 2 deletions tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Faker\Factory as FakerFactory;
use Faker\Generator;
use Orchestra\Testbench\TestCase as Orchestra;
use WayOfDev\Package\Bridge\Laravel\Providers\PackageServiceProvider;
use WayOfDev\QueryBuilder\Bridge\Laravel\Providers\QueryBuilderServiceProvider;

use function array_key_exists;

Expand All @@ -33,7 +33,7 @@ public function ignorePackageDiscoveriesFrom(): array
protected function getPackageProviders($app): array
{
return [
PackageServiceProvider::class,
QueryBuilderServiceProvider::class,
];
}
}
Loading