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

update codeception and supported php #10

Merged
merged 1 commit into from
Mar 31, 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
11 changes: 6 additions & 5 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 8.0
- 8.1
- 8.2
- 8.3
php: [ '8.2', '8.3' ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Validate composer.json and composer.lock
run: composer validate --strict

Expand Down
14 changes: 9 additions & 5 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
tools:
external_code_coverage: true
checks:
php:
code_rating: true
duplication: true
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
environment:
php: 8.2.14
filter:
paths:
- src/*
- src/*
16 changes: 8 additions & 8 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
actor_suffix: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
actor_suffix: Tester
extensions:
enabled:
- Codeception\Extension\RunFailed
helpers: tests/_support
settings:
colors: true
memory_limit: 1024M
coverage:
enabled: true
include:
- src/*
whitelist:
include:
- src/*.php
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
}
],
"require": {
"php": ">=8.0",
"php": "^8.2",
"ext-gd": "*"
},
"require-dev": {
"codeception/codeception": "*",
"codeception/module-asserts": "^1.1"
"codeception/codeception": "5.1",
"codeception/module-asserts": "^3.0"
},
"autoload":
{
Expand Down
2 changes: 2 additions & 0 deletions src/Image.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del;

use Del\Image\Exception\NotFoundException;
Expand Down
2 changes: 2 additions & 0 deletions src/Image/Strategy/GifStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand Down
2 changes: 2 additions & 0 deletions src/Image/Strategy/ImageTypeStrategyInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand Down
2 changes: 2 additions & 0 deletions src/Image/Strategy/JpegStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand Down
2 changes: 2 additions & 0 deletions src/Image/Strategy/PngStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand Down
10 changes: 6 additions & 4 deletions src/Image/Strategy/TransparentStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand All @@ -9,15 +11,15 @@ abstract class TransparentStrategy
public function handleTransparency(GdImage $newImage, GdImage $image): void
{
// Set blending mode as false
imagealphablending($newImage, false);
\imagealphablending($newImage, false);

// Tell it we want to save alpha channel info
imagesavealpha($newImage, true);
\imagesavealpha($newImage, true);

// Set the transparent color
$color = imagecolorallocatealpha($newImage, 0, 0, 0, 127);
$color = \imagecolorallocatealpha($newImage, 0, 0, 0, 127);

// Fill the image with nothingness
imagefill($newImage, 0, 0, $color);
\imagefill($newImage, 0, 0, $color);
}
}
8 changes: 5 additions & 3 deletions src/Image/Strategy/WebPStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Del\Image\Strategy;

use GdImage;
Expand All @@ -23,8 +25,8 @@ public function getContentType(): string

public function render(GdImage $resource): void
{
imagealphablending($resource, true);
imagesavealpha($resource, true);
imagewebp($resource);
\imagealphablending($resource, true);
\imagesavealpha($resource, true);
\imagewebp($resource);
}
}
Loading