Skip to content

Commit

Permalink
2.2.0 (#4)
Browse files Browse the repository at this point in the history
* Added PHP 8.1 support
* Added Laravel 9 support
* Dropped PHP 7.4 and Laravel 6 support
  • Loading branch information
Okipa authored Jul 21, 2022
1 parent 7844bac commit 1ce5241
Show file tree
Hide file tree
Showing 30 changed files with 248 additions and 261 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/phpcs.xml export-ignore
/phpmd.xml export-ignore
/phpstan.neon.dist export-ignore
Expand Down
55 changes: 55 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

**Happy coding**!
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
github: Okipa
ko_fi: arthurlorent
custom: https://paypal.me/arthurlorent
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/okipa/laravel-supervisor-downtime-notifier/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/okipa/laravel-supervisor-downtime-notifier/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a bug
url: https://github.com/okipa/laravel-supervisor-downtime-notifier/issues/new
about: Report a reproducable bug
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

If you discover any security related issues, please email [email protected] instead of using the issue tracker.
27 changes: 14 additions & 13 deletions .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['7.4', '8.0']
laravel: ['7.*', '8.*']
php: ['8.1', '8.0']
laravel: ['9.*', '8.*']
include:
- laravel: '9.*'
testbench: '7.*'
larastan: '2.*'
- laravel: '8.*'
testbench: '6.*'
- laravel: '7.*'
testbench: '5.*'
larastan: '2.*'

name: P${{ matrix.php }} - L${{ matrix.laravel }}

Expand Down Expand Up @@ -49,30 +51,29 @@ jobs:
# Lower PHP and laravel versions.

- name: PHPUnit
if: matrix.php != '8.0' || matrix.laravel != '8.*'
run: vendor/bin/phpunit
if: matrix.php != '8.1' || matrix.laravel != '9.*'
run: vendor/bin/testbench package:test --parallel --no-coverage

# Last PHP and laravel versions.

- name: Code analysis
if: matrix.php == '8.0' && matrix.laravel == '8.*'
if: matrix.php == '8.1' && matrix.laravel == '9.*'
run: |
vendor/bin/phpcs
vendor/bin/phpmd config,src text phpmd.xml
vendor/bin/phpmd config,src,tests text phpmd.xml
vendor/bin/phpstan analyse
- name: PHPUnit + Code coverage
if: matrix.php == '8.0' && matrix.laravel == '8.*'
if: matrix.php == '8.1' && matrix.laravel == '9.*'
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
vendor/bin/testbench package:test --parallel --coverage-text --coverage-clover build/logs/clover.xml
- name: Code coverage upload to Coveralls
if: matrix.php == '8.0' && matrix.laravel == '8.*'
if: matrix.php == '8.1' && matrix.laravel == '9.*'
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
echo ${GITHUB_REF##*/}
composer require php-coveralls/php-coveralls
composer require php-coveralls/php-coveralls --with-all-dependencies
vendor/bin/php-coveralls -v --coverage_clover=build/logs/clover.xml
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ build
composer.lock
vendor
coverage
tests/Support/temp
tests/temp
.phpunit.result.cache
.php-cs-fixer.cache
.phpunit.result.cache
.idea
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [2.2.0](https://github.com/Okipa/laravel-supervisor-downtime-notifier/compare/2.1.0...2.2.0)

2022-07-21

* Added PHP 8.1 support
* Added Laravel 9 support
* Dropped PHP 7.4 and Laravel 6 support

## [2.1.0](https://github.com/Okipa/laravel-supervisor-downtime-notifier/compare/2.0.0...2.1.0)

2020-11-11
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Laravel Supervisor Downtime Notifier](/docs/laravel-supervisor-downtime-notifier.png)
<p align="center">
<p style="text-align: center;">
<a href="https://github.com/Okipa/laravel-supervisor-downtime-notifier/releases" title="Latest Stable Version">
<img src="https://img.shields.io/github/release/Okipa/laravel-supervisor-downtime-notifier.svg?style=flat-square" alt="Latest Stable Version">
</a>
Expand Down Expand Up @@ -35,6 +35,11 @@ Found this package helpful? Please consider supporting my work!
| ^7.0 | ^7.4 | ^2.0 |
| ^6.0 | ^7.4 | ^1.0 |

| ^8.0 &#124; ^9.0 | ^8.0 &#124; ^8.1 | ^2.2 |
| ^7.0 &#124; ^8.0 | ^7.4 &#124; ^8.0 | ^2.1 |
| ^7.0 &#124; ^8.0 | ^7.4 | ^2.0 |
| ^6.0 &#124; ^7.0 | ^7.4 | ^1.0 |

## Upgrade guide

* [From v1 to V2](/docs/upgrade-guides/from-v1-to-v2.md)
Expand Down
31 changes: 16 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@
}
],
"require": {
"php": "^7.4||^8.0",
"illuminate/support": "^7.0||^8.0"
"php": "^8.0|^8.1",
"illuminate/contracts": "^8.0|^9.0"
},
"require-dev": {
"nunomaduro/larastan": "^0.6",
"orchestra/testbench": "^5.0||^6.0",
"phpmd/phpmd": "^2.8",
"squizlabs/php_codesniffer": "^3.5",
"laravel-notification-channels/webhook": "^2.0",
"laravel/slack-notification-channel": "^2.0"
"brianium/paratest": "^6.4",
"laravel-notification-channels/webhook": "^2.3",
"laravel/slack-notification-channel": "^2.4",
"nunomaduro/collision": "^5.10|^6.0",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.0|^7.0",
"phpmd/phpmd": "^2.11",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": {
Expand All @@ -50,13 +53,11 @@
}
},
"scripts": {
"test": [
"vendor/bin/phpcbf",
"vendor/bin/phpcs",
"vendor/bin/phpmd config,src text phpmd.xml",
"vendor/bin/phpstan analyse --memory-limit=-1 --error-format=table",
"vendor/bin/phpunit -d --memory-limit=-1 --testdox --coverage-text"
]
"phpcs": ["vendor/bin/phpcbf", "vendor/bin/phpcs"],
"phpmd": "vendor/bin/phpmd config,src,tests text phpmd.xml",
"phpstan": "vendor/bin/phpstan analyse --memory-limit=2G",
"phpunit" : "vendor/bin/testbench package:test --parallel --no-coverage",
"test": ["@phpcs", "@phpmd", "@phpstan", "@phpunit"]
},
"suggest": {
"guzzlehttp/guzzle": "Required for sending notifications via Slack",
Expand Down
18 changes: 15 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<?xml version="1.0"?>
<ruleset name="PSR12">
<description>PSR-12 validation</description>
<!-- Included directories -->
<file>./config</file>
<file>./src</file>
<file>./tests</file>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>./tests/*</exclude-pattern>
</rule>
<!-- Configuration -->
<arg name="colors"/>
<arg value="p"/>
<!-- Rules -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>./tests/*</exclude-pattern>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>./tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.LineLength">
<exclude-pattern>./config/*</exclude-pattern>
<exclude-pattern>./tests/*</exclude-pattern>
</rule>
<rule ref="PSR12"/>
</ruleset>
46 changes: 18 additions & 28 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Laravel and similar phpmd ruleset"
<ruleset name="Laravel and similar phpmd ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Written using this resource : https://phpmd.org/rules/index.html</description>
<!-- clean code rules -->
<!-- Clean code rules -->
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess"/>
<exclude name="ElseExpression"/>
<exclude name="BooleanArgumentFlag"/>
</rule>
<!-- code size rules -->
<!-- Code size rules -->
<rule ref="rulesets/codesize.xml">
<exclude name="TooManyPublicMethods"/>
<exclude name="TooManyMethods"/>
<exclude name="ExcessiveClassComplexity"/>
<exclude name="CyclomaticComplexity" pattern="tests/*"/>
<exclude name="TooManyPublicMethods" pattern="tests/*"/>
<exclude name="TooManyMethods" pattern="tests/*"/>
<exclude name="ExcessiveMethodLength" pattern="tests/*"/>
</rule>
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
<properties>
<property name="maxmethods" value="20"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="30"/>
</properties>
<!-- Controversial rules -->
<rule ref="rulesets/controversial.xml">
<exclude name="CamelCaseMethodName" pattern="tests/*"/>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<properties>
<property name="maximum" value="60"/>
</properties>
</rule>
<!-- controversial rules -->
<rule ref="rulesets/controversial.xml"/>
<!-- design rules -->
<!-- Design rules -->
<rule ref="rulesets/design.xml">
<exclude name="CouplingBetweenObjects"/>
<exclude name="NumberOfChildren"/>
</rule>
<!-- naming rules -->
<!-- Naming rules -->
<rule ref="rulesets/naming.xml">
<exclude name="LongClassName"/>
<exclude name="ShortVariable"/>
Expand All @@ -55,14 +43,16 @@
<priority>3</priority>
<properties>
<property name="minimum" description="Minimum length for a variable, property or parameter name" value="3"/>
<property name="exceptions" value="id,js,uu,ii,oo"/>
<property name="exceptions" value="id,js,uu,ii,oo,e"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
<properties>
<property name="exceptions" value="up,to,at"/>
</properties>
</rule>
<!-- unused code rules -->
<rule ref="rulesets/unusedcode.xml"/>
<!-- Unused code rules -->
<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter" pattern="tests/*"/>
</rule>
</ruleset>
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parameters:
paths:
- config
- src
- tests

# The level 8 is the highest level
level: 5
Expand Down
Loading

0 comments on commit 1ce5241

Please sign in to comment.