Skip to content

Commit ad16a01

Browse files
committed
Initial commit
0 parents  commit ad16a01

File tree

10 files changed

+251
-0
lines changed

10 files changed

+251
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
charset = utf-8
7+
end_of_line = LF
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{php,json}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.md]
16+
max_line_length = 80
17+
18+
[COMMIT_EDITMSG]
19+
max_line_length = 0

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.git* export-ignore
2+
/phpunit.dist.xml export-ignore
3+
/tests export-ignore
4+
/.editorconfig export-ignore
5+
/phpunit.dist.xml

.github/workflows/ci.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
types: [ opened, synchronize, reopened, ready_for_review ]
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
coding_style:
20+
name: Code Style
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 8.2
29+
tools: symfony-cli
30+
31+
- name: Install Composer dependencies
32+
run: symfony composer install --prefer-dist --no-interaction --no-progress
33+
34+
- name: Check Coding Style
35+
run: symfony composer run cs
36+
37+
phpstan:
38+
name: PHPStan Analysis
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install PHP
44+
uses: shivammathur/setup-php@v2
45+
with:
46+
php-version: 8.2
47+
tools: symfony-cli
48+
49+
- name: Install Composer dependencies
50+
run: symfony composer install --prefer-dist --no-interaction --no-progress
51+
52+
- name: Run PHPStan
53+
run: symfony composer run phpstan
54+
55+
tests:
56+
name: Tests
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
php: [ '8.2', '8.3', '8.4', '8.5' ]
61+
composer-dependency-version: ['']
62+
composer-minimum-stability: ['stable']
63+
include:
64+
# Lowest dependencies on minimum supported PHP version
65+
- php: '8.2'
66+
composer-dependency-version: 'lowest'
67+
68+
# Highest dev dependencies
69+
- php: '8.5'
70+
composer-minimum-stability: 'dev'
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Install PHP
75+
uses: shivammathur/setup-php@v2
76+
with:
77+
php-version: 8.2
78+
tools: symfony-cli
79+
80+
81+
- name: Configure Composer minimum-stability
82+
if: matrix.composer-minimum-stability
83+
run: symfony composer config minimum-stability ${{ matrix.composer-minimum-stability }}
84+
85+
- name: Install Composer dependencies
86+
run: symfony composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer-dependency-version == 'lowest' && '--prefer-lowest' || '' }}
87+
88+
- name: Run PHPUnit tests
89+
run: symfony composer run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor/
2+
composer.lock
3+
/.phpunit.cache

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Hugo Alliaume
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PHPStan for Symfony UX
2+
3+
A set of PHPStan rules to improve static analysis for Symfony UX applications.
4+
5+
## Installation
6+
7+
To install the PHPStan rules for Symfony UX, you can use Composer:
8+
9+
```bash
10+
composer require --dev kocal/phpstan-symfony-ux
11+
```
12+
13+
## Configuration
14+
15+
TODO

composer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "kocal/phpstan-symfony-ux",
3+
"description": "PHPStan rules for Symfony UX",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Hugo Alliaume",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"scripts": {
13+
"phpstan": "vendor/bin/phpstan analyze",
14+
"test": "vendor/bin/phpunit",
15+
"cs": "vendor/bin/ecs check",
16+
"cs-fix": "vendor/bin/ecs check --fix"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"Kocal\\PHPStanSymfonyUX\\": "src/"
21+
}
22+
},
23+
"autoload-dev": {
24+
"psr-4": {
25+
"Kocal\\PHPStanSymfonyUX\\Tests\\": "tests/"
26+
}
27+
},
28+
"require": {
29+
"php": ">=8.2",
30+
"phpstan/phpstan": "^2.1.13"
31+
},
32+
"require-dev": {
33+
"phpunit/phpunit": "^11.0",
34+
"symfony/ux-twig-component": "^2.0",
35+
"symplify/easy-coding-standard": "^13.0"
36+
},
37+
"config": {
38+
"sort-packages": true
39+
},
40+
"minimum-stability": "dev",
41+
"prefer-stable": true
42+
}

ecs.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
6+
7+
return ECSConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
->withRootFiles()
13+
->withPreparedSets(psr12: true, common: true)
14+
;

phpstan.dist.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: max
3+
4+
paths:
5+
- src
6+
- tests

phpunit.dist.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
failOnDeprecation="true"
8+
failOnNotice="true"
9+
failOnWarning="true"
10+
bootstrap="vendor/autoload.php"
11+
cacheDirectory=".phpunit.cache"
12+
>
13+
<php>
14+
<ini name="display_errors" value="1" />
15+
<ini name="error_reporting" value="-1" />
16+
</php>
17+
18+
<testsuites>
19+
<testsuite name="Project Test Suite">
20+
<directory>tests</directory>
21+
</testsuite>
22+
</testsuites>
23+
24+
<source ignoreSuppressionOfDeprecations="true"
25+
ignoreIndirectDeprecations="true"
26+
restrictNotices="true"
27+
restrictWarnings="true"
28+
>
29+
<include>
30+
<directory>src</directory>
31+
</include>
32+
33+
<deprecationTrigger>
34+
<function>trigger_deprecation</function>
35+
</deprecationTrigger>
36+
</source>
37+
</phpunit>

0 commit comments

Comments
 (0)