diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c15d26..ad5ed1e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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') }} @@ -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 diff --git a/composer.json b/composer.json index 19b1ac2..fe92d80 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,10 @@ } }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0" }, "require-dev": { - "squizlabs/php_codesniffer": "^3.5" + "laravel/pint": "^1.25" }, "extra": { "acorn": { @@ -35,10 +35,5 @@ "Log1x\\HtmlForms\\HtmlFormsServiceProvider" ] } - }, - "scripts": { - "lint": [ - "phpcs --ignore=vendor,resources --extensions=php --standard=PSR12 ." - ] } } diff --git a/composer.lock b/composer.lock index 54dbca8..b295f38 100644 --- a/composer.lock +++ b/composer.lock @@ -4,74 +4,84 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1a4e8fa3e90d573329e282c5327b686d", + "content-hash": "12aef7d062f903360e251186554eaccb", "packages": [], "packages-dev": [ { - "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "name": "laravel/pint", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "url": "https://github.com/laravel/pint.git", + "reference": "595de38458c6b0ab4cae4bcc769c2e5c5d5b8e96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/laravel/pint/zipball/595de38458c6b0ab4cae4bcc769c2e5c5d5b8e96", + "reference": "595de38458c6b0ab4cae4bcc769c2e5c5d5b8e96", "shasum": "" }, "require": { - "ext-simplexml": "*", + "ext-json": "*", + "ext-mbstring": "*", "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "ext-xml": "*", + "php": "^8.2.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "friendsofphp/php-cs-fixer": "^3.87.2", + "illuminate/view": "^11.46.0", + "larastan/larastan": "^3.7.1", + "laravel-zero/framework": "^11.45.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^2.3.1", + "pestphp/pest": "^2.36.0" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "builds/pint" ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", "keywords": [ - "phpcs", - "standards" + "format", + "formatter", + "lint", + "linter", + "php" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" }, - "time": "2020-10-23T02:01:07+00:00" + "time": "2025-09-17T01:36:44+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "^7.3|^8.0" }, - "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/src/Console/FormListCommand.php b/src/Console/FormListCommand.php index 7be5646..c6c8ade 100644 --- a/src/Console/FormListCommand.php +++ b/src/Console/FormListCommand.php @@ -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 { diff --git a/src/Console/FormMakeCommand.php b/src/Console/FormMakeCommand.php index b1e0fc0..05e7d33 100644 --- a/src/Console/FormMakeCommand.php +++ b/src/Console/FormMakeCommand.php @@ -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() @@ -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 = '...') @@ -167,14 +167,14 @@ protected function task($title, $task = null, $status = '...') throw $e; } - $this->clearLine()->line("{$title}: " . ($status ? '' : 'x')); + $this->clearLine()->line("{$title}: ".($status ? '' : '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) diff --git a/src/HtmlForms.php b/src/HtmlForms.php index 52e640c..3b6dc32 100644 --- a/src/HtmlForms.php +++ b/src/HtmlForms.php @@ -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; } diff --git a/src/HtmlFormsServiceProvider.php b/src/HtmlFormsServiceProvider.php index e8a389b..3961eb4 100644 --- a/src/HtmlFormsServiceProvider.php +++ b/src/HtmlFormsServiceProvider.php @@ -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 @@ -20,7 +19,7 @@ class HtmlFormsServiceProvider extends ServiceProvider public function register() { $this->app->singleton('Log1x\HtmlForms', function () { - return new HtmlForms(); + return new HtmlForms; }); } @@ -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); diff --git a/src/View/Components/HtmlForms.php b/src/View/Components/HtmlForms.php index a05e3d8..6bc1c08 100644 --- a/src/View/Components/HtmlForms.php +++ b/src/View/Components/HtmlForms.php @@ -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(