Skip to content

Commit cd57255

Browse files
chore:support laravel 12.x
1 parent 71e0448 commit cd57255

23 files changed

+76
-89
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push]
44

55
jobs:
66
php-code-styling:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-latest
88

99
strategy:
1010
fail-fast: true
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.2
19+
php-version: 8.4
2020
tools: composer:v2
2121
coverage: none
2222

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
phpstan:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212

1313
strategy:
1414
fail-fast: true
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2
2424
with:
25-
php-version: 8.2
25+
php-version: 8.4
2626
tools: composer:v2
2727
coverage: none
2828

.github/workflows/run-tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212

1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [ 8.1, 8.2, 8.3 ]
17-
laravel: [ 9, 10, 11 ]
16+
php: [ 8.4, 8.3, 8.2, 8.1 ]
17+
laravel: ["^12.0", "^11.0", "^10.0", "^9.0"]
1818
exclude:
1919
- php: 8.1
20-
laravel: 11
20+
laravel: "^12.0"
21+
- php: 8.1
22+
laravel: "^11.0"
23+
- php: 8.4
24+
laravel: 9
2125
- php: 8.3
2226
laravel: 9
2327

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red.svg?style=flat-square)](https://laravel.com/docs/9.x)
55
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg?style=flat-square)](http://laravel.com/docs/10.x)
66
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red.svg?style=flat-square)](http://laravel.com/docs/11.x)
7+
[![Laravel 12.x](https://img.shields.io/badge/Laravel-12.x-red.svg?style=flat-square)](http://laravel.com/docs/12.x)
78
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ageekdev/laravel-barcode/run-tests.yml?style=flat-square)](https://github.com/ageekdev/laravel-barcode/actions/workflows/run-tests.yml)
89
[![Total Downloads](https://img.shields.io/packagist/dt/ageekdev/laravel-barcode.svg?style=flat-square&logo=Packagist)](https://packagist.org/packages/ageekdev/laravel-barcode)
910

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
"require": {
1919
"php": "^8.1",
2020
"ext-bcmath": "*",
21-
"illuminate/contracts": "^9.0|^10.0|^11.0",
21+
"illuminate/contracts": "^9.0|^10.0|^11.0|^12.0",
2222
"spatie/color": "^1.5"
2323
},
2424
"require-dev": {
25-
"laravel/pint": "^1.10",
26-
"larastan/larastan": "^2.0",
27-
"orchestra/testbench": "^7.31|^8.11|^9.0",
25+
"laravel/pint": "^1.5",
26+
"larastan/larastan": "^2.0|^3.0",
27+
"orchestra/testbench": "^7.31|^8.11|^9.0|^10.0",
2828
"pestphp/pest": "^1.0|^2.0",
2929
"pestphp/pest-plugin-laravel": "^1.4|^2.0",
30-
"phpstan/extension-installer": "^1.1",
31-
"phpstan/phpstan-deprecation-rules": "^1.0",
32-
"phpstan/phpstan-phpunit": "^1.0",
30+
"phpstan/extension-installer": "^1.1|^2.0",
31+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
32+
"phpstan/phpstan-phpunit": "^1.0|^2.0",
3333
"roave/security-advisories": "dev-latest"
3434
},
3535
"autoload": {

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon.dist

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
includes:
2-
- phpstan-baseline.neon
3-
41
parameters:
52
level: 4
63
paths:
74
- src
8-
- config
95
tmpDir: build/phpstan
106
checkOctaneCompatibility: true
11-
checkModelProperties: true
12-
checkMissingIterableValueType: false
137

src/BarcodeManager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,39 +105,39 @@ protected function callCustomCreator(string $driver): ImageType
105105
*/
106106
public function createHtmlDriver(): ImageType
107107
{
108-
return new HTML();
108+
return new HTML;
109109
}
110110

111111
/**
112112
* Create an DynamicHTML instance.
113113
*/
114114
public function createDynamicHtmlDriver(): ImageType
115115
{
116-
return new DynamicHTML();
116+
return new DynamicHTML;
117117
}
118118

119119
/**
120120
* Create an JPG instance.
121121
*/
122122
public function createJpgDriver(): ImageType
123123
{
124-
return new JPG();
124+
return new JPG;
125125
}
126126

127127
/**
128128
* Create an PNG instance.
129129
*/
130130
public function createPngDriver(): ImageType
131131
{
132-
return new PNG();
132+
return new PNG;
133133
}
134134

135135
/**
136136
* Create an SVG instance.
137137
*/
138138
public function createSvgDriver(): ImageType
139139
{
140-
return new SVG();
140+
return new SVG;
141141
}
142142

143143
/**

src/Drivers/JPG.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class JPG extends PNG
88
{
99
protected function createImagickImageObject(int $width, int $height): Imagick
1010
{
11-
$image = new Imagick();
11+
$image = new Imagick;
1212
$image->newImage($width, $height, 'white', 'JPG');
1313

1414
return $image;

src/Drivers/PNG.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function generate(string $text): string
6666
$foregroundColor = $this->getForegroundColor();
6767

6868
if ($this->useImagick) {
69-
$imagickBarsShape = new imagickdraw();
69+
$imagickBarsShape = new imagickdraw;
7070
$imagickBarsShape->setFillColor(new imagickpixel('rgb('.implode(',', $foregroundColor).')'));
7171
} else {
7272
$image = $this->createGdImageObject($width, $this->height);
@@ -127,7 +127,7 @@ protected function createGdImageObject(int $width, int $height)
127127
*/
128128
protected function createImagickImageObject(int $width, int $height): Imagick
129129
{
130-
$image = new Imagick();
130+
$image = new Imagick;
131131
$image->newImage($width, $height, 'none', 'PNG');
132132

133133
return $image;

0 commit comments

Comments
 (0)