Skip to content

Commit 38c1aad

Browse files
authored
Updates for Laravel 9.x and 10.x. PHP 8.0 and above. (#3)
1 parent 5e1b3e4 commit 38c1aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+539
-1284
lines changed

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github:
2+
- cachethq
3+
- jbrooksuk
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Fix Code Styling"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
lint:
10+
uses: laravel/.github/.github/workflows/coding-standards.yml@main

.github/workflows/run-tests.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: run-tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest]
12+
php: [8.2, 8.1]
13+
laravel: [10.*]
14+
stability: [prefer-lowest, prefer-stable]
15+
include:
16+
- laravel: 10.*
17+
testbench: 8.*
18+
pest: ^2.13
19+
pest_laravel: ^2.0
20+
21+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v3
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
32+
coverage: none
33+
34+
- name: Install dependencies
35+
run: |
36+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "pestphp/pest:${{ matrix.pest }}" "pestphp/pest-plugin-laravel:${{ matrix.pest_laravel }}" --no-interaction --no-update
37+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
38+
39+
- name: Execute tests
40+
run: composer test
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
ref: main
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/[email protected]
25+
with:
26+
branch: main
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

.travis.yml

-80
This file was deleted.

README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,24 @@
22

33
A badge generator for Laravel 5 and 6.
44

5-
65
## Installation
76

8-
This version requires [PHP](https://php.net) 7.1 - 7.3, and supports Laravel 5.5 and above.
7+
This version requires [PHP](https://php.net) 8.0 and 8.1, and supports Laravel 8.0 and above.
98

109
To get the latest version, simply require the project using [Composer](https://getcomposer.org):
1110

1211
```bash
1312
$ composer require cachethq/badger
1413
```
1514

16-
Once installed, if you are not using automatic package discovery, then you need to register the `CachetHQ\Badger\BadgerServiceProvider` service provider in your `config/app.php`.
17-
15+
Once installed, if you are not using automatic package discovery, then you need to register the `Cachet\Badger\BadgerServiceProvider` service provider in your `config/app.php`.
1816

1917
## Examples
2018

21-
2219
Get started immediately:
2320

2421
```php
25-
// Using the facade
22+
// Using the Facade
2623
Badger::generate('license', 'MIT', 'blue', 'plastic')
2724

2825
// Dependency injection example
@@ -32,7 +29,6 @@ $badger->generate('license', 'MIT', '#ff69b4', 'plastic')
3229
![License Blue MIT](https://cdn.rawgit.com/CachetHQ/Badger/master/tests/stubs/license-MIT-blue-plastic.svg)
3330
![License Custom MIT](https://cdn.rawgit.com/CachetHQ/Badger/master/tests/stubs/license-MIT-custom-plastic.svg)
3431

35-
3632
## Usage
3733

3834
The generate method takes four parameters:
@@ -60,12 +56,10 @@ And finally the fourth parameter is the badge type. This determines the style of
6056
- `plastic`
6157
- `social` (without links)
6258

63-
6459
## Security
6560

6661
If you discover a security vulnerability within this package, please e-mail us at [email protected]. All security vulnerabilities will be promptly addressed.
6762

68-
6963
## License
7064

7165
Cachet Badger is licensed under [The MIT License (MIT)](LICENSE).

composer.json

+24-14
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
11
{
22
"name": "cachethq/badger",
3-
"description": "A Badge Generator For Laravel 5 and 6.",
3+
"description": "A badge generator for Laravel.",
44
"keywords": ["badger", "badge", "shield", "svg", "Badger", "Cachet", "CachetHQ"],
55
"license": "MIT",
6+
"support": {
7+
"issues": "https://github.com/cachethq/badger/issues",
8+
"source": "https://github.com/cachethq/badger"
9+
},
610
"authors": [
711
{
8-
"name": "Cachet",
9-
"email": "[email protected]"
12+
"name": "James Brooks",
13+
"email": "[email protected]"
1014
}
1115
],
1216
"require": {
13-
"php": "^7.1.3",
14-
"illuminate/contracts": "^5.5|^6.0",
15-
"illuminate/support": "^5.5|^6.0"
17+
"php": "^8.0",
18+
"illuminate/contracts": "^8.0|^9.0|^10.0",
19+
"illuminate/support": "^8.0|^9.0|^10.0"
1620
},
1721
"require-dev": {
18-
"graham-campbell/analyzer": "^2.1",
19-
"graham-campbell/testbench": "^5.1",
20-
"phpunit/phpunit": "^6.5|^7.0|^8.0"
22+
"orchestra/testbench": "^8.8",
23+
"pestphp/pest": "^2.13",
24+
"pestphp/pest-plugin-laravel": "^2.2"
2125
},
2226
"autoload": {
2327
"psr-4": {
24-
"CachetHQ\\Badger\\": "src/"
28+
"Cachet\\Badger\\": "src/"
2529
}
2630
},
2731
"autoload-dev": {
2832
"psr-4": {
29-
"CachetHQ\\Tests\\Badger\\": "tests/"
33+
"Cachet\\Tests\\Badger\\": "tests/"
3034
}
3135
},
3236
"config": {
33-
"preferred-install": "dist"
37+
"sort-packages": true,
38+
"allow-plugins": {
39+
"pestphp/pest-plugin": true
40+
}
41+
},
42+
"scripts": {
43+
"test": "vendor/bin/pest"
3444
},
3545
"extra": {
3646
"branch-alias": {
37-
"dev-master": "2.0-dev"
47+
"dev-master": "3.0-dev"
3848
},
3949
"laravel": {
4050
"providers": [
41-
"CachetHQ\\Badger\\BadgerServiceProvider"
51+
"Cachet\\Badger\\BadgerServiceProvider"
4252
]
4353
}
4454
},

phpunit.xml.dist

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
beStrictAboutTestsThatDoNotTestAnything="true"
5-
beStrictAboutOutputDuringTests="true"
6-
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
failOnRisky="true"
12-
failOnWarning="true"
13-
processIsolation="false"
14-
stopOnError="false"
15-
stopOnFailure="false"
16-
verbose="true"
17-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
183
<testsuites>
194
<testsuite name="Badger Test Suite">
205
<directory suffix="Test.php">./tests</directory>
216
</testsuite>
227
</testsuites>
23-
<filter>
24-
<whitelist processUncoveredFilesFromWhitelist="true">
8+
<coverage/>
9+
<source>
10+
<include>
2511
<directory suffix=".php">./src</directory>
26-
</whitelist>
27-
</filter>
12+
</include>
13+
</source>
2814
</phpunit>

0 commit comments

Comments
 (0)