Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Code Style

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
php-cs-fixer:
Expand All @@ -15,6 +15,7 @@ jobs:
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PHP_CS_FIXER }}
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "^8.0",
"illuminate/support": "^8.0|^9.0",
"illuminate/console": "^8.0|^9.0",
"sammyjo20/saloon": "^0.4.1"
"sammyjo20/saloon": "^0.5.0"
},
"extra": {
"laravel": {
Expand Down
41 changes: 41 additions & 0 deletions src/Console/Commands/MakePlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Sammyjo20\SaloonLaravel\Console\Commands;

class MakePlugin extends MakeCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'saloon:plugin';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new Saloon plugin';

/**
* The type of class being generated.
*
* @var string
*/
protected $type = 'Saloon Plugin';

/**
* The namespace to place the file
*
* @var string
*/
protected $namespace = '\Http\Saloon\Plugins';

/**
* The default stub
*
* @var string
*/
protected $stub = 'saloon.plugin.stub';
}
41 changes: 41 additions & 0 deletions src/Console/Commands/MakeResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Sammyjo20\SaloonLaravel\Console\Commands;

class MakeResponse extends MakeCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'saloon:response';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new custom Saloon response class';

/**
* The type of class being generated.
*
* @var string
*/
protected $type = 'Saloon Response';

/**
* The namespace to place the file
*
* @var string
*/
protected $namespace = '\Http\Saloon\Responses';

/**
* The default stub
*
* @var string
*/
protected $stub = 'saloon.response.stub';
}
11 changes: 11 additions & 0 deletions src/Console/Commands/stubs/saloon.plugin.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace {{ namespace }};

trait {{ class }}
{
public function boot{{ class }}Feature(): void
{
//
}
}
10 changes: 10 additions & 0 deletions src/Console/Commands/stubs/saloon.response.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace {{ namespace }};

use Sammyjo20\Saloon\Http\SaloonResponse;

class {{ class }} extends SaloonResponse
{
//
}
4 changes: 4 additions & 0 deletions src/SaloonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use Illuminate\Support\ServiceProvider;
use Sammyjo20\SaloonLaravel\Clients\MockClient;
use Sammyjo20\SaloonLaravel\Console\Commands\MakePlugin;
use Sammyjo20\SaloonLaravel\Console\Commands\MakeRequest;
use Sammyjo20\SaloonLaravel\Console\Commands\MakeResponse;
use Sammyjo20\SaloonLaravel\Console\Commands\MakeConnector;

class SaloonServiceProvider extends ServiceProvider
Expand All @@ -24,6 +26,8 @@ protected function registerCommands(): self
$this->commands([
MakeConnector::class,
MakeRequest::class,
MakeResponse::class,
MakePlugin::class,
]);

return $this;
Expand Down