Skip to content

Commit

Permalink
fix: remove dependency on ServiceSubscriberTrait, fixes deprecated …
Browse files Browse the repository at this point in the history
…warning from `symfony/service-contracts` (#23)

* fix: remove dependency on `ServiceSubscriberTrait`, fixes deprecated warning from `symfony/service-contracts`

* workaround psalm supression bug

* adapting for changes in symfony

* release 1.8.7
  • Loading branch information
priyadi authored May 16, 2024
1 parent 1acf758 commit 40c8c42
Show file tree
Hide file tree
Showing 20 changed files with 82 additions and 52 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# CHANGELOG

## 1.8.5
## 1.8.7

* fix: remove dependency on `ServiceSubscriberTrait`, fixes deprecated warning
from `symfony/service-contracts`

## 1.8.6

* feat: AssetMapper compatibility
* deps: Update oneup/uploaderbundle requirement from 4.0 to 5.0

## 1.8.4

Expand Down
35 changes: 18 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"symfony/asset-mapper": "^6.2 || ^7.0",
"symfony/console": "^6.2 || ^7.0",
"symfony/framework-bundle": "^6.2 || ^7.0",
"symfony/http-client": "^6.2 || ^7.0",
"symfony/phpunit-bridge": "^6.3 || ^7.0",
"symfony/property-info": "^6.2 || ^7.0",
"symfony/routing": "^6.2 || ^7.0",
Expand Down Expand Up @@ -98,23 +99,23 @@
}
},
"replace": {
"rekalogika/file": "1.8.6",
"rekalogika/file-association": "1.8.6",
"rekalogika/file-association-contracts": "1.8.6",
"rekalogika/file-association-entity": "1.8.6",
"rekalogika/file-bundle": "1.8.6",
"rekalogika/file-contracts": "1.8.6",
"rekalogika/file-derivation": "1.8.6",
"rekalogika/file-filepond": "1.8.6",
"rekalogika/file-image": "1.8.6",
"rekalogika/file-metadata": "1.8.6",
"rekalogika/file-metadata-contracts": "1.8.6",
"rekalogika/file-null": "1.8.6",
"rekalogika/file-oneup-uploader-bridge": "1.8.6",
"rekalogika/file-server": "1.8.6",
"rekalogika/file-symfony-bridge": "1.8.6",
"rekalogika/file-tree-contracts": "1.8.6",
"rekalogika/file-zip": "1.8.6"
"rekalogika/file": "1.8.7",
"rekalogika/file-association": "1.8.7",
"rekalogika/file-association-contracts": "1.8.7",
"rekalogika/file-association-entity": "1.8.7",
"rekalogika/file-bundle": "1.8.7",
"rekalogika/file-contracts": "1.8.7",
"rekalogika/file-derivation": "1.8.7",
"rekalogika/file-filepond": "1.8.7",
"rekalogika/file-image": "1.8.7",
"rekalogika/file-metadata": "1.8.7",
"rekalogika/file-metadata-contracts": "1.8.7",
"rekalogika/file-null": "1.8.7",
"rekalogika/file-oneup-uploader-bridge": "1.8.7",
"rekalogika/file-server": "1.8.7",
"rekalogika/file-symfony-bridge": "1.8.7",
"rekalogika/file-tree-contracts": "1.8.7",
"rekalogika/file-zip": "1.8.7"
},
"config": {
"allow-plugins": {
Expand Down
6 changes: 3 additions & 3 deletions packages/file-association-entity/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"require": {
"doctrine/collections": "^2.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-metadata": "^1.8.6",
"rekalogika/file-null": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-metadata": "^1.8.7",
"rekalogika/file-null": "^1.8.7",
"rekalogika/doctrine-collections-decorator": "^2.0"
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions packages/file-association/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"require": {
"rekalogika/direct-property-access": "^1.1.2 || ^1.2",
"rekalogika/file-association-contracts": "^1.8.6",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-association-contracts": "^1.8.7",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/reconstitutor": "^1.0",
"symfony/property-access": "^6.2 || ^7.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/file-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"league/flysystem": "^3.16",
"league/flysystem-local": "^3.16",
"psr/container": "^2.0",
"rekalogika/file": "^1.8.6",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file": "^1.8.7",
"rekalogika/file-contracts": "^1.8.7",
"symfony/config": "^6.2 || ^7.0",
"symfony/dependency-injection": "^6.2 || ^7.0",
"symfony/http-kernel": "^6.2 || ^7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/file-derivation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"require": {
"rekalogika/file-contracts": "^1.8.6"
"rekalogika/file-contracts": "^1.8.7"
},
"extra": {
"branch-alias": {
Expand Down
14 changes: 7 additions & 7 deletions packages/file-filepond/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
}
},
"require": {
"rekalogika/file": "^1.8.6",
"rekalogika/file-association-entity": "^1.8.6",
"rekalogika/file-bundle": "^1.8.6",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-image": "^1.8.6",
"rekalogika/file-server": "^1.8.6",
"rekalogika/file-symfony-bridge": "^1.8.6",
"rekalogika/file": "^1.8.7",
"rekalogika/file-association-entity": "^1.8.7",
"rekalogika/file-bundle": "^1.8.7",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-image": "^1.8.7",
"rekalogika/file-server": "^1.8.7",
"rekalogika/file-symfony-bridge": "^1.8.7",
"rekalogika/temporary-url-bundle": "^1.3",
"symfony/form": "^6.2 || ^7.0",
"symfony/options-resolver": "^6.2 || ^7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/file-image/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"require": {
"intervention/image": "^3.3",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-derivation": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-derivation": "^1.8.7",
"symfony/service-contracts": "^3.3",
"twig/twig": "^2.12|^3.0",
"webmozart/assert": "^1.11"
Expand Down
11 changes: 9 additions & 2 deletions packages/file-image/src/ImageTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
namespace Rekalogika\File\Image;

use Rekalogika\Contracts\File\FileInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Contracts\Service\Attribute\Required;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

class ImageTwigExtension extends AbstractExtension implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
protected ContainerInterface $container;

public static function getSubscribedServices(): array
{
Expand All @@ -30,6 +31,12 @@ public static function getSubscribedServices(): array
];
}

#[Required]
public function setContainer(ContainerInterface $container): void
{
$this->container = $container;
}

private function getImageResizer(): ImageResizer
{
$resizer = $this->container->get(ImageResizer::class);
Expand Down
4 changes: 2 additions & 2 deletions packages/file-metadata/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"require": {
"cardinalby/content-disposition": "^1.1",
"fileeye/mimemap": "^2.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-metadata-contracts": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-metadata-contracts": "^1.8.7",
"symfony/translation-contracts": "^3.0"
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion packages/file-null/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require": {
"psr/http-message": "^1.0 || ^2.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"symfony/translation-contracts": "^3.0"
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions packages/file-oneup-uploader-bridge/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"require": {
"oneup/uploader-bundle": "^4.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file": "^1.8.6"
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file": "^1.8.7"
},
"extra": {
"branch-alias": {
Expand Down
4 changes: 2 additions & 2 deletions packages/file-server/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
}
},
"require": {
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-symfony-bridge": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-symfony-bridge": "^1.8.7",
"rekalogika/temporary-url-bundle": "^1.3",
"symfony/http-foundation": "^6.2 || ^7.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/file-symfony-bridge/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
}
},
"require": {
"rekalogika/file": "^1.8.6",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-metadata-contracts": "^1.8.6",
"rekalogika/file": "^1.8.7",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-metadata-contracts": "^1.8.7",
"symfony/form": "^6.2 || ^7.0",
"symfony/http-foundation": "^6.2 || ^7.0",
"symfony/validator": "^6.2 || ^7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/file-tree-contracts/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"require": {
"rekalogika/file-contracts": "^1.8.6"
"rekalogika/file-contracts": "^1.8.7"
},
"extra": {
"branch-alias": {
Expand Down
4 changes: 2 additions & 2 deletions packages/file-zip/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"require": {
"psr/http-message": "^1.0 || ^2.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-metadata": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-metadata": "^1.8.7",
"rekalogika/temporary-url-bundle": "^1.3",
"maennchen/zipstream-php": "^3.1",
"symfony/http-foundation": "^6.2 || ^7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/file/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"psr/http-factory-implementation": "^1.0",
"league/flysystem": "^3.16",
"league/mime-type-detection": "^1.0.0",
"rekalogika/file-contracts": "^1.8.6",
"rekalogika/file-metadata": "^1.8.6",
"rekalogika/file-contracts": "^1.8.7",
"rekalogika/file-metadata": "^1.8.7",
"symfony/deprecation-contracts": "^3.1"
},
"require-dev": {
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<file name="packages/file-filepond/src/FilePondCollectionType.php" />
</errorLevel>
</MixedArgument>
<MissingConstructor>
<errorLevel type="suppress">
<file name="packages/file-image/src/ImageTwigExtension.php" />
</errorLevel>
</MissingConstructor>
</issueHandlers>

<plugins>
Expand Down
1 change: 1 addition & 0 deletions tests/Model/EntityWithDifferentFileProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Rekalogika\Contracts\File\FileInterface;
use Rekalogika\File\Association\Attribute\AsFileAssociation;

/** @psalm-suppress MissingConstructor */
class EntityWithDifferentFileProperties
{
#[AsFileAssociation(fetch: 'EAGER')]
Expand Down
10 changes: 10 additions & 0 deletions tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
'php_errors' => [
'log' => true,
],
'http_client' => [
'enabled' => true,
'max_host_connections' => 1,
'default_options' => [
'timeout' => 10,
],
],
]);

$container->loadFromExtension('doctrine', [
Expand All @@ -96,6 +103,9 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
],
'orm' => [
'enable_lazy_ghost_objects' => true,
'controller_resolver' => [
'auto_mapping' => false,
]
]
]);

Expand Down

0 comments on commit 40c8c42

Please sign in to comment.