Skip to content

Commit

Permalink
Merge pull request #84 from ash-jc-allen/phpstan
Browse files Browse the repository at this point in the history
Added nunomaduro/larastan
  • Loading branch information
ash-jc-allen authored Sep 21, 2021
2 parents 75a52f1 + 119f8dc commit 1d32773
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 31 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci-phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: run-phpstan

on:
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 7.3, 7.4, 8.0 ]
laravel: [ 8.*, 7.*, 6.* ]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*

name: PHP${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Update apt
run: sudo apt-get update --fix-missing

- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Run Larastan
run: vendor/bin/phpstan analyse
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.2"
"phpunit/phpunit": "^8.2",
"nunomaduro/larastan": "^0.7.12"
},
"autoload": {
"psr-4": {
Expand Down
13 changes: 13 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon

parameters:

paths:
- src

level: 6

ignoreErrors:

checkMissingIterableValueType: false
36 changes: 18 additions & 18 deletions src/Models/ShortURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
/**
* Class ShortURL.
*
* @property int id
* @property string destination_url
* @property string default_short_url
* @property string url_key
* @property bool single_use
* @property bool track_visits
* @property int redirect_status_code
* @property bool track_ip_address
* @property bool track_operating_system
* @property bool track_operating_system_version
* @property bool track_browser
* @property bool track_browser_version
* @property bool track_referer_url
* @property bool track_device_type
* @property Carbon activated_at
* @property Carbon deactivated_at
* @property Carbon created_at
* @property Carbon updated_at
* @property int $id
* @property string $destination_url
* @property string $default_short_url
* @property string $url_key
* @property bool $single_use
* @property bool $track_visits
* @property int $redirect_status_code
* @property bool $track_ip_address
* @property bool $track_operating_system
* @property bool $track_operating_system_version
* @property bool $track_browser
* @property bool $track_browser_version
* @property bool $track_referer_url
* @property bool $track_device_type
* @property Carbon $activated_at
* @property Carbon|null $deactivated_at
* @property Carbon $created_at
* @property Carbon $updated_at
*/
class ShortURL extends Model
{
Expand Down
24 changes: 12 additions & 12 deletions src/Models/ShortURLVisit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
/**
* Class ShortURLVisit.
*
* @property int id
* @property int short_url_id
* @property string ip_address
* @property string operating_system
* @property string operating_system_version
* @property string browser
* @property string browser_version
* @property string device_type
* @property Carbon visited_at
* @property Carbon referer_url
* @property Carbon created_at
* @property Carbon updated_at
* @property int $id
* @property int $short_url_id
* @property string $ip_address
* @property string $operating_system
* @property string $operating_system_version
* @property string $browser
* @property string $browser_version
* @property string $device_type
* @property Carbon $visited_at
* @property string $referer_url
* @property Carbon $created_at
* @property Carbon $updated_at
*/
class ShortURLVisit extends Model
{
Expand Down

0 comments on commit 1d32773

Please sign in to comment.