Skip to content

Commit a75a949

Browse files
authored
Merge pull request #16 from benjaminmal/feature/switch-to-library-only
Switch to library only
2 parents b06302a + b3992fc commit a75a949

File tree

9 files changed

+35
-2663
lines changed

9 files changed

+35
-2663
lines changed

.editorconfig

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,23 @@ charset = utf-8
1515
trim_trailing_whitespace = true
1616
insert_final_newline = true
1717

18-
[*.feature]
19-
indent_style = space
20-
indent_size = 4
21-
2218
[*.js]
23-
indent_style = space
2419
indent_size = 2
2520

2621
[*.json]
27-
indent_style = space
2822
indent_size = 2
2923

3024
[*.md]
31-
indent_style = space
32-
indent_size = 4
3325
trim_trailing_whitespace = false
3426

3527
[*.neon]
36-
indent_style = space
37-
indent_size = 4
38-
39-
[*.php]
40-
indent_style = space
41-
indent_size = 4
42-
43-
[*.sh]
44-
indent_style = space
45-
indent_size = 4
28+
indent_size = 2
4629

47-
[*.{yaml,yml}{,.dist}]
48-
indent_style = space
30+
[*.{yaml,yml}]
4931
indent_size = 2
50-
trim_trailing_whitespace = false
5132

5233
[.babelrc]
53-
indent_style = space
5434
indent_size = 2
5535

56-
[.gitmodules]
57-
indent_style = tab
58-
indent_size = 4
59-
60-
[.php_cs{,.dist}]
61-
indent_style = space
62-
indent_size = 4
63-
6436
[composer.json]
65-
indent_style = space
66-
indent_size = 4
67-
68-
[package.json]
69-
indent_style = space
70-
indent_size = 2
71-
72-
[phpspec.yml{,.dist}]
73-
indent_style = space
74-
indent_size = 4
75-
76-
[phpstan{,-ci}.neon]
77-
indent_style = space
78-
indent_size = 2
79-
80-
[phpunit.xml{,.dist}]
81-
indent_style = space
82-
indent_size = 4
37+
indent_size = 4

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php: [7.4, 8.0, 8.1]
18+
php: [8.0, 8.1]
1919

2020
name: '🚧 Build application 🚧 | PHP ${{ matrix.php }}'
2121

@@ -42,7 +42,7 @@ jobs:
4242
uses: actions/cache@v2
4343
with:
4444
path: '${{ steps.composer-cache.outputs.dir }}'
45-
key: "${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}"
45+
key: "${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}"
4646
restore-keys: |
4747
${{ runner.os }}-php-${{ matrix.php }}-composer-
4848
@@ -51,7 +51,7 @@ jobs:
5151

5252
# --- 🛠 Test 🛠 ----------
5353

54-
- name: 'Validate composer.json and composer.lock'
54+
- name: 'Validate composer.json'
5555
run: 'composer validate --strict --no-interaction --ansi --verbose'
5656

5757
- name: 'Check for dump in code'
@@ -61,7 +61,7 @@ jobs:
6161
run: 'vendor/bin/phpstan analyse --configuration=phpstan-ci.neon --error-format=github --no-progress --no-interaction --ansi'
6262

6363
- name: 'ECS check'
64-
run: 'vendor/bin/ecs check src --no-progress-bar --no-interaction --ansi'
64+
run: 'vendor/bin/ecs check lib ecs.php --no-progress-bar --no-interaction --ansi'
6565

6666
- name: 'PHPUnit tests'
6767
run: 'vendor/bin/phpunit --verbose --coverage-clover ./coverage.xml --coverage-text --colors=always --fail-on-incomplete --fail-on-risky --no-interaction --do-not-cache-result'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,9 @@ Temporary Items
7474
/.phpunit.result.cache
7575
/phpunit.xml
7676

77+
# Third party
7778
/vendor/
7879
/node_modules/
80+
81+
# Composer
82+
composer.lock

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<h1 align="center">Project template</h1>
1+
<h1 align="center">Library template</h1>
22

33
Installation & usage
44
--------------------
5-
1. Create your project
5+
1. Create your library
66
```bash
7-
$ composer create-project elodgy/project-template my-project
7+
$ composer create-project elodgy/library-template my-library
88
```
99

10-
2. Modify composer.json to fit with your project
10+
2. Modify composer.json to fit with your library
1111

1212
```json
1313
{
14-
"name": "elodgy/my-project",
15-
"description": "My project",
14+
"name": "elodgy/my-library",
15+
"description": "My library",
1616
"type": "library",
1717
"autoload": {
18-
"Elodgy\\MyProject\\": "src/"
18+
"Elodgy\\MyLibrary\\": "lib/"
1919
},
2020
"autoload-dev": {
21-
"Elodgy\\MyProject\\Tests\\": "tests/"
21+
"Elodgy\\MyLibrary\\Tests\\": "tests/"
2222
}
2323
}
2424
```

composer.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "elodgy/project-template",
3-
"description": "E-Lodgy project template",
4-
"type": "project",
2+
"name": "elodgy/library-template",
3+
"description": "E-Lodgy library template",
4+
"type": "library",
55
"license": "MIT",
66
"authors": [
77
{
@@ -10,30 +10,36 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.4 || ^8.0"
13+
"php": "^8.0"
1414
},
1515
"require-dev": {
1616
"elodgy/coding-standard": "^1.0",
1717
"phpstan/phpstan": "^1.2",
1818
"phpstan/extension-installer": "^1.1",
19-
"symfony/var-dumper": "^5.3 || ^6.0",
19+
"symfony/var-dumper": "^5.4 || ^6.0",
2020
"phpunit/phpunit": "^9.5",
2121
"phpstan/phpstan-phpunit": "^1.0",
2222
"php-parallel-lint/php-var-dump-check": "^0.5.0"
2323
},
2424
"autoload": {
2525
"psr-4": {
26-
"Elodgy\\Project\\": "src/"
26+
"Elodgy\\Library\\": "lib/"
2727
}
2828
},
2929
"autoload-dev": {
3030
"psr-4": {
31-
"Elodgy\\Project\\Tests\\": "tests/"
31+
"Elodgy\\Library\\Tests\\": "tests/"
3232
}
3333
},
3434
"scripts": {
3535
"post-create-project-cmd": [
3636
"mv .gitattributes.disable .gitattributes"
3737
]
38+
},
39+
"config": {
40+
"allow-plugins": {
41+
"phpstan/extension-installer": true,
42+
"symfony/flex": true
43+
}
3844
}
3945
}

0 commit comments

Comments
 (0)