generated from spiral-packages/package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 71d3137
Showing
20 changed files
with
731 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/.github export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/tests export-ignore | ||
/.editorconfig export-ignore | ||
/.php_cs.dist.php export-ignore | ||
/psalm.xml export-ignore | ||
/psalm.xml.dist export-ignore | ||
/UPGRADING.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- "dependencies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: run-tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: [ 8.0, 8.1 ] | ||
stability: [ prefer-lowest, prefer-stable ] | ||
|
||
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Validate Composer | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Restore Composer Cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer | ||
|
||
- name: Install Dependencies | ||
uses: nick-invision/retry@v1 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer update --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Execute tests | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: run-tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
static-analysis: | ||
name: Psalm | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.0 ] | ||
os: [ ubuntu-latest ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Validate Composer | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Restore Composer Cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer | ||
|
||
- name: Install Dependencies | ||
uses: nick-invision/retry@v1 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer update --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Static Analysis | ||
run: vendor/bin/psalm --no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Update Changelog" | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
|
||
- name: Update Changelog | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
latest-version: ${{ github.event.release.name }} | ||
release-notes: ${{ github.event.release.body }} | ||
|
||
- name: Commit updated CHANGELOG | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: Update CHANGELOG | ||
file_pattern: CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.idea | ||
.php_cs | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
build | ||
composer.lock | ||
coverage | ||
docs | ||
phpunit.xml | ||
vendor | ||
node_modules | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
preset: psr12 | ||
risky: true | ||
|
||
version: 8 | ||
|
||
enabled: | ||
- alpha_ordered_traits | ||
- array_indentation | ||
- array_push | ||
- combine_consecutive_issets | ||
- combine_consecutive_unsets | ||
- combine_nested_dirname | ||
- declare_strict_types | ||
- dir_constant | ||
- fully_qualified_strict_types | ||
- function_to_constant | ||
- is_null | ||
- magic_constant_casing | ||
- magic_method_casing | ||
- method_separation | ||
- modernize_types_casting | ||
- native_function_casing | ||
- native_function_type_declaration_casing | ||
- no_alias_functions | ||
- no_empty_comment | ||
- no_empty_phpdoc | ||
- no_empty_statement | ||
- no_extra_block_blank_lines | ||
- no_short_bool_cast | ||
- no_superfluous_elseif | ||
- no_unneeded_control_parentheses | ||
- no_unneeded_curly_braces | ||
- no_unneeded_final_method | ||
- no_unset_cast | ||
- no_unused_imports | ||
- no_unused_lambda_imports | ||
- no_useless_else | ||
- no_useless_return | ||
- normalize_index_brace | ||
- php_unit_dedicate_assert | ||
- php_unit_dedicate_assert_internal_type | ||
- php_unit_expectation | ||
- php_unit_mock | ||
- php_unit_mock_short_will_return | ||
- php_unit_namespaced | ||
- php_unit_no_expectation_annotation | ||
- phpdoc_no_empty_return | ||
- phpdoc_no_useless_inheritdoc | ||
- phpdoc_order | ||
- phpdoc_property | ||
- phpdoc_scalar | ||
- phpdoc_separation | ||
- phpdoc_singular_inheritdoc | ||
- phpdoc_trim | ||
- phpdoc_trim_consecutive_blank_line_separation | ||
- phpdoc_type_to_var | ||
- phpdoc_types | ||
- phpdoc_types_order | ||
- print_to_echo | ||
- regular_callable_call | ||
- return_assignment | ||
- self_accessor | ||
- self_static_accessor | ||
- set_type_to_cast | ||
- short_array_syntax | ||
- short_list_syntax | ||
- simplified_if_return | ||
- single_quote | ||
- standardize_not_equals | ||
- ternary_to_null_coalescing | ||
- trailing_comma_in_multiline_array | ||
- unalign_double_arrow | ||
- unalign_equals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
All notable changes to `:package_name` will be documented in this file. | ||
|
||
## 1.0.0 - 202X-XX-XX | ||
|
||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) :vendor_name <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# :package_description | ||
|
||
[](https://packagist.org/packages/:vendor_slug/:package_slug) | ||
[](https://packagist.org/packages/:vendor_slug/:package_slug) | ||
[](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain) | ||
[](https://packagist.org/packages/:vendor_slug/:package_slug) | ||
<!--delete--> | ||
--- | ||
This repo can be used to scaffold a Spiral Framework package. Follow these steps to get started: | ||
|
||
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton. | ||
2. Run `php ./configure.php` to run a script that will replace all placeholders throughout all the files. | ||
--- | ||
<!--/delete--> | ||
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. | ||
|
||
|
||
## Requirements | ||
|
||
Make sure that your server is configured with following PHP version and extensions: | ||
|
||
- PHP 8.0+ | ||
- Spiral framework 2.9+ | ||
|
||
|
||
|
||
## Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require :vendor_slug/:package_slug | ||
``` | ||
|
||
After package install you need to register bootloader from the package. | ||
|
||
```php | ||
protected const LOAD = [ | ||
// ... | ||
\VendorName\Skeleton\Bootloader\SkeletonBootloader::class, | ||
]; | ||
``` | ||
|
||
> Note: if you are using [`spiral-packages/discoverer`](https://github.com/spiral-packages/discoverer), | ||
> you don't need to register bootloader by yourself. | ||
## Testing | ||
|
||
```bash | ||
composer test | ||
``` | ||
|
||
## Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. | ||
|
||
## Security Vulnerabilities | ||
|
||
Please review [our security policy](../../security/policy) on how to report security vulnerabilities. | ||
|
||
## Credits | ||
|
||
- [:author_name](https://github.com/:author_username) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE) for more information. |
Oops, something went wrong.