Skip to content
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
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
cs:
runs-on: ubuntu-latest
name: Code Style

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Check code style
run: ./vendor/bin/php-cs-fixer check --allow-risky=yes

test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']

name: PHP ${{ matrix.php }}

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run tests
run: ./vendor/bin/phpunit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ build
composer.lock
docs
vendor
.php-cs-fixer.cache
.phpunit.result.cache
.claude
.idea
.php-cs-fixer.cache
29 changes: 29 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

return (new PhpCsFixer\Config())
->setUnsupportedPhpVersionAllowed(true)
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'single_trait_insert_per_statement' => true,
'no_superfluous_phpdoc_tags' => true,
'not_operator_with_successor_space' => true,
])
->setFinder($finder);
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

All notable changes to this project will be documented in this file.

## [2.0.0] - 2026-06-04

### Changed

- Dropped support for PHP 7.x (EOL).
- Set minimum PHP requirement to 8.2.
- Updated PHPUnit dev dependency to support versions 11, 12, and 13.
- Updated phpunit.xml.dist to the PHPUnit 13.1 schema.

## [1.3.0]

- Added max slug length option.

## [1.2.0]

- Added support for image processing options (e.g. `quality`).

## [1.1.1]

- Bug fixes.

## [1.1.0]

- Added support for PHP 7.2.

## [1.0.2]

- Bug fixes.

## [1.0.1]

- Bug fixes.

## [1.0]

- Initial release.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is the PHP client for resized.co, a realtime image resize manipulation service.

Requires PHP 8.2 or higher.

## Install

Via Composer
Expand Down
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
"authors": [
{
"name": "Ciaran Maher",
"email": "hello@square1.io",
"email": "ciaran@square1.io",
"homepage": "https://www.resized.co"
},
{
"name": "Jose Vicente Orts",
"email": "vince@square1.io"
}
],
"require": {
"php" : "~7.2|~8.0"
"php": "^8.2"
},
"require-dev": {
"phpunit/phpunit" : "~9.5.9",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "~2.3"
"phpunit/phpunit": "^11.0|^12.0|^13.0",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -35,11 +38,13 @@
}
},
"scripts": {
"test": "phpunit"
"test": "phpunit",
"format": "php-cs-fixer fix --allow-risky=yes",
"format:check": "php-cs-fixer check --allow-risky=yes"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "2.0-dev"
}
}
}
38 changes: 11 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Square1 Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/13.1/phpunit.xsd">
<testsuites>
<testsuite name="Square1 Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
Loading
Loading