Skip to content

Commit da9c902

Browse files
authored
👷 Update workflow (#24)
2 parents 1636a1a + 7c33444 commit da9c902

File tree

8 files changed

+66
-62
lines changed

8 files changed

+66
-62
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
if: "!contains(github.event.head_commit.message, '[ci skip]')"
1616
strategy:
1717
matrix:
18-
php: ["7.3"]
18+
php: ["8.2"]
1919

2020
steps:
2121
- name: Checkout the project
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323

2424
- name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }}
2525
uses: shivammathur/setup-php@v2
@@ -31,9 +31,9 @@ jobs:
3131

3232
- name: Restore the Composer cache directory
3333
id: composercache
34-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3535

36-
- uses: actions/cache@v2
36+
- uses: actions/cache@v4
3737
with:
3838
path: ${{ steps.composercache.outputs.dir }}
3939
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
@@ -43,4 +43,4 @@ jobs:
4343
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
4444

4545
- name: Execute the PHP lint script
46-
run: composer run-script lint
46+
run: vendor/bin/pint --test

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@
2424
}
2525
},
2626
"require": {
27-
"php": "^7.3|^8.0"
27+
"php": "^8.0"
2828
},
2929
"require-dev": {
30-
"squizlabs/php_codesniffer": "^3.5"
30+
"laravel/pint": "^1.25"
3131
},
3232
"extra": {
3333
"acorn": {
3434
"providers": [
3535
"Log1x\\HtmlForms\\HtmlFormsServiceProvider"
3636
]
3737
}
38-
},
39-
"scripts": {
40-
"lint": [
41-
"phpcs --ignore=vendor,resources --extensions=php --standard=PSR12 ."
42-
]
4338
}
4439
}

composer.lock

Lines changed: 41 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Console/FormListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Log1x\HtmlForms\Console;
44

5-
use Roots\Acorn\Console\Commands\Command;
65
use Illuminate\Support\Str;
6+
use Roots\Acorn\Console\Commands\Command;
77

88
class FormListCommand extends Command
99
{

src/Console/FormMakeCommand.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public function getViewPath()
9090
*/
9191
protected function getViewStub()
9292
{
93-
return __DIR__ . "/stubs/views/{$this->view}.stub";
93+
return __DIR__."/stubs/views/{$this->view}.stub";
9494
}
9595

9696
/**
9797
* Return the applications view path.
9898
*
99-
* @param string $name
99+
* @param string $name
100100
* @return void
101101
*/
102102
protected function getPaths()
@@ -144,9 +144,9 @@ public function clearLine()
144144
/**
145145
* Run a task in the console.
146146
*
147-
* @param string $title
148-
* @param callable|null $task
149-
* @param string $status
147+
* @param string $title
148+
* @param callable|null $task
149+
* @param string $status
150150
* @return mixed
151151
*/
152152
protected function task($title, $task = null, $status = '...')
@@ -167,14 +167,14 @@ protected function task($title, $task = null, $status = '...')
167167
throw $e;
168168
}
169169

170-
$this->clearLine()->line("{$title}: " . ($status ? '<info>✔</info>' : '<fg=red;options=bold>x</>'));
170+
$this->clearLine()->line("{$title}: ".($status ? '<info>✔</info>' : '<fg=red;options=bold>x</>'));
171171
}
172172

173173
/**
174174
* Returns a shortened path.
175175
*
176-
* @param string $path
177-
* @param int $i
176+
* @param string $path
177+
* @param int $i
178178
* @return string
179179
*/
180180
protected function shortenPath($path, $i = 3)

src/HtmlForms.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ public function __construct()
2525
/**
2626
* Render forms using Blade if a corresponding view exists.
2727
*
28-
* @param string $html
29-
* @param \HTML_Forms\Form $form
28+
* @param string $html
29+
* @param \HTML_Forms\Form $form
3030
* @return string
3131
*/
3232
protected function render()
3333
{
3434
add_filter('hf_form_html', function ($html, $form) {
35-
if (! view()->exists('forms.' . $form->slug)) {
35+
if (! view()->exists('forms.'.$form->slug)) {
3636
return $html;
3737
}
3838

src/HtmlFormsServiceProvider.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
namespace Log1x\HtmlForms;
44

55
use Illuminate\Support\Facades\Blade;
6-
use Illuminate\View\Compilers\BladeCompiler;
76
use Illuminate\Support\ServiceProvider;
8-
use Log1x\HtmlForms\HtmlForms;
9-
use Log1x\HtmlForms\Console\FormMakeCommand;
7+
use Illuminate\View\Compilers\BladeCompiler;
108
use Log1x\HtmlForms\Console\FormListCommand;
9+
use Log1x\HtmlForms\Console\FormMakeCommand;
1110
use Log1x\HtmlForms\View\Components\HtmlForms as HtmlFormsComponent;
1211

1312
class HtmlFormsServiceProvider extends ServiceProvider
@@ -20,7 +19,7 @@ class HtmlFormsServiceProvider extends ServiceProvider
2019
public function register()
2120
{
2221
$this->app->singleton('Log1x\HtmlForms', function () {
23-
return new HtmlForms();
22+
return new HtmlForms;
2423
});
2524
}
2625

@@ -40,7 +39,7 @@ public function boot()
4039
FormListCommand::class,
4140
]);
4241

43-
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'HtmlForms');
42+
$this->loadViewsFrom(__DIR__.'/../resources/views', 'HtmlForms');
4443

4544
$this->callAfterResolving(BladeCompiler::class, function ($view) {
4645
$view->component(HtmlFormsComponent::class);

src/View/Components/HtmlForms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class HtmlForms extends Component
2424
/**
2525
* Create the component instance.
2626
*
27-
* @param int $form
27+
* @param int $form
2828
* @param array $messages
29-
* @param string $hidden
29+
* @param string $hidden
3030
* @return void
3131
*/
3232
public function __construct(

0 commit comments

Comments
 (0)