Skip to content

Commit 515b09a

Browse files
committed
Initial commit
0 parents  commit 515b09a

24 files changed

+581
-0
lines changed

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* text=auto
2+
3+
/.github
4+
/art export-ignore
5+
/docs export-ignore
6+
/stubs export-ignore
7+
/**/*Test.php export-ignore
8+
/**/*TestCase.php export-ignore
9+
/**/Fake*.php export-ignore
10+
/.gitattributes export-ignore
11+
/.gitignore export-ignore
12+
/.php_cs.dist export-ignore
13+
/phpstan.neon.dist export-ignore
14+
/phpunit.xml.dist export-ignore
15+
/README.md export-ignore
16+
/CHANGELOG.md export-ignore
17+
/CONTRIBUTING.md export-ignore

.github/workflows/code-style.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Code style
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
with:
12+
ref: ${{ github.head_ref }}
13+
14+
- name: Run PHP CS fixer
15+
uses: docker://oskarstark/php-cs-fixer-ga
16+
with:
17+
args: --config=.php_cs.dist --allow-risky=yes
18+
19+
- name: Commit changes
20+
uses: stefanzweifel/git-auto-commit-action@v4
21+
with:
22+
commit_message: Fix code style violations
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Quality assurance
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest]
12+
php: [8.0, 7.4]
13+
laravel: [8.*, 7.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
include:
16+
- laravel: 8.*
17+
testbench: 6.*
18+
- laravel: 7.*
19+
testbench: 5.*
20+
name: PHP ${{ matrix.php }} with Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
30+
coverage: xdebug
31+
32+
- name: Install dependencies
33+
run: |
34+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
35+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
36+
37+
- name: Run tests
38+
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover
39+
40+
- name: Run tests & publish code coverage
41+
uses: paambaati/[email protected]
42+
env:
43+
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}
44+
with:
45+
coverageCommand: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover
46+
coverageLocations: |
47+
${{github.workspace}}/*.clover:clover
48+
debug: true
49+
50+
- name: Run PHPStan analysis
51+
run: vendor/bin/phpstan analyse --memory-limit=-1
52+
if: ${{ matrix.php == '7.4' }}

.gitignore

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

.php_cs.dist

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/config',
7+
])
8+
->name('*.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return PhpCsFixer\Config::create()
13+
->setRules([
14+
'@PSR2' => true,
15+
'array_syntax' => ['syntax' => 'short'],
16+
'ordered_imports' => [
17+
'imports_order' => ['class', 'function', 'const'],
18+
'sortAlgorithm' => 'alpha',
19+
],
20+
'no_unused_imports' => true,
21+
'not_operator_with_successor_space' => true,
22+
'trailing_comma_in_multiline_array' => true,
23+
'phpdoc_scalar' => true,
24+
'unary_operator_spaces' => true,
25+
'binary_operator_spaces' => true,
26+
'blank_line_before_statement' => [
27+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
28+
],
29+
'phpdoc_single_line_var_spacing' => true,
30+
'phpdoc_var_without_name' => true,
31+
'class_attributes_separation' => [
32+
'elements' => [
33+
'method',
34+
],
35+
],
36+
'method_argument_space' => [
37+
'on_multiline' => 'ensure_fully_multiline',
38+
'keep_multiple_spaces_after_comma' => true,
39+
],
40+
'void_return' => true,
41+
])
42+
->setFinder($finder);

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changelog
2+
===
3+
4+
All notable changes to this project will be documented in this file.
5+
6+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [Unreleased]

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Contributing
2+
===
3+
4+
Contributions are welcome. If you want to ask or propose something, please
5+
[create an issue](https://github.com/craftzing/:package_name/issues/new). If you want to contribute, please
6+
send in a pull request.
7+
8+
## ⤴️ Pull requests
9+
10+
Make sure to follow these rules when creating a pull request:
11+
- Follow the [PSR-12](http://www.php-fig.org/psr/psr-12/) coding standards (though we have a PHP CS Fixer workflow in place that takes care of that for you)
12+
- Write tests for new functionality or bug fixes and make sure test coverage is on point
13+
- Keep the [README](README.md) file and [docs](docs) up-to-date with changes
14+
- We follow [Semantic Versioning](http://semver.org/), so please send pull requests to the correct branch
15+
- Update the [CHANGELOG.md](CHANGELOG.md) file with any changes/additions/... and follow the [changelog standards](http://keepachangelog.com/)
16+
17+
## 🧪 Running tests
18+
19+
You can run the test suite with the following command:
20+
```bash
21+
vendor/bin/phpunit
22+
```

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) 2020 Craftzing
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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[![Laravel Lokalise webhooks](art/banner.jpg)](https://craftzing.com)
2+
3+
![Quality assurance](https://github.com/craftzing/:package_name/workflows/Quality%20assurance/badge.svg)
4+
![Code style](https://github.com/craftzing/:package_name/workflows/Code%20style/badge.svg)
5+
[![Test Coverage](https://api.codeclimate.com/v1/badges/881eb71372c1b12c18d5/test_coverage)](https://codeclimate.com/github/craftzing/:package_name/test_coverage)
6+
[![Maintainability](https://api.codeclimate.com/v1/badges/881eb71372c1b12c18d5/maintainability)](https://codeclimate.com/github/craftzing/:package_name/maintainability)
7+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat&color=4D6CB8)](https://github.com/craftzing/:package_name/blob/master/LICENSE)
8+
9+
This package serves as a starting point to create a new Laravel package. Everything's in place to get you started
10+
quickly:
11+
- Documentation outline
12+
- Basic workflows
13+
- Basic config files
14+
- Laravel-specific code starters
15+
- ...
16+
17+
Perform a "search and replace" action for the following placeholders and update them with an according value:
18+
- `:package_name`: Please make sure to use lowercase and dashes as a separator (e.g. `my-package`)
19+
- `:package_namespace`: Not that the default namespace is already set to be `Craftzing\Laravel` (e.g. `MyPackage`)
20+
- `:package_description`
21+
- `:author_name`
22+
- `:author_email`
23+
24+
Replace the banner at the top of this file with one for this package.
25+
26+
Then, replace this section with a short description about what the package does. You can add a short code-snippet if
27+
you want. From then on, you can start implementing some code, write the docs, ...
28+
29+
## 🔥 Features
30+
31+
- **Short feature title.** Short feature description. Make it sound zazzy!
32+
33+
## 📚 Docs
34+
35+
- [Getting started](/docs/getting-started.md)
36+
- [Usage](/docs/usage.md)
37+
38+
## 📝 Changelog
39+
40+
Check out our [Change log](/CHANGELOG.md).
41+
42+
## 🤝 How to contribute
43+
44+
Have an idea for a feature? Wanna improve the docs? Found a bug? Check out our [Contributing guide](/CONTRIBUTING.md).
45+
46+
## 💙 Thanks to...
47+
48+
- [The entire Craftzing team](https://craftzing.com)
49+
- [All current and future contributors](https://github.com/creaftzing/:package_name/graphs/contributors)
50+
51+
## 🔑 License
52+
53+
The MIT License (MIT). Please see [License File](/LICENSE) for more information.

art/banner.jpg

301 KB
Loading

0 commit comments

Comments
 (0)