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
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build docs

on:
push:
branches: ['5.x']
branches: ['6.x']

jobs:
deploy:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coding-standards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Coding Standards

on:
pull_request:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]
push:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]

jobs:
easy-coding-standard:
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php-version:
- '8.4'
- '8.5'

steps:
- name: Checkout code
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]
push:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]

jobs:
phpunit:
Expand All @@ -17,20 +17,14 @@ jobs:
strategy:
matrix:
php-version:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
symfony-version:
- '6.4.*'
- '7.3.*'
- '7.4.*@dev'
- '7.4.*'
- '8.0.*'
include:
- php-version: '8.4'
symfony-version: '8.0.*@dev'
continue-on-error: true
- php-version: '8.5'
symfony-version: '8.0.*@dev'
symfony-version: '8.1.*@dev'
continue-on-error: true

steps:
Expand Down Expand Up @@ -61,4 +55,4 @@ jobs:

- name: Upload to Codecov
uses: codecov/codecov-action@v5
if: matrix.php-version == '8.2' && matrix.symfony-version == '6.4.*'
if: matrix.php-version == '8.4' && matrix.symfony-version == '7.4.*'
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Static Analysis

on:
pull_request:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]
push:
branches: ['5.x', '4.x', '3.x']
branches: ["*.x"]

jobs:
phpstan:
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php-version:
- '8.4'
- '8.5'

steps:
- name: Checkout code
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG-6.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
6.0.0
-----

* Drop support for PHP < 8.4
* Drop support for Symfony < 7.4 & Twig < 3.23
* Require leapt/core-bundle 6
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Leapt IM Bundle
===============

[![Package version](https://img.shields.io/packagist/v/leapt/im-bundle.svg?style=flat-square)](https://packagist.org/packages/leapt/im-bundle)
[![Build Status](https://img.shields.io/github/actions/workflow/status/leapt/im-bundle/continuous-integration.yaml?branch=5.x&style=flat-square)](https://github.com/leapt/im-bundle/actions?query=workflow%3A%22Continuous+Integration%22)
![PHP Version](https://img.shields.io/packagist/php-v/leapt/im-bundle/v5.0.0?branch=5.x&style=flat-square)
[![Build Status](https://img.shields.io/github/actions/workflow/status/leapt/im-bundle/continuous-integration.yaml?branch=6.x&style=flat-square)](https://github.com/leapt/im-bundle/actions?query=workflow%3A%22Continuous+Integration%22)
![PHP Version](https://img.shields.io/packagist/php-v/leapt/im-bundle/v6.0.0?branch=6.x&style=flat-square)
[![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE)
[![Code coverage](https://img.shields.io/codecov/c/github/leapt/im-bundle?style=flat-square)](https://codecov.io/gh/leapt/im-bundle/branch/5.x)
[![Code coverage](https://img.shields.io/codecov/c/github/leapt/im-bundle?style=flat-square)](https://codecov.io/gh/leapt/im-bundle/branch/6.x)

This bundle is a fork of the SnowcapImBundle.

Expand All @@ -24,21 +24,22 @@ See the [Documentation and examples](https://im-bundle.leapt.dev/)
Versions & dependencies
-----------------------

The current version (5.x) of the bundle works with Symfony 6.4, 7.0+ & 8.0+.
The current version (6.x) of the bundle works with Symfony 7.4 & 8.0+.
The project follows SemVer.
Only the last major version is maintained.

You can check the [changelog](CHANGELOG-5.x.md) for version 5 and the [upgrade document](UPGRADE-5.x.md) when upgrading
from 4.x bundle version.

| ImBundle version | Symfony version | PHP version
|------------------|--------------------------| -----------
| 5.x | ^6.4 \|\| ^7.0 | ^8.2
| 4.x | ^5.4 \|\| ^6.0 | ^8.0
| 3.x | ^4.4 \|\| ^5.0 | ^7.2 \|\| ^8.0
| 2.1+ | ^3.3 \|\| ^4.0 | >=5.5
| 2.0, < 2.1 | ^2.7 \|\| ^3.0 \|\| ^4.0 | >=5.4
| 1.x | ^2.7 | >=5.3.3
You can check the [changelog](CHANGELOG-6.x.md) for version 5 and the [upgrade document](UPGRADE-6.x.md) when upgrading
from 5.x bundle version.

| ImBundle version | Symfony version | PHP version |
|------------------|--------------------------|----------------|
| 6.x | ^7.4 \|\| ^8.0 | ^8.4 |
| 5.x | ^6.4 \|\| ^7.0 \|\| ^8.0 | ^8.2 |
| 4.x | ^5.4 \|\| ^6.0 | ^8.0 |
| 3.x | ^4.4 \|\| ^5.0 | ^7.2 \|\| ^8.0 |
| 2.1+ | ^3.3 \|\| ^4.0 | >=5.5 |
| 2.0, < 2.1 | ^2.7 \|\| ^3.0 \|\| ^4.0 | >=5.4 |
| 1.x | ^2.7 | >=5.3.3 |

Contributing
------------
Expand Down
6 changes: 6 additions & 0 deletions UPGRADE-6.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Upgrade from 5.x to 6.x
-----------------------

* Drop support for PHP < 8.4
* Drop support for Symfony < 7.4 & Twig < 3.23
* Require leapt/core-bundle 6
40 changes: 20 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@
],
"minimum-stability": "stable",
"require": {
"php": "^8.2",
"php": "^8.4",
"ext-curl": "*",
"doctrine/orm": "^2.5 || ^3.0",
"leapt/core-bundle": "^5.0",
"symfony/css-selector": "^6.4 || ^7.0 || ^8.0",
"symfony/console": "^6.4 || ^7.0 || ^8.0",
"symfony/dom-crawler": "^6.4 || ^7.0 || ^8.0",
"symfony/filesystem": "^6.4 || ^7.0 || ^8.0",
"symfony/finder": "^6.4 || ^7.0 || ^8.0",
"symfony/form": "^6.4 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0",
"symfony/process": "^6.4 || ^7.0 || ^8.0",
"twig/twig": "^3.0"
"doctrine/orm": "^3.0",
"leapt/core-bundle": "^6.0",
"symfony/css-selector": "^7.4 || ^8.0",
"symfony/console": "^7.4 || ^8.0",
"symfony/dom-crawler": "^7.4 || ^8.0",
"symfony/filesystem": "^7.4 || ^8.0",
"symfony/finder": "^7.4 || ^8.0",
"symfony/form": "^7.4 || ^8.0",
"symfony/framework-bundle": "^7.4 || ^8.0",
"symfony/process": "^7.4 || ^8.0",
"twig/twig": "^3.23"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.11",
"phpstan/phpstan": "^2.1.22",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
"phpunit/phpunit": "^11.5.35",
"symfony/browser-kit": "^6.4 || ^7.0 || ^8.0",
"symplify/easy-coding-standard": "^12.5.24"
"phpstan/phpstan": "^2.1.40",
"phpstan/phpstan-deprecation-rules": "^2.0.4",
"phpunit/phpunit": "^13.0.5",
"symfony/browser-kit": "^7.4 || ^8.0",
"symplify/easy-coding-standard": "^13.0.4"
},
"scripts": {
"ci": [
"@cs:dry",
"@phpstan",
"vendor/bin/phpunit --colors=auto"
],
"cs:dry": "vendor/bin/ecs",
"cs:fix": "vendor/bin/ecs --fix",
"phpstan": "vendor/bin/phpstan analyse --ansi"
"cs:dry": "@php vendor/bin/ecs",
"cs:fix": "@php vendor/bin/ecs --fix",
"phpstan": "@php vendor/bin/phpstan analyse --ansi"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It allows you to use all the convert/mogrify power, from your controllers, servi
- [Extra information](extra.md)

If you find a bug or want to add a functionality,
[please create an issue or a pull request on Github](https://github.com/leapt/im-bundle)!
[please create an issue or a pull request on GitHub](https://github.com/leapt/im-bundle)!

## License

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Requirements

* You need to have the ImageMagick binaries available (convert & mogrify)
* You need to have a cache folder in your web dir, writeable by the webserver
* Symfony 6.4/7.0+/8.0+
* PHP 8.2+
* You need to have a cache folder in your public dir, writeable by the webserver
* Symfony 7.4/8.0+
* PHP 8.4+

## Install steps

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ site_description: Documentation for leapt/im-bundle

repo_name: leapt/im-bundle
repo_url: https://github.com/leapt/im-bundle
edit_uri: https://github.com/leapt/im-bundle/edit/4.x/docs/
edit_uri: https://github.com/leapt/im-bundle/edit/6.x/docs/

theme:
name: material
Expand Down
48 changes: 27 additions & 21 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,118 +1,124 @@
parameters:
ignoreErrors:
-
message: '#^Method Leapt\\ImBundle\\Doctrine\\Mapping\\Mogrify\:\:__construct\(\) has parameter \$params with no value type specified in iterable type array\.$#'
rawMessage: 'Method Leapt\ImBundle\Doctrine\Mapping\Mogrify::__construct() has parameter $params with no value type specified in iterable type array.'
identifier: missingType.iterableValue
count: 1
path: src/Doctrine/Mapping/Mogrify.php

-
message: '''
#^Call to deprecated method getReflectionProperties\(\) of class Doctrine\\ORM\\Mapping\\ClassMetadata\:
Use getPropertyAccessors\(\) instead\.$#
rawMessage: '''
Call to deprecated method getReflectionProperties() of class Doctrine\ORM\Mapping\ClassMetadata:
Use getPropertyAccessors() instead.
'''
identifier: method.deprecated
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\Mapping\\ClassMetadata\<object\> and ''getPropertyAccessors'' will always evaluate to true\.$#'
rawMessage: 'Call to function method_exists() with Doctrine\ORM\Mapping\ClassMetadata<object> and ''getPropertyAccessors'' will always evaluate to true.'
identifier: function.alreadyNarrowedType
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Call to method getUnderlyingReflector\(\) of internal interface Doctrine\\ORM\\Mapping\\PropertyAccessors\\PropertyAccessor from outside its root namespace Doctrine\.$#'
rawMessage: 'Call to method getUnderlyingReflector() of internal interface Doctrine\ORM\Mapping\PropertyAccessors\PropertyAccessor from outside its root namespace Doctrine.'
identifier: method.internalInterface
count: 5
path: src/Listener/MogrifySubscriber.php

-
message: '#^Cannot access property \$name on ReflectionProperty\|string\.$#'
rawMessage: Cannot access property $name on ReflectionProperty|string.
identifier: property.nonObject
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Method Leapt\\ImBundle\\Listener\\MogrifySubscriber\:\:getFiles\(\) return type has no value type specified in iterable type array\.$#'
rawMessage: 'Method Leapt\ImBundle\Listener\MogrifySubscriber::getFiles() return type has no value type specified in iterable type array.'
identifier: missingType.iterableValue
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Parameter \#1 \$format of method Leapt\\ImBundle\\Manager\:\:mogrify\(\) expects array\|string, ReflectionProperty\|string given\.$#'
rawMessage: 'Parameter #1 $format of method Leapt\ImBundle\Manager::mogrify() expects array|string, ReflectionProperty|string given.'
identifier: argument.type
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Property Leapt\\ImBundle\\Listener\\MogrifySubscriber\:\:\$config type has no value type specified in iterable type array\.$#'
rawMessage: Property Leapt\ImBundle\Listener\MogrifySubscriber::$config type has no value type specified in iterable type array.
identifier: missingType.iterableValue
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Strict comparison using \!\=\= between null and ReflectionProperty will always evaluate to true\.$#'
rawMessage: 'Strict comparison using !== between null and ReflectionProperty will always evaluate to true.'
identifier: notIdentical.alwaysTrue
count: 1
path: src/Listener/MogrifySubscriber.php

-
message: '#^Method Leapt\\ImBundle\\Manager\:\:__construct\(\) has parameter \$formats with no value type specified in iterable type array\.$#'
rawMessage: 'Method Leapt\ImBundle\Manager::__construct() has parameter $formats with no value type specified in iterable type array.'
identifier: missingType.iterableValue
count: 1
path: src/Manager.php

-
message: '#^Method Leapt\\ImBundle\\Manager\:\:convert\(\) has parameter \$format with no value type specified in iterable type array\.$#'
rawMessage: 'Method Leapt\ImBundle\Manager::convert() has parameter $format with no value type specified in iterable type array.'
identifier: missingType.iterableValue
count: 1
path: src/Manager.php

-
message: '#^Method Leapt\\ImBundle\\Manager\:\:getCacheContent\(\) should return string but returns string\|false\.$#'
rawMessage: 'Method Leapt\ImBundle\Manager::getCacheContent() should return string but returns string|false.'
identifier: return.type
count: 1
path: src/Manager.php

-
message: '#^Method Leapt\\ImBundle\\Manager\:\:mogrify\(\) has parameter \$format with no value type specified in iterable type array\.$#'
rawMessage: 'Method Leapt\ImBundle\Manager::mogrify() has parameter $format with no value type specified in iterable type array.'
identifier: missingType.iterableValue
count: 1
path: src/Manager.php

-
message: '#^Parameter \#3 \$length of function substr expects int\|null, int\<0, max\>\|false given\.$#'
rawMessage: 'Parameter #3 $length of function substr expects int|null, int<0, max>|false given.'
identifier: argument.type
count: 1
path: src/Manager.php

-
message: '#^Method Leapt\\ImBundle\\Tests\\LeaptImTestingKernel\:\:configureContainer\(\) is unused\.$#'
rawMessage: 'Method Leapt\ImBundle\Tests\LeaptImTestingKernel::configureContainer() is unused.'
identifier: method.unused
count: 1
path: tests/LeaptImTestingKernel.php

-
message: '#^Method Leapt\\ImBundle\\Tests\\LeaptImTestingKernel\:\:configureRoutes\(\) is unused\.$#'
rawMessage: 'Method Leapt\ImBundle\Tests\LeaptImTestingKernel::configureRoutes() is unused.'
identifier: method.unused
count: 1
path: tests/LeaptImTestingKernel.php

-
message: '#^Property Leapt\\ImBundle\\Tests\\ManagerTest\:\:\$root is never read, only written\.$#'
rawMessage: 'Method Leapt\ImBundle\Tests\LeaptImTestingKernel::getConfigDir() is unused.'
identifier: method.unused
count: 1
path: tests/LeaptImTestingKernel.php

-
rawMessage: 'Property Leapt\ImBundle\Tests\ManagerTest::$root is never read, only written.'
identifier: property.onlyWritten
count: 1
path: tests/ManagerTest.php

-
message: '#^Unreachable statement \- code above always terminates\.$#'
rawMessage: Unreachable statement - code above always terminates.
identifier: deadCode.unreachable
count: 3
path: tests/ManagerTest.php

-
message: '#^Method Leapt\\ImBundle\\Tests\\Mock\\Process\:\:run\(\) overrides @final method Symfony\\Component\\Process\\Process\:\:run\(\)\.$#'
rawMessage: 'Method Leapt\ImBundle\Tests\Mock\Process::run() overrides @final method Symfony\Component\Process\Process::run().'
identifier: method.parentMethodFinalByPhpDoc
count: 1
path: tests/Mock/Process.php
Expand Down
1 change: 0 additions & 1 deletion src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public function downloadExternalImage(string $format, string $path): string
curl_setopt($ch, \CURLOPT_HEADER, false);

curl_exec($ch);
curl_close($ch);
fclose($fp);

return $newPath;
Expand Down
Loading