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
26 changes: 0 additions & 26 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,14 @@ jobs:
fail-fast: false
matrix:
php-version:
- 8.1
- 8.2
- 8.3
- 8.4
dependencies:
- "highest"
symfony_version:
- ""
include:
# Test against latest Symfony 5.4
- symfony_version: "5.4.*"
php-version: "8.1"
dependencies: "highest"
- symfony_version: "5.4.*"
php-version: "8.2"
dependencies: "highest"
- symfony_version: "5.4.*"
php-version: "8.3"
dependencies: "highest"
- symfony_version: "5.4.*"
php-version: "8.4"
dependencies: "highest"

# Test against latest Symfony 6.4
- symfony_version: "6.4.*"
php-version: "8.1"
dependencies: "highest"
- symfony_version: "6.4.*"
php-version: "8.2"
dependencies: "highest"
- symfony_version: "6.4.*"
php-version: "8.3"
dependencies: "highest"
Expand All @@ -60,10 +38,6 @@ jobs:
dependencies: "highest"

# Test against the highest dependencies
- php-version: "8.1"
dependencies: "highest"
- php-version: "8.2"
dependencies: "highest"
- php-version: "8.3"
dependencies: "highest"
- php-version: "8.4"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ coding-standard-fix:

.PHONY: static-analysis
static-analysis: ## Run static analysis checks
./vendor/bin/phpstan --configuration=config/phpstan.neon
./vendor/bin/phpstan --configuration=config/phpstan.neon --memory-limit=256M
./vendor/bin/psalm --config config/psalm.xml --no-cache

.PHONY: static-analysis-update
Expand Down
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Speicher210 CloudinaryBundle

[![Latest Version](https://img.shields.io/github/tag/Speicher210/CloudinaryBundle.svg?style=flat-square)](https://github.com/Speicher210/CloudinaryBundle/releases)
[![Latest Version](https://img.shields.io/github/tag/protung/cloudinary-bundle.svg?style=flat-square)](https://github.com/Speicher210/CloudinaryBundle/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
![GitHub branch checks state](https://img.shields.io/github/checks-status/Speicher210/CloudinaryBundle/master?style=flat-square)
![GitHub branch checks state](https://img.shields.io/github/checks-status/protung/cloudinary-bundle/1.x?style=flat-square)

## Install

Expand All @@ -25,25 +25,9 @@ return [
];
```

or

``` php
// app/AppKernel.php
// ...
public function registerBundles()
{
return array(
// ...
new Speicher210\CloudinaryBundle\Speicher210CloudinaryBundle(),
// ...
);
}
// ...
```

## Usage

Configure the connection to cloudinary in your `config.yml` :
Configure the connection to cloudinary in your `config.yaml` :

``` yaml
speicher210_cloudinary:
Expand All @@ -54,8 +38,7 @@ speicher210_cloudinary:
access_identifier:
api_key: my-key
api_secret: my-secret
options:
secure: true
secure: true
```

The following services will be available:
Expand Down
38 changes: 19 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
"role": "Developer"
}
],
"homepage": "https://github.com/Speicher210/CloudinaryBundle",
"homepage": "https://github.com/protung/cloudinary-bundle",
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"azjezz/psl": "^2.9.1 || ^3.0.0",
"cloudinary/cloudinary_php": "^2.14.0",
"symfony/console": "^5.4 || ^6.4 || ^7.2",
"symfony/finder": "^5.4 || ^6.4 || ^7.2",
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.2",
"symfony/yaml": "^5.4 || ^6.4 || ^7.2"
"php": "~8.3.0 || ~8.4.0",
"azjezz/psl": "^3.0.0",
"cloudinary/cloudinary_php": "^3.1.1",
"symfony/console": "^6.4 || ^7.2",
"symfony/finder": "^6.4 || ^7.2",
"symfony/framework-bundle": "^6.4 || ^7.2",
"symfony/yaml": "^6.4 || ^7.2"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"ergebnis/composer-normalize": "^2.45.0",
"doctrine/coding-standard": "^13.0",
"ergebnis/composer-normalize": "^2.47.0",
"php-standard-library/phpstan-extension": "^2.0.0",
"php-standard-library/psalm-plugin": "^2.3",
"phpstan/phpstan": "^2.1.2",
"phpstan/phpstan-deprecation-rules": "^2.0.1",
"phpstan/phpstan-phpunit": "^2.0.4",
"phpstan/phpstan-strict-rules": "^2.0.3",
"phpstan/phpstan-symfony": "^2.0.2",
"phpunit/phpunit": "^11.5.7",
"psalm/plugin-phpunit": "^0.19.2",
"phpstan/phpstan": "^2.1.17",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
"phpstan/phpstan-phpunit": "^2.0.6",
"phpstan/phpstan-strict-rules": "^2.0.4",
"phpstan/phpstan-symfony": "^2.0.6",
"phpunit/phpunit": "^12.2.6",
"psalm/plugin-phpunit": "^0.19.5",
"roave/security-advisories": "dev-latest",
"twig/twig": "^2.0 || ^3.19",
"vimeo/psalm": "^6.0.0"
"twig/twig": "^3.21",
"vimeo/psalm": "^6.12.1"
},
"suggest": {
"twig/twig": "Allow to use the cloudinary_url function/filter"
Expand Down
32 changes: 18 additions & 14 deletions config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
parameters:
ignoreErrors:
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
count: 1
path: ../src/Command/DeleteCommand.php

-
message: "#^Parameter \\#1 \\$prefix of method Cloudinary\\\\Api\\\\Admin\\\\AdminApi\\:\\:deleteAssetsByPrefix\\(\\) expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$prefix of method Cloudinary\\Api\\Admin\\AdminApi\:\:deleteAssetsByPrefix\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/DeleteCommand.php

-
message: "#^Parameter \\#1 \\$publicIds of method Cloudinary\\\\Api\\\\Admin\\\\AdminApi\\:\\:deleteAssets\\(\\) expects array\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$publicIds of method Cloudinary\\Api\\Admin\\AdminApi\:\:deleteAssets\(\) expects array\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/DeleteCommand.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function Psl\\\\Str\\\\format expects float\\|int\\|string, mixed given\\.$#"
message: '#^Parameter \#2 \.\.\.\$args of function Psl\\Str\\format expects float\|int\|string, mixed given\.$#'
identifier: argument.type
count: 2
path: ../src/Command/DeleteCommand.php

-
message: "#^Parameter \\#1 \\$publicId of method Cloudinary\\\\Api\\\\Admin\\\\AdminApi\\:\\:asset\\(\\) expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$publicId of method Cloudinary\\Api\\Admin\\AdminApi\:\:asset\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/InfoCommand.php

-
message: "#^Parameter \\#2 \\$derivedResources of method Speicher210\\\\CloudinaryBundle\\\\Command\\\\InfoCommand\\:\\:renderDerivedResources\\(\\) expects array\\<array\\{id\\: string, format\\: string, bytes\\: int, transformation\\: string, url\\: string\\}\\>, mixed given\\.$#"
message: '#^Parameter \#2 \$derivedResources of method Speicher210\\CloudinaryBundle\\Command\\InfoCommand\:\:renderDerivedResources\(\) expects array\<array\{id\: string, format\: string, bytes\: int, transformation\: string, url\: string\}\>, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/InfoCommand.php

-
message: "#^In method \"Speicher210\\\\CloudinaryBundle\\\\Command\\\\UploadCommand\\:\\:execute\", caught \"Throwable\" must be rethrown\\. Either catch a more specific exception or add a \"throw\" clause in the \"catch\" block to propagate the exception\\. More info\\: http\\://bit\\.ly/failloud$#"
message: '#^Parameter \#1 \$dirs of method Symfony\\Component\\Finder\\Finder\:\:in\(\) expects array\<string\>\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/UploadCommand.php

-
message: "#^Parameter \\#1 \\$dirs of method Symfony\\\\Component\\\\Finder\\\\Finder\\:\\:in\\(\\) expects array\\<string\\>\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$node of function Psl\\Filesystem\\get_filename expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/UploadCommand.php

-
message: "#^Parameter \\#1 \\$node of function Psl\\\\Filesystem\\\\get_filename expects non\\-empty\\-string, string given\\.$#"
count: 1
path: ../src/Command/UploadCommand.php

-
message: "#^Parameter \\#1 \\$patterns of method Symfony\\\\Component\\\\Finder\\\\Finder\\:\\:name\\(\\) expects array\\<string\\>\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$patterns of method Symfony\\Component\\Finder\\Finder\:\:name\(\) expects array\<string\>\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../src/Command/UploadCommand.php
17 changes: 16 additions & 1 deletion config/psalm.baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="6.4.0@04f312ac6ea48ba1c3e5db4d815bf6d74641c0ee">
<files psalm-version="6.12.1@e71404b0465be25cf7f8a631b298c01c5ddd864f">
<file src="../src/Cloudinary/Admin.php">
<ClassMustBeFinal>
<code><![CDATA[Admin]]></code>
</ClassMustBeFinal>
</file>
<file src="../src/Cloudinary/Cloudinary.php">
<ClassMustBeFinal>
<code><![CDATA[Cloudinary]]></code>
</ClassMustBeFinal>
</file>
<file src="../src/Cloudinary/Uploader.php">
<ClassMustBeFinal>
<code><![CDATA[Uploader]]></code>
</ClassMustBeFinal>
</file>
<file src="../src/Command/InfoCommand.php">
<InvalidArrayOffset>
<code><![CDATA[$pre[$exp - 1]]]></code>
Expand Down
4 changes: 4 additions & 0 deletions src/Cloudinary/Cloudinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

namespace Speicher210\CloudinaryBundle\Cloudinary;

use Override;

class Cloudinary extends \Cloudinary\Cloudinary
{
#[Override]
public function adminApi(): Admin
{
return new Admin($this->configuration);
}

#[Override]
public function uploadApi(): Uploader
{
return new Uploader($this->configuration);
Expand Down
3 changes: 3 additions & 0 deletions src/Command/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Speicher210\CloudinaryBundle\Command;

use Cloudinary\Api\ApiResponse;
use Override;
use Psl\Str;
use Speicher210\CloudinaryBundle\Cloudinary\Admin;
use Symfony\Component\Console\Command\Command;
Expand All @@ -24,6 +25,7 @@ public function __construct(Admin $cloudinary)
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this
Expand All @@ -43,6 +45,7 @@ protected function configure(): void
);
}

#[Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
$symfonyStyle = new SymfonyStyle($input, $output);
Expand Down
3 changes: 3 additions & 0 deletions src/Command/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Speicher210\CloudinaryBundle\Command;

use Cloudinary\Api\ApiResponse;
use Override;
use Speicher210\CloudinaryBundle\Cloudinary\Admin;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\TableCell;
Expand All @@ -29,6 +30,7 @@ public function __construct(Admin $cloudinary)
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this
Expand All @@ -37,6 +39,7 @@ protected function configure(): void
->addArgument('public_id', InputArgument::REQUIRED, 'The public ID of the resource.');
}

#[Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
$symfonyStyle = new SymfonyStyle($input, $output);
Expand Down
3 changes: 3 additions & 0 deletions src/Command/UploadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Speicher210\CloudinaryBundle\Command;

use Cloudinary\Api\ApiResponse;
use Override;
use Psl\Filesystem;
use Psl\Type;
use Speicher210\CloudinaryBundle\Cloudinary\Uploader;
Expand All @@ -29,6 +30,7 @@ public function __construct(Uploader $uploader)
parent::__construct();
}

#[Override]
protected function configure(): void
{
$this
Expand All @@ -51,6 +53,7 @@ protected function configure(): void
);
}

#[Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
$symfonyStyle = new SymfonyStyle($input, $output);
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Compiler/RemoveTwigExtensionPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Speicher210\CloudinaryBundle\DependencyInjection\Compiler;

use Override;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -12,6 +13,7 @@
*/
final class RemoveTwigExtensionPass implements CompilerPassInterface
{
#[Override]
public function process(ContainerBuilder $container): void
{
if ($container->hasDefinition('twig')) {
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

namespace Speicher210\CloudinaryBundle\DependencyInjection;

use Override;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

final class Configuration implements ConfigurationInterface
{
#[Override]
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('speicher210_cloudinary');
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Speicher210CloudinaryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Speicher210\CloudinaryBundle\DependencyInjection;

use Override;
use Speicher210\CloudinaryBundle\Factory\CloudinaryFactory;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -15,6 +16,7 @@ final class Speicher210CloudinaryExtension extends ConfigurableExtension
/**
* @param array<mixed> $mergedConfig
*/
#[Override]
protected function loadInternal(array $mergedConfig, ContainerBuilder $container): void
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/InvalidCloudinaryUrlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use InvalidArgumentException;

class InvalidCloudinaryUrlException extends InvalidArgumentException
final class InvalidCloudinaryUrlException extends InvalidArgumentException
{
public function __construct()
{
Expand Down
Loading