mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-30 04:39:01 +01:00
commit
797789d23b
8
.github/workflows/test-laravel.yml
vendored
8
.github/workflows/test-laravel.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Run Tests
|
||||
name: Test laravel projects
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -16,6 +16,10 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Test
|
||||
- name: Test Laravel
|
||||
run: |
|
||||
./tests/laravel-test.sh
|
||||
|
||||
- name: Test Lumen
|
||||
run: |
|
||||
./tests/lumen-test.sh
|
||||
|
31
tests/lumen-test-baseline.xml
Normal file
31
tests/lumen-test-baseline.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<files psalm-version="dev-master@02e8313c398b9c6cb6ded9210e5ef53ecd7a2dab">
|
||||
<file src="app/Console/Kernel.php">
|
||||
<PropertyNotSetInConstructor occurrences="1">
|
||||
<code>Kernel</code>
|
||||
</PropertyNotSetInConstructor>
|
||||
</file>
|
||||
<file src="app/Exceptions/Handler.php">
|
||||
<LessSpecificReturnStatement occurrences="1">
|
||||
<code>parent::render($request, $exception)</code>
|
||||
</LessSpecificReturnStatement>
|
||||
<MoreSpecificReturnType occurrences="1">
|
||||
<code>\Illuminate\Http\Response|\Illuminate\Http\JsonResponse</code>
|
||||
</MoreSpecificReturnType>
|
||||
</file>
|
||||
<file src="app/Jobs/ExampleJob.php">
|
||||
<PropertyNotSetInConstructor occurrences="1">
|
||||
<code>ExampleJob</code>
|
||||
</PropertyNotSetInConstructor>
|
||||
</file>
|
||||
<file src="app/Providers/AuthServiceProvider.php">
|
||||
<MissingClosureParamType occurrences="1">
|
||||
<code>$request</code>
|
||||
</MissingClosureParamType>
|
||||
<MixedMethodCall occurrences="3">
|
||||
<code>viaRequest</code>
|
||||
<code>input</code>
|
||||
<code>input</code>
|
||||
</MixedMethodCall>
|
||||
</file>
|
||||
</files>
|
18
tests/lumen-test-psalm.xml
Normal file
18
tests/lumen-test-psalm.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<psalm
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
errorLevel="1"
|
||||
resolveFromConfigFile="false"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
errorBaseline="../psalm-plugin-laravel/tests/lumen-test-baseline.xml"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="app"/>
|
||||
<ignoreFiles>
|
||||
<directory name="vendor"/>
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
<plugins>
|
||||
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
|
||||
</plugins>
|
||||
</psalm>
|
17
tests/lumen-test.sh
Executable file
17
tests/lumen-test.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Cleaning Up"
|
||||
rm -rf ../lumen/
|
||||
|
||||
echo "Installing Lumen"
|
||||
composer create-project --quiet --prefer-dist "laravel/lumen" ../lumen
|
||||
cd ../lumen/
|
||||
|
||||
echo "Adding package from source"
|
||||
sed -e 's|"type": "project",|&"repositories": [ { "type": "path", "url": "../psalm-plugin-laravel" } ],|' -i composer.json
|
||||
COMPOSER_MEMORY_LIMIT=-1 composer require --dev "psalm/plugin-laravel:*"
|
||||
|
||||
echo "Analyzing Lumen"
|
||||
./vendor/bin/psalm -c ../psalm-plugin-laravel/tests/lumen-test-psalm.xml
|
Loading…
Reference in New Issue
Block a user