Skip to content
Snippets Groups Projects
Commit b56d5e8b authored by abenettt's avatar abenettt
Browse files

Add phpstan/larastan

parent 38b9c532
Branches
Tags
No related merge requests found
name: Psalm
name: PHPStan
on:
push:
paths:
- '**.php'
- 'psalm.xml.dist'
- 'phpstan.neon.dist'
jobs:
psalm:
name: psalm
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
......@@ -17,17 +17,10 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Run composer install
run: composer install -n --prefer-dist
- name: Install composer dependencies
uses: ramsey/composer-install@v1
- name: Run psalm
run: ./vendor/bin/psalm --output-format=github
- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
......@@ -7,7 +7,7 @@ composer.lock
coverage
docs
phpunit.xml
psalm.xml
phpstan.neon
testbench.yaml
vendor
node_modules
......
......@@ -23,10 +23,13 @@
"require-dev": {
"brianium/paratest": "^6.2",
"nunomaduro/collision": "^5.3",
"nunomaduro/larastan": "^0.7.10",
"orchestra/testbench": "^6.15",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^0.12.6",
"phpstan/phpstan-phpunit": "^0.12.21",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.23",
"vimeo/psalm": "^4.8"
"spatie/laravel-ray": "^1.23"
},
"autoload": {
"psr-4": {
......@@ -40,7 +43,7 @@
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"phpstan": "vendor/bin/phpstan analyse",
"test": "./vendor/bin/testbench package:test --parallel --no-coverage",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
......
includes:
- phpstan-baseline.neon
parameters:
level: 4
paths:
- src
- config
- database
- tests
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false
<?xml version="1.0"?>
<psalm
errorLevel="4"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
......@@ -10,8 +10,10 @@ class SkeletonCommand extends Command
public $description = 'My command';
public function handle()
public function handle(): int
{
$this->comment('All done');
return self::SUCCESS;
}
}
......@@ -5,7 +5,7 @@ namespace VendorName\Skeleton\Tests;
class ExampleTest extends TestCase
{
/** @test */
public function true_is_true()
public function true_is_true(): void
{
$this->assertTrue(true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment