Skip to content

Commit c71fcb5

Browse files
committed
Initial commit
0 parents  commit c71fcb5

File tree

10 files changed

+195
-0
lines changed

10 files changed

+195
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = false
10+
11+
[*.{vue,js,scss}]
12+
charset = utf-8
13+
indent_style = space
14+
indent_size = 2
15+
end_of_line = lf
16+
insert_final_newline = true
17+
trim_trailing_whitespace = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto
2+
3+
/tests export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.scrutinizer.yml export-ignore
7+
.travis.yml export-ignore
8+
phpunit.php export-ignore
9+
phpunit.xml.dist export-ignore
10+
phpunit.xml export-ignore
11+
.php_cs export-ignore

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: []
2+
patreon: overtrue
3+
custom: https://www.easywechat.com/img/pay/wechat.jpg

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea
2+
*.DS_Store
3+
/vendor
4+
/coverage
5+
/hooks
6+
sftp-config.json
7+
composer.lock
8+
.subsplit
9+
.php_cs.cache

.php_cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setRules([
5+
'@PSR2' => true,
6+
'binary_operator_spaces' => true,
7+
'blank_line_after_opening_tag' => true,
8+
'compact_nullable_typehint' => true,
9+
'declare_equal_normalize' => true,
10+
'lowercase_cast' => true,
11+
'lowercase_static_reference' => true,
12+
'new_with_braces' => true,
13+
'no_unused_imports' => true,
14+
'no_blank_lines_after_class_opening' => true,
15+
'no_leading_import_slash' => true,
16+
'no_whitespace_in_blank_line' => true,
17+
'ordered_class_elements' => [
18+
'order' => [
19+
'use_trait',
20+
],
21+
],
22+
'ordered_imports' => [
23+
'imports_order' => [
24+
'class',
25+
'function',
26+
'const',
27+
],
28+
'sort_algorithm' => 'none',
29+
],
30+
'return_type_declaration' => true,
31+
'short_scalar_cast' => true,
32+
'single_blank_line_before_namespace' => true,
33+
'single_trait_insert_per_statement' => true,
34+
'ternary_operator_spaces' => true,
35+
'unary_operator_spaces' => true,
36+
'visibility_required' => [
37+
'elements' => [
38+
'const',
39+
'method',
40+
'property',
41+
],
42+
],
43+
])
44+
->setFinder(
45+
PhpCsFixer\Finder::create()
46+
->exclude('vendor')
47+
->in([__DIR__.'/src/', __DIR__.'/tests/'])
48+
)
49+
;

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h1 align="center">PHP Package Template </h1>
2+
3+
<p align="center"> A template repository for PHP package.</p>
4+
5+
6+
## Installing
7+
8+
```shell
9+
$ composer require vendor/package -vvv
10+
```
11+
12+
## Usage
13+
14+
TODO
15+
16+
## Contributing
17+
18+
You can contribute in one of three ways:
19+
20+
1. File bug reports using the [issue tracker](https://github.com/vendor/package/issues).
21+
2. Answer questions or fix bugs on the [issue tracker](https://github.com/vendor/package/issues).
22+
3. Contribute new features or update the wiki.
23+
24+
_The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._
25+
26+
## License
27+
28+
MIT

composer.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "overtrue/php-package",
3+
"description": "A PHP package template repository.",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "vendor",
8+
"email": "name@domain.com"
9+
}
10+
],
11+
"require": {},
12+
"require-dev": {
13+
"brainmaestro/composer-git-hooks": "^2.7",
14+
"friendsofphp/php-cs-fixer": "^2.15",
15+
"mockery/mockery": "^1.0",
16+
"phpunit/phpunit": "^9.0"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"Vendor\\Package\\": "src"
21+
}
22+
},
23+
"extra": {
24+
"hooks": {
25+
"pre-commit": [
26+
"composer test",
27+
"composer fix-style"
28+
],
29+
"pre-push": [
30+
"composer test",
31+
"composer check-style"
32+
]
33+
}
34+
},
35+
"scripts": {
36+
"post-update-cmd": [
37+
"cghooks update"
38+
],
39+
"post-merge": "composer install",
40+
"post-install-cmd": [
41+
"cghooks add --ignore-lock",
42+
"cghooks update"
43+
],
44+
"cghooks": "vendor/bin/cghooks",
45+
"check-style": "php-cs-fixer fix --using-cache=no --diff --config=.php_cs --dry-run --ansi",
46+
"fix-style": "php-cs-fixer fix --using-cache=no --config=.php_cs --ansi",
47+
"test": "vendor/bin/phpunit"
48+
},
49+
"scripts-descriptions": {
50+
"test": "Run all tests.",
51+
"check-style": "Run style checks (only dry run - no fixing!).",
52+
"fix-style": "Run style checks and fix violations."
53+
}
54+
}

phpunit.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false">
11+
<testsuites>
12+
<testsuite name="Application Test Suite">
13+
<directory>./tests/</directory>
14+
</testsuite>
15+
</testsuites>
16+
<filter>
17+
<whitelist>
18+
<directory suffix=".php">src/</directory>
19+
</whitelist>
20+
</filter>
21+
</phpunit>

src/.gitkeep

Whitespace-only changes.

tests/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)