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
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php: ["7.3"]
php: ["8.2"]

steps:
- name: Checkout the project
uses: actions/checkout@v2
uses: actions/checkout@v4

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

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

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

- name: Execute the PHP lint script
run: composer run-script lint
run: vendor/bin/pint --test
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,16 @@
}
},
"require": {
"php": "^7.3|^8.0"
"php": "^8.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5"
"laravel/pint": "^1.25"
},
"extra": {
"acorn": {
"providers": [
"Log1x\\HtmlForms\\HtmlFormsServiceProvider"
]
}
},
"scripts": {
"lint": [
"phpcs --ignore=vendor,resources --extensions=php --standard=PSR12 ."
]
}
}
72 changes: 41 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Console/FormListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Log1x\HtmlForms\Console;

use Roots\Acorn\Console\Commands\Command;
use Illuminate\Support\Str;
use Roots\Acorn\Console\Commands\Command;

class FormListCommand extends Command
{
Expand Down
16 changes: 8 additions & 8 deletions src/Console/FormMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public function getViewPath()
*/
protected function getViewStub()
{
return __DIR__ . "/stubs/views/{$this->view}.stub";
return __DIR__."/stubs/views/{$this->view}.stub";
}

/**
* Return the applications view path.
*
* @param string $name
* @param string $name
* @return void
*/
protected function getPaths()
Expand Down Expand Up @@ -144,9 +144,9 @@ public function clearLine()
/**
* Run a task in the console.
*
* @param string $title
* @param callable|null $task
* @param string $status
* @param string $title
* @param callable|null $task
* @param string $status
* @return mixed
*/
protected function task($title, $task = null, $status = '...')
Expand All @@ -167,14 +167,14 @@ protected function task($title, $task = null, $status = '...')
throw $e;
}

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

/**
* Returns a shortened path.
*
* @param string $path
* @param int $i
* @param string $path
* @param int $i
* @return string
*/
protected function shortenPath($path, $i = 3)
Expand Down
6 changes: 3 additions & 3 deletions src/HtmlForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public function __construct()
/**
* Render forms using Blade if a corresponding view exists.
*
* @param string $html
* @param \HTML_Forms\Form $form
* @param string $html
* @param \HTML_Forms\Form $form
* @return string
*/
protected function render()
{
add_filter('hf_form_html', function ($html, $form) {
if (! view()->exists('forms.' . $form->slug)) {
if (! view()->exists('forms.'.$form->slug)) {
return $html;
}

Expand Down
9 changes: 4 additions & 5 deletions src/HtmlFormsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace Log1x\HtmlForms;

use Illuminate\Support\Facades\Blade;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\Support\ServiceProvider;
use Log1x\HtmlForms\HtmlForms;
use Log1x\HtmlForms\Console\FormMakeCommand;
use Illuminate\View\Compilers\BladeCompiler;
use Log1x\HtmlForms\Console\FormListCommand;
use Log1x\HtmlForms\Console\FormMakeCommand;
use Log1x\HtmlForms\View\Components\HtmlForms as HtmlFormsComponent;

class HtmlFormsServiceProvider extends ServiceProvider
Expand All @@ -20,7 +19,7 @@ class HtmlFormsServiceProvider extends ServiceProvider
public function register()
{
$this->app->singleton('Log1x\HtmlForms', function () {
return new HtmlForms();
return new HtmlForms;
});
}

Expand All @@ -40,7 +39,7 @@ public function boot()
FormListCommand::class,
]);

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

$this->callAfterResolving(BladeCompiler::class, function ($view) {
$view->component(HtmlFormsComponent::class);
Expand Down
4 changes: 2 additions & 2 deletions src/View/Components/HtmlForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class HtmlForms extends Component
/**
* Create the component instance.
*
* @param int $form
* @param int $form
* @param array $messages
* @param string $hidden
* @param string $hidden
* @return void
*/
public function __construct(
Expand Down