Skip to content

Commit f636bc2

Browse files
committed
Initial release
0 parents  commit f636bc2

File tree

10 files changed

+3926
-0
lines changed

10 files changed

+3926
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.github export-ignore
2+
.* export-ignore
3+
/captainhook.json export-ignore
4+
/composer.json
5+
/composer.lock export-ignore

.gitignore

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

.php-cs-fixer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Finder;
6+
use Ticketswap\PhpCsFixerConfig\ConfigFactory;
7+
8+
$finder = Finder::create()
9+
->in(__DIR__ . '/src')
10+
->append([__DIR__ . '/.php-cs-fixer.php']);
11+
12+
return ConfigFactory::create()->setFinder($finder);

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 TicketSwap
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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# TicketSwap PHP CS Fixer Config
2+
3+
TicketSwap code style rules for PHP CS Fixer.
4+
5+
## Installation
6+
7+
Install the package via Composer:
8+
9+
```bash
10+
composer require --dev ticketswap/php-cs-fixer-config
11+
```
12+
13+
## Configuration
14+
15+
Create a [`.php-cs-fixer.php`](.php-cs-fixer.php) file in the root of your project:
16+
17+
```php
18+
<?php
19+
20+
declare(strict_types=1);
21+
22+
use PhpCsFixer\Finder;
23+
use Ticketswap\PhpCsFixerConfig\ConfigFactory;
24+
25+
$finder = Finder::create()
26+
->in(__DIR__ . '/src')
27+
->in(__DIR__ . '/tests')
28+
->append([__DIR__ . '/.php-cs-fixer.php']);
29+
30+
return ConfigFactory::create()->setFinder($finder);
31+
```
32+
33+
Adjust the paths in the `Finder` to match your project structure.
34+
35+
## Usage
36+
37+
Run PHP CS Fixer to fix your code style:
38+
39+
```bash
40+
vendor/bin/php-cs-fixer fix
41+
```
42+
43+
To check for violations without fixing:
44+
45+
```bash
46+
vendor/bin/php-cs-fixer check --diff
47+
```

captainhook.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"commit-msg": {
3+
"enabled": true,
4+
"actions": []
5+
},
6+
"pre-commit": {
7+
"enabled": true,
8+
"actions": [
9+
{
10+
"action": "composer normalize --diff --dry-run"
11+
},
12+
{
13+
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
14+
},
15+
{
16+
"action": "vendor/bin/php-cs-fixer fix"
17+
}
18+
]
19+
}
20+
}

composer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "ticketswap/php-cs-fixer-config",
3+
"description": "TicketSwap code style rules for PHP CS Fixer",
4+
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"dev"
8+
],
9+
"require": {
10+
"php": "^8.4",
11+
"erickskrauch/php-cs-fixer-custom-fixers": "^1.3",
12+
"friendsofphp/php-cs-fixer": "^3.85",
13+
"symplify/coding-standard": "^12.4"
14+
},
15+
"require-dev": {
16+
"ergebnis/composer-normalize": "^2.47"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"Ticketswap\\PhpCsFixerConfig\\": "src/"
21+
}
22+
},
23+
"config": {
24+
"allow-plugins": {
25+
"ergebnis/composer-normalize": true
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)