diff --git a/.gitattributes b/.gitattributes index e78286d51..dceb04f2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,3 +12,4 @@ .workspace.json export-ignore Dockerfile export-ignore phpunit.xml.dist export-ignore +phpstan.neon.dist export-ignore diff --git a/.github/workflows/compile-assets.yml b/.github/workflows/compile-assets.yml new file mode 100644 index 000000000..ccab6e7af --- /dev/null +++ b/.github/workflows/compile-assets.yml @@ -0,0 +1,7 @@ +name: compile assets + +on: [push] + +jobs: + compile: + uses: laravel/.github/.github/workflows/compile-assets.yml@main diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 000000000..2e4502d41 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,37 @@ +name: static analysis + +on: + push: + branches: + - '*' + pull_request: + +permissions: + contents: read + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + name: Static Analysis + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute type checking + run: vendor/bin/phpstan diff --git a/composer.json b/composer.json index c4e2ebbf7..edfec5cec 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "require-dev": { "mockery/mockery": "^1.4", "orchestra/testbench": "^7.0|^8.0", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index 274de426c..da82a2d91 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d2d2ce071f276e4634a3f240968c60a", + "content-hash": "5b0778fedb05f0a13827c82f43d3cfba", "packages": [ { "name": "brick/math", @@ -651,16 +651,16 @@ }, { "name": "laravel/framework", - "version": "v10.3.2", + "version": "v10.3.3", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9e1f11aeae5a5dd7f4870b0c4cfdcc62c7ee811f" + "reference": "90f24d9e2860ecf6b5492e966956270ceb98c03d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9e1f11aeae5a5dd7f4870b0c4cfdcc62c7ee811f", - "reference": "9e1f11aeae5a5dd7f4870b0c4cfdcc62c7ee811f", + "url": "https://api.github.com/repos/laravel/framework/zipball/90f24d9e2860ecf6b5492e966956270ceb98c03d", + "reference": "90f24d9e2860ecf6b5492e966956270ceb98c03d", "shasum": "" }, "require": { @@ -847,7 +847,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-03-08T15:48:36+00:00" + "time": "2023-03-09T14:00:53+00:00" }, { "name": "laravel/serializable-closure", @@ -4749,16 +4749,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.3", + "version": "2.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "67c26b443f348a51926030c83481b85718457d3d" + "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", - "reference": "67c26b443f348a51926030c83481b85718457d3d", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", + "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", "shasum": "" }, "require": { @@ -4848,7 +4848,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.3" + "source": "https://github.com/guzzle/psr7/tree/2.4.4" }, "funding": [ { @@ -4864,7 +4864,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T14:07:24+00:00" + "time": "2023-03-09T13:19:02+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -5106,24 +5106,24 @@ }, { "name": "orchestra/testbench", - "version": "v8.0.6", + "version": "v8.0.7", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "1e51c5634a4c82482c51eda1437f0412d0c067a6" + "reference": "c1274e74e4d2a4daf05ffc67dfa17e2edbcb0eab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/1e51c5634a4c82482c51eda1437f0412d0c067a6", - "reference": "1e51c5634a4c82482c51eda1437f0412d0c067a6", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/c1274e74e4d2a4daf05ffc67dfa17e2edbcb0eab", + "reference": "c1274e74e4d2a4daf05ffc67dfa17e2edbcb0eab", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "fakerphp/faker": "^1.21", - "laravel/framework": ">=10.1.5 <10.4.0", + "laravel/framework": ">=10.3.1 <10.4.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": ">=8.0.2 <8.1.0", + "orchestra/testbench-core": ">=8.0.4 <8.1.0", "php": "^8.1", "phpunit/phpunit": "^9.6 || ^10.0.7", "spatie/laravel-ray": "^1.32", @@ -5155,22 +5155,22 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.0.6" + "source": "https://github.com/orchestral/testbench/tree/v8.0.7" }, - "time": "2023-03-03T03:17:05+00:00" + "time": "2023-03-09T04:11:07+00:00" }, { "name": "orchestra/testbench-core", - "version": "v8.0.3", + "version": "v8.0.4", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "516f1eaa468f447715eee503e59531181ab9552c" + "reference": "7ca8d678ff5c4aab40af0e72b2592b540602ab5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/516f1eaa468f447715eee503e59531181ab9552c", - "reference": "516f1eaa468f447715eee503e59531181ab9552c", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/7ca8d678ff5c4aab40af0e72b2592b540602ab5c", + "reference": "7ca8d678ff5c4aab40af0e72b2592b540602ab5c", "shasum": "" }, "require": { @@ -5179,11 +5179,11 @@ }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^10.1.4", + "laravel/framework": "^10.3.1", "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", "orchestra/canvas": "^8.0", - "phpstan/phpstan": "^1.10.1", + "phpstan/phpstan": "^1.10.5", "phpunit/phpunit": "^9.6 || ^10.0.7", "spatie/laravel-ray": "^1.32", "symfony/process": "^6.2", @@ -5193,7 +5193,7 @@ "suggest": { "brianium/paratest": "Allow using parallel tresting (^6.4 || ^7.0).", "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^10.1.4).", + "laravel/framework": "Required for testing (^10.3.1).", "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.4 || ^7.0).", "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^8.0).", @@ -5244,7 +5244,7 @@ "issues": "https://github.com/orchestral/testbench/issues", "source": "https://github.com/orchestral/testbench-core" }, - "time": "2023-02-24T00:36:23+00:00" + "time": "2023-03-09T03:53:39+00:00" }, { "name": "phar-io/manifest", @@ -5357,6 +5357,65 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.10.5", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1fb6f494d82455151ecf15c5c191923f5d84324e", + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.10.5" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2023-03-07T16:48:45+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.26", @@ -5677,16 +5736,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.4", + "version": "9.6.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d" + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9125ee085b6d95e78277dc07aa1f46f9e0607b8d", - "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", "shasum": "" }, "require": { @@ -5719,8 +5778,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -5759,7 +5818,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" }, "funding": [ { @@ -5775,7 +5834,7 @@ "type": "tidelift" } ], - "time": "2023-02-27T13:06:37+00:00" + "time": "2023-03-09T06:34:10+00:00" }, { "name": "pimple/pimple", diff --git a/package.json b/package.json index 95587bc69..19a107587 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { "private": true, "scripts": { - "dev": "mix", - "prod": "mix --production", + "dev": "npm run development", + "development": "mix", "watch": "mix watch", + "watch-poll": "mix watch -- --watch-options-poll=1000", + "hot": "mix watch --hot", + "prod": "npm run production", + "production": "mix --production", "format": "prettier --write resources \"**/*.{css,scss,js,json,vue}\"", "lint": "eslint --ext .js,.vue --fix resources/js" }, diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 000000000..159c2ae91 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,12 @@ +parameters: + paths: + - config + - database + - src + - routes + - lang + + level: 0 + + ignoreErrors: + - "#Unsafe usage of new static\\(\\)#"