Skip to content
Open
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
10 changes: 7 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: run-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1]
laravel: [10.*]
php: [8.2]
laravel: ['11.*']
testbench: ['9.*']
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
Expand Down
18 changes: 13 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"name": "cachethq/badger",
"description": "A badge generator for Laravel.",
"keywords": ["badger", "badge", "shield", "svg", "Badger", "Cachet", "CachetHQ"],
"keywords": [
"badger",
"badge",
"shield",
"svg",
"Badger",
"Cachet",
"CachetHQ"
],
"license": "MIT",
"support": {
"issues": "https://github.com/cachethq/badger/issues",
Expand All @@ -14,12 +22,12 @@
}
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0"
"php": "^8.2",
"illuminate/contracts": "^11.0",
"illuminate/support": "^11.0"
},
"require-dev": {
"orchestra/testbench": "^8.8",
"orchestra/testbench": "^9.0",
"pestphp/pest": "^2.13",
"pestphp/pest-plugin-laravel": "^2.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="18">
<svg xmlns="http://www.w3.org/2000/svg" width="76" height="18">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-color="#000" stop-opacity=".3"/>
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="78" height="18" fill="#555555"/>
<rect rx="4" x="49" width="29" height="18" fill="#e05d44"/>
<rect x="49" width="4" height="18" fill="#e05d44"/>
<rect rx="4" width="78" height="18" fill="url(#smooth)"/>
<rect rx="4" width="76" height="18" fill="#555555"/>
<rect rx="4" x="48" width="28" height="18" fill="#e05d44"/>
<rect x="48" width="4" height="18" fill="#e05d44"/>
<rect rx="4" width="76" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="25.5" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25.5" y="12">license</text>
<text x="62.5" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="62.5" y="12">MIT</text>
<text x="25" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25" y="12">license</text>
<text x="61" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="61" y="12">MIT</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="18">
<svg xmlns="http://www.w3.org/2000/svg" width="76" height="18">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-color="#000" stop-opacity=".3"/>
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="78" height="18" fill="#555555"/>
<rect rx="4" x="49" width="29" height="18" fill="#ff69b4"/>
<rect x="49" width="4" height="18" fill="#ff69b4"/>
<rect rx="4" width="78" height="18" fill="url(#smooth)"/>
<rect rx="4" width="76" height="18" fill="#555555"/>
<rect rx="4" x="48" width="28" height="18" fill="#ff69b4"/>
<rect x="48" width="4" height="18" fill="#ff69b4"/>
<rect rx="4" width="76" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="25.5" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25.5" y="12">license</text>
<text x="62.5" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="62.5" y="12">MIT</text>
<text x="25" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25" y="12">license</text>
<text x="61" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="61" y="12">MIT</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="18">
<svg xmlns="http://www.w3.org/2000/svg" width="76" height="18">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-color="#000" stop-opacity=".3"/>
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="78" height="18" fill="#555555"/>
<rect rx="4" x="49" width="29" height="18" fill="#007ec6"/>
<rect x="49" width="4" height="18" fill="#007ec6"/>
<rect rx="4" width="78" height="18" fill="url(#smooth)"/>
<rect rx="4" width="76" height="18" fill="#555555"/>
<rect rx="4" x="48" width="28" height="18" fill="#007ec6"/>
<rect x="48" width="4" height="18" fill="#007ec6"/>
<rect rx="4" width="76" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="25.5" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25.5" y="12">license</text>
<text x="62.5" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="62.5" y="12">MIT</text>
<text x="25" y="13" fill="#010101" fill-opacity=".3">license</text>
<text x="25" y="12">license</text>
<text x="61" y="13" fill="#010101" fill-opacity=".3">MIT</text>
<text x="61" y="12">MIT</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" width="124" height="20">
<svg xmlns="http://www.w3.org/2000/svg" width="127" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="a">
<rect width="124" height="20" rx="0" fill="#fff"/>
<rect width="127" height="20" rx="0" fill="#fff"/>
</mask>
<g mask="url(#a)">
<rect width="60" height="20" fill="#555"/>
<rect x="60" width="64" height="20" fill="#4c1"/>
<rect width="124" height="20" fill="url(#b)"/>
<rect width="62" height="20" fill="#555"/>
<rect x="62" width="65" height="20" fill="#4c1"/>
<rect width="127" height="20" fill="url(#b)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="91" y="15" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="91" y="14">Awesome</text>
<text x="32" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="93.5" y="14">Awesome</text>
</g>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<rect width="99" height="20" rx="0" fill="#fff"/>
</mask>
<g mask="url(#a)">
<rect width="60" height="20" fill="#555"/>
<rect x="60" width="39" height="20" fill="#e05d44"/>
<rect width="62" height="20" fill="#555"/>
<rect x="62" width="37" height="20" fill="#e05d44"/>
<rect width="99" height="20" fill="url(#b)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">Dead</text>
<text x="78.5" y="14">Dead</text>
<text x="32" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="79.5" y="15" fill="#010101" fill-opacity=".3">Dead</text>
<text x="79.5" y="14">Dead</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" width="124" height="20">
<svg xmlns="http://www.w3.org/2000/svg" width="127" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="a">
<rect width="124" height="20" rx="3" fill="#fff"/>
<rect width="127" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#a)">
<rect width="60" height="20" fill="#555"/>
<rect x="60" width="64" height="20" fill="#4c1"/>
<rect width="124" height="20" fill="url(#b)"/>
<rect width="62" height="20" fill="#555"/>
<rect x="62" width="65" height="20" fill="#4c1"/>
<rect width="127" height="20" fill="url(#b)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="91" y="15" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="91" y="14">Awesome</text>
<text x="32" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="93.5" y="14">Awesome</text>
</g>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<rect width="99" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#a)">
<rect width="60" height="20" fill="#555"/>
<rect x="60" width="39" height="20" fill="#e05d44"/>
<rect width="62" height="20" fill="#555"/>
<rect x="62" width="37" height="20" fill="#e05d44"/>
<rect width="99" height="20" fill="url(#b)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">Dead</text>
<text x="78.5" y="14">Dead</text>
<text x="32" y="15" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="79.5" y="15" fill="#010101" fill-opacity=".3">Dead</text>
<text x="79.5" y="14">Dead</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="124" height="18">
<svg xmlns="http://www.w3.org/2000/svg" width="127" height="18">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-color="#000" stop-opacity=".3"/>
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="124" height="18" fill="#555555"/>
<rect rx="4" x="60" width="64" height="18" fill="#4c1"/>
<rect x="60" width="4" height="18" fill="#4c1"/>
<rect rx="4" width="124" height="18" fill="url(#smooth)"/>
<rect rx="4" width="127" height="18" fill="#555555"/>
<rect rx="4" x="62" width="65" height="18" fill="#4c1"/>
<rect x="62" width="4" height="18" fill="#4c1"/>
<rect rx="4" width="127" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="13" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="12">Alt Three</text>
<text x="91" y="13" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="91" y="12">Awesome</text>
<text x="32" y="13" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="12">Alt Three</text>
<text x="93.5" y="13" fill="#010101" fill-opacity=".3">Awesome</text>
<text x="93.5" y="12">Awesome</text>
</g>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="99" height="18" fill="#555555"/>
<rect rx="4" x="60" width="39" height="18" fill="#e05d44"/>
<rect x="60" width="4" height="18" fill="#e05d44"/>
<rect rx="4" x="62" width="37" height="18" fill="#e05d44"/>
<rect x="62" width="4" height="18" fill="#e05d44"/>
<rect rx="4" width="99" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31" y="13" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="31" y="12">Alt Three</text>
<text x="78.5" y="13" fill="#010101" fill-opacity=".3">Dead</text>
<text x="78.5" y="12">Dead</text>
<text x="32" y="13" fill="#010101" fill-opacity=".3">Alt Three</text>
<text x="32" y="12">Alt Three</text>
<text x="79.5" y="13" fill="#010101" fill-opacity=".3">Dead</text>
<text x="79.5" y="12">Dead</text>
</g>
</svg>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="131" height="20">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="134" height="20">
<style type="text/css"><![CDATA[
#llink:hover { fill:url(#b); stroke:#ccc; }
#rlink:hover { fill:#a4a61d; }
Expand All @@ -12,18 +12,18 @@
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<g stroke="#d5d5d5">
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="60" height="19" rx="2"/>
<rect y="0.5" x="66" width="64" height="19" rx="2" fill="#fafafa"/>
<rect x="66" y="7.5" width="0.5" height="5" stroke="#fafafa"/>
<path d="M66.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/>
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="62" height="19" rx="2"/>
<rect y="0.5" x="68" width="65" height="19" rx="2" fill="#fafafa"/>
<rect x="68" y="7.5" width="0.5" height="5" stroke="#fafafa"/>
<path d="M68.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/>
</g>
<g fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" font-weight="700" font-size="11px" line-height="14px">
<text x="31" y="15" fill="#fff">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="98" y="15" fill="#fff">Awesome</text>
<text x="98" y="14">Awesome</text>
<text x="32" y="15" fill="#fff">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="100.5" y="15" fill="#fff">Awesome</text>
<text x="100.5" y="14">Awesome</text>
</g>
<a xlink:href="undefined">
<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="60" height="19" rx="2"/>
<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="62" height="19" rx="2"/>
</a>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<g stroke="#d5d5d5">
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="60" height="19" rx="2"/>
<rect y="0.5" x="66" width="39" height="19" rx="2" fill="#fafafa"/>
<rect x="66" y="7.5" width="0.5" height="5" stroke="#fafafa"/>
<path d="M66.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/>
<rect stroke="none" fill="#fcfcfc" x="0.5" y="0.5" width="62" height="19" rx="2"/>
<rect y="0.5" x="68" width="37" height="19" rx="2" fill="#fafafa"/>
<rect x="68" y="7.5" width="0.5" height="5" stroke="#fafafa"/>
<path d="M68.5 6.5 l-3 3v1 l3 3" stroke="d5d5d5" fill="#fafafa"/>
</g>
<g fill="#333" text-anchor="middle" font-family="Helvetica Neue,Helvetica,Arial,sans-serif" font-weight="700" font-size="11px" line-height="14px">
<text x="31" y="15" fill="#fff">Alt Three</text>
<text x="31" y="14">Alt Three</text>
<text x="85.5" y="15" fill="#fff">Dead</text>
<text x="85.5" y="14">Dead</text>
<text x="32" y="15" fill="#fff">Alt Three</text>
<text x="32" y="14">Alt Three</text>
<text x="86.5" y="15" fill="#fff">Dead</text>
<text x="86.5" y="14">Dead</text>
</g>
<a xlink:href="undefined">
<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="60" height="19" rx="2"/>
<rect id="llink" stroke="#d5d5d5" fill="url(#a)" x=".5" y=".5" width="62" height="19" rx="2"/>
</a>
</svg>
2 changes: 1 addition & 1 deletion tests/Calculator/GDTextSizeCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
it('can calculate the width of text', function () {
$calculator = new GDTextSizeCalculator(realpath(__DIR__.'/../../resources/fonts/DejaVuSans.ttf'));

expect($calculator->calculateWidth('Alt Three'))->toBe(60.0);
expect($calculator->calculateWidth('Alt Three'))->toBe(62.0);
});
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function getPackageProviders($app)
protected function getPackageAliases($app)
{
return [
'Badger' => 'Cachet\Badger\Facades\Badger',
'Badger' => 'Cachet\\Badger\\Facades\\Badger',
];
}
}