Skip to content

Commit

Permalink
Merge branch 'illuminate-console' into illuminate-console-8
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Sep 18, 2023
2 parents 54e75ae + 0c2aae4 commit 850fd2d
Show file tree
Hide file tree
Showing 32 changed files with 693 additions and 1,519 deletions.
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@
"illuminate/filesystem": "^10.17"
},
"require-dev": {
"fakerphp/faker": "^1.21",
"mockery/mockery": "^1.5.1",
"laravel/framework": "^10.17",
"laravel/pint": "^1.6",
"orchestra/testbench": "^8.9",
"orchestra/testbench-core": "^8.10.2",
"phpstan/phpstan": "^1.10.6",
"phpunit/phpunit": "^10.1"
"phpunit/phpunit": "^10.1",
"symfony/yaml": "^6.2"
},
"conflict": {
"orchestra/canvas": "<8.8.0",
"orchestra/canvas": "<8.9.0",
"orchestra/testbench-core": "<8.2.0"
},
"config": {
Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
parameters:
ignoreErrors:
-
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
88 changes: 0 additions & 88 deletions src/CodeGenerator.php

This file was deleted.

91 changes: 91 additions & 0 deletions src/Commands/GeneratorCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

namespace Orchestra\Canvas\Core\Commands;

use Illuminate\Filesystem\Filesystem;
use Orchestra\Canvas\Core\Concerns;
use Orchestra\Canvas\Core\Contracts\GeneratesCode;

/**
* @property string|null $name
* @property string|null $description
*/
abstract class GeneratorCommand extends \Illuminate\Console\GeneratorCommand implements GeneratesCode
{
use Concerns\CodeGenerator;
use Concerns\TestGenerator;
use Concerns\UsesGeneratorOverrides;

/**
* Create a new controller creator command instance.
*
* @return void
*/
public function __construct(Filesystem $files)
{
parent::__construct($files);

$this->addGeneratorPresetOptions();
}

/**
* Execute the console command.
*
* @return bool|null
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function handle()
{
return $this->generateCode() ? self::SUCCESS : self::FAILURE;

Check failure on line 40 in src/Commands/GeneratorCommand.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (highest)

Method Orchestra\Canvas\Core\Commands\GeneratorCommand::handle() should return bool|null but returns int.

Check failure on line 40 in src/Commands/GeneratorCommand.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (highest)

Method Orchestra\Canvas\Core\Commands\GeneratorCommand::handle() should return bool|null but returns int.
}

/**
* Get the destination class path.
*
* @param string $name
* @return string
*/
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
}

/**
* Qualify the given model class base name.
*
* @return string
*/
protected function qualifyModel(string $model)
{
return $this->qualifyModelUsingCanvas($model);
}

/**
* Get the root namespace for the class.
*
* @return string
*/
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
}

/**
* Get the model for the default guard's user provider.
*/
protected function userProviderModel(): ?string
{
return $this->userProviderModelUsingCanvas();
}

/**
* Get the first view directory path from the application configuration.
*
* @return string
*/
protected function viewPath($path = '')
{
return $this->viewPathUsingCanvas($path);
}
}
31 changes: 0 additions & 31 deletions src/Commands/Generators/Code.php

This file was deleted.

87 changes: 0 additions & 87 deletions src/Commands/Generators/ConsoleGenerator.php

This file was deleted.

36 changes: 0 additions & 36 deletions src/CommandsProvider.php

This file was deleted.

Loading

0 comments on commit 850fd2d

Please sign in to comment.