Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Sep 13, 2023
2 parents f146875 + 686f0bd commit a0aa408
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
parameters:
ignoreErrors:
-
message: "#^Method Orchestra\\\\Canvas\\\\Core\\\\Contracts\\\\GeneratesCodeListener\\:\\:codeAlreadyExists\\(\\) has no return type specified\\.$#"
count: 1
path: src/Contracts/GeneratesCodeListener.php

-
message: "#^Method Orchestra\\\\Canvas\\\\Core\\\\Contracts\\\\GeneratesCodeListener\\:\\:codeHasBeenGenerated\\(\\) has no return type specified\\.$#"
count: 1
path: src/Contracts/GeneratesCodeListener.php

-
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Container\\\\Container\\:\\:basePath\\(\\)\\.$#"
count: 1
path: src/LaravelServiceProvider.php

-
message: "#^Method Orchestra\\\\Canvas\\\\Core\\\\Presets\\\\Preset\\:\\:config\\(\\) has no return type specified\\.$#"
count: 1
path: src/Presets/Preset.php
1 change: 0 additions & 1 deletion src/Presets/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function is(string $name): bool
* Get configuration.
*
* @param mixed|null $default
* @return mixed
*/
public function config(?string $key = null, $default = null)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Presets/LaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Filesystem\Filesystem;
use Mockery as m;
use Orchestra\Canvas\Commands;
use Orchestra\Canvas\Core\Commands\Generators;
use Orchestra\Canvas\Core\Presets\Laravel;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
Expand Down Expand Up @@ -79,14 +79,14 @@ public function it_can_configure_provider_namespace()
public function it_can_add_additional_commands()
{
Laravel::commands([
Commands\Code::class,
Generators\Code::class,
]);

$app = m::mock(Application::class);
$app->shouldReceive('add')
->once()
->with(m::type(Commands\Code::class))
->andReturnUsing(fn ($generator) => $this->assertInstanceOf(Commands\Code::class, $generator));
->with(m::type(Generators\Code::class))
->andReturnUsing(fn ($generator) => $this->assertInstanceOf(Generators\Code::class, $generator));

$directory = __DIR__;
$preset = new Laravel(['namespace' => 'App', 'provider' => ['namespace' => 'App']], $directory, new Filesystem());
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Presets/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Filesystem\Filesystem;
use Mockery as m;
use Orchestra\Canvas\Commands;
use Orchestra\Canvas\Core\Commands\Generators;
use Orchestra\Canvas\Core\Presets\Package;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
Expand Down Expand Up @@ -82,14 +82,14 @@ public function it_requires_root_namespace_to_be_configured()
public function it_can_add_additional_commands()
{
Package::commands([
Commands\Code::class,
Generators\Code::class,
]);

$app = m::mock(Application::class);
$app->shouldReceive('add')
->once()
->with(m::type(Commands\Code::class))
->andReturnUsing(fn ($generator) => $this->assertInstanceOf(Commands\Code::class, $generator));
->with(m::type(Generators\Code::class))
->andReturnUsing(fn ($generator) => $this->assertInstanceOf(Generators\Code::class, $generator));

$directory = __DIR__;
$preset = new Package(['namespace' => 'App', 'provider' => ['namespace' => 'App']], $directory, new Filesystem());
Expand Down

0 comments on commit a0aa408

Please sign in to comment.