Skip to content

Feature/Add PHPStan. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

on:
push:
branches: [ 'main' ]
pull_request:
types: [ 'opened', 'synchronize', 'reopened' ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]

steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer:v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php-${{ matrix.php-version }}-composer-

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Execute Static Code analysis
run: composer analyse
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
"require": {
"php": "^8.1"
},
"require-dev": {
"phpstan/phpstan": "^1.0",
"phpstan/extension-installer": "^1.3"
},
"autoload": {
"psr-4": {
"ComplexHeart\\": "src/"
}
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse src --no-progress --level=9"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
2 changes: 1 addition & 1 deletion src/Domain/Contracts/Model/ValueObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ValueObject
/**
* Return the attribute values.
*
* @return array
* @return array<string, mixed>
*/
public function values(): array;

Expand Down