Skip to content

Commit

Permalink
Merge branch '8.x'
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 579c7f7 + 32e4c66 commit bed0a93
Show file tree
Hide file tree
Showing 38 changed files with 700 additions and 1,730 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
# Ignore following folder/file.
/.github export-ignore
/tests export-ignore
/workbench export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml export-ignore
/pint.json export-ignore
/sync.sh export-ignore
/testbench.yaml export-ignore
/CHANGELOG-*.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"illuminate/filesystem": "^11.0"
},
"require-dev": {
"fakerphp/faker": "^1.21",
"mockery/mockery": "^1.5.1",
"laravel/framework": "^10.17",
"laravel/pint": "^1.6",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10.6"
Expand Down
8 changes: 4 additions & 4 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
parameters:
ignoreErrors:
-
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Container\\\\Container\\:\\:basePath\\(\\)\\.$#"
message: "#^Cannot access offset 'path' on Illuminate\\\\Contracts\\\\Foundation\\\\Application\\.$#"
count: 1
path: src/LaravelServiceProvider.php
path: src/Commands/GeneratorCommand.php

-
message: "#^Method Orchestra\\\\Canvas\\\\Core\\\\Presets\\\\Preset\\:\\:config\\(\\) has no return type specified\\.$#"
message: "#^Parameter \\#1 \\$app of class Orchestra\\\\Canvas\\\\Core\\\\Presets\\\\Laravel constructor expects Illuminate\\\\Contracts\\\\Foundation\\\\Application, Illuminate\\\\Contracts\\\\Container\\\\Container given\\.$#"
count: 1
path: src/Presets/Preset.php
path: src/PresetManager.php
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
# The level 8 is the highest level
level: 7

ignoreErrors:
- '#Method [a-zA-Z\\\<\>]+::handle\(\) should return bool\|null but returns int.#'

checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
88 changes: 0 additions & 88 deletions src/CodeGenerator.php

This file was deleted.

109 changes: 0 additions & 109 deletions src/Commands/Command.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;
}

/**
* 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.

Loading

0 comments on commit bed0a93

Please sign in to comment.