Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) README - travis and scrutinizer badges are obsolete #46

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/coding-standards.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Code Coverage
name: Coveritup

on: [fork, pull_request, push, workflow_dispatch]
on: [fork, pull_request, push]

jobs:
code-coverage:
name: Code Coverage
Coveritup:
name: Coveritup

runs-on: ubuntu-latest

Expand All @@ -23,6 +23,7 @@ jobs:
extensions: intl
ini-values: memory_limit=-1
php-version: ${{ matrix.php-version }}
- run: curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh

- name: Determine composer cache directory
id: determine-composer-cache-directory
Expand All @@ -35,11 +36,27 @@ jobs:
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php-${{ matrix.php-version }}-composer-

- name: Install dependencies with composer
run: composer install --no-interaction --no-progress --no-suggest

- name: Create build directory
run: mkdir -p .build/logs
- uses: kevincobain2000/action-coveritup@v2
with:
type: composer-install-time
command: composer install --no-interaction --no-progress --no-suggest
record: runtime

- name: Collect code coverage with Xdebug and phpunit/phpunit
run: vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- uses: kevincobain2000/action-coveritup@v2
with:
type: coverage
command: ./cover-totalizer coverage.xml

- uses: kevincobain2000/action-coveritup@v2
with:
type: composer-dependencies
command: composer show -i --name-only 2>/dev/null | wc -l | awk '{print $NF}'

- name: "PHPCS"
run: vendor/bin/phpcs --ignore=views --standard=PSR2 src

- uses: kevincobain2000/action-coveritup@v2
with:
pr_comment: true
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
## Laravel Alert Notifications

<h1 align="center">
Laravel Alert Notifcations
</h1>
<p align="center">
Send php exceptions to email, microsoft teams, slack.
<br/>
Notifications are throttle enabled so devs don't get a lot of emails from one host
<br/>
(or all hosts if cache driver is shared).
</p>


<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<a href="https://travis-ci.org/kevincobain2000/laravel-alert-notifications"><img src="https://travis-ci.org/kevincobain2000/laravel-alert-notifications.svg?branch=master" alt="Travis Build Status"></a>
<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/quality-score.png?b=master" alt="Quality Score"></a>
<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/build.png?b=master" alt="Build Status"></a>
<a href="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications"><img src="https://scrutinizer-ci.com/g/kevincobain2000/laravel-alert-notifications/badges/coverage.png?b=master" alt="Coverage Status"></a>
![composer-install-time](https://coveritup.app/badge?org=kevincobain2000&repo=laravel-alert-notifications&type=composer-install-time&branch=master)
![coverage](https://coveritup.app/badge?org=kevincobain2000&repo=laravel-alert-notifications&type=coverage&branch=master)
![composer-dependencies](https://coveritup.app/badge?org=kevincobain2000&repo=laravel-alert-notifications&type=composer-dependencies&branch=master)

![composer-install-time](https://coveritup.app/chart?org=kevincobain2000&repo=laravel-alert-notifications&type=composer-install-time&output=svg&width=160&height=160&branch=master)
![coverage](https://coveritup.app/chart?org=kevincobain2000&repo=laravel-alert-notifications&type=coverage&output=svg&width=160&height=160&branch=master)
![composer-dependencies](https://coveritup.app/chart?org=kevincobain2000&repo=laravel-alert-notifications&type=composer-dependencies&output=svg&width=160&height=160&branch=master)

Send php exceptions to email, microsoft teams, slack.
Notifications are throttle enabled so devs don't get a lot of emails from one host (or all hosts if cache driver is shared)
Please check config for more details on throttling.

| Channels | Progress |
| :------- | :--------- |
Expand Down Expand Up @@ -82,15 +94,15 @@ ALERT_NOTIFICATION_CURL_PROXY=
### Usage

```php
new AlertDispatcher(
Exception $e
new AlertDispatcher(
Exception $e
[, array $dontAlertExceptions = []] // Exceptions that shouldn't trigger notifications
[, array $notificationLevelsMapping = []] // [Exception class => Notification level] mapping
[, array $exceptionContext = []] // Array of context data
)
```

In **app/Exceptions/Handler.php**. It is better to use a try catch to prevent loop.
In **app/Exceptions/Handler.php**. It is better to use a try catch to prevent loop.

```php
use Kevincobain2000\LaravelAlertNotifications\Dispatcher\AlertDispatcher;
Expand Down Expand Up @@ -145,7 +157,7 @@ class Handler extends ExceptionHandler
| | ``%ExceptionLevel%`` => ``current notification level`` |
| | ex. ``'subject' => 'Exception [%ExceptionType%] has ocurred``' | |
| mail.#level# | Configs for each notification level |
| | notification levels refer to those defined in ``\Psr\Log\LogLevel`` |
| | notification levels refer to those defined in ``\Psr\Log\LogLevel`` |
| mail.#level#.toAddress | (default mail.to_address), #level# notification recipient e-mail |
| mail.#level#.subject | #level# notification e-mail subject |
| microsoft_teams.enabled | (default true), false will not notify to teams |
Expand Down
Loading