Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarsn committed Jan 20, 2023
0 parents commit 801beb6
Show file tree
Hide file tree
Showing 106 changed files with 5,858 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug Report
about: Report a bug in a package.
title: ''
labels: bug
assignees: ''

---

### Description & Steps to reproduce

<!-- Describe what you're doing and what you expected package to do. -->

### Versions:
<!-- Please provide all the versions. -->

- PHP version: #.#.#
- Laravel version: #.#.#
- Package version: #.#.#
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/new-feature-or-enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: New Feature or Enhancement
about: Suggest an idea for this package.
title: ''
labels: enhancement
assignees: ''

---

### Description

<!-- Describe what solution you'd like to see. -->
64 changes: 64 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Static Analysis

on:
push:
pull_request:
workflow_dispatch:

jobs:
phpstan:
name: PHPStan Analysis
runs-on: ubuntu-latest
env:
COMPOSER_NO_INTERACTION: 1
steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- run: composer update --prefer-dist --no-progress

- run: composer phpstan -- --no-progress

style:
name: PHP-CS-Fixer Analysis
runs-on: ubuntu-latest
env:
COMPOSER_NO_INTERACTION: 1
steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- run: composer update --prefer-dist --no-progress

- run: composer lint

49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests

on:
push:
pull_request:
workflow_dispatch:

jobs:
tests:
strategy:
fail-fast: false
matrix:
php: [ 8.1, 8.2 ]
laravel: [ ^9.0 ]
name: PHP=${{ matrix.php }} LARAVEL=${{ matrix.laravel }}
runs-on: ubuntu-latest
env:
COMPOSER_NO_INTERACTION: 1
XDEBUG_MODE: coverage
steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- run: composer update --prefer-dist --no-progress

- name: Run tests
run: composer test -- --coverage-clover ./coverage.xml

- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
composer.lock
vendor/
.idea
.git
phpunit-coverage/
.phpunit.result.cache
.php-cs-fixer.cache
coverage.xml
28 changes: 28 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;

require __DIR__ . '/vendor/autoload.php';

return (new Config())
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
)
->setRules([
'line_ending' => false,
'concat_space' => [
'spacing' => 'one',
],
'cast_spaces' => [
'space' => 'none',
],
'not_operator_with_successor_space' => false,
'simplified_null_return' => false,
'explicit_string_variable' => true,
'phpdoc_to_comment' => false,
])
->setRiskyAllowed(true);
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2023 Edgars Neimanis

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.
Loading

0 comments on commit 801beb6

Please sign in to comment.