Skip to content

Commit

Permalink
Merge pull request #71 from acelaya-forks/feature/update-deps
Browse files Browse the repository at this point in the history
Feature/update deps
  • Loading branch information
acelaya authored Jul 22, 2024
2 parents 1cb0589 + b896266 commit e5f38d1
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 19 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]
### Added
* Add support for `laminas/laminas-servicemanager` v4.x.

### Changed
* Update dependencies.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*


## [5.3.2] - 2024-04-12
### Added
* *Nothing*
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
"require": {
"php": "^8.2",
"ext-json": "*",
"laminas/laminas-servicemanager": "^3.22",
"league/csv": "^9.14",
"shlinkio/shlink-config": "^3.0 || ^2.5",
"shlinkio/shlink-json": "^1.0",
"symfony/console": "^7.0 || ^6.4"
"laminas/laminas-servicemanager": "^4.2 || ^3.22",
"league/csv": "^9.16",
"shlinkio/shlink-config": "^3.1",
"shlinkio/shlink-json": "^1.1",
"symfony/console": "^7.1"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.8",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^11.0",
"psr/http-factory": "^1.0",
"guzzlehttp/guzzle": "^7.9",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-phpunit": "^1.4",
"phpunit/phpunit": "^11.2",
"psr/http-factory": "^1.1",
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.3.0",
"symfony/var-dumper": "^7.0 || ^6.4"
"symfony/var-dumper": "^7.1"
},
"suggest": {
"psr/http-client": "If you want to be able to import URLs from Bit.ly, YOURLS, Kutt.it or another Shlink instance",
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.override.yml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

version: '3'

services:
shlink_importer_php:
user: 1000:1000
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

version: '3'

services:
shlink_importer_php:
container_name: shlink_importer_php
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
parameters:
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- identifier: missingType.iterableValue
23 changes: 23 additions & 0 deletions src/Params/ConsoleHelper/ConsoleHelperManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,31 @@
namespace Shlinkio\Shlink\Importer\Params\ConsoleHelper;

use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\Exception\InvalidServiceException;

use function get_debug_type;
use function sprintf;

/**
* @extends AbstractPluginManager<ParamsConsoleHelperInterface>
* @todo Extend from AbstractSingleInstancePluginManager once servicemanager 3 is no longer supported
*/
class ConsoleHelperManager extends AbstractPluginManager implements ConsoleHelperManagerInterface
{
/** @var class-string<ParamsConsoleHelperInterface> */
protected $instanceOf = ParamsConsoleHelperInterface::class; // phpcs:ignore

public function validate(mixed $instance): void
{
if ($instance instanceof $this->instanceOf) {
return;
}

throw new InvalidServiceException(sprintf(
'Plugin manager "%s" expected an instance of type "%s", but "%s" was received',
static::class,
$this->instanceOf,
get_debug_type($instance),
));
}
}
23 changes: 23 additions & 0 deletions src/Strategy/ImporterStrategyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,31 @@
namespace Shlinkio\Shlink\Importer\Strategy;

use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\Exception\InvalidServiceException;

use function get_debug_type;
use function sprintf;

/**
* @extends AbstractPluginManager<ImporterStrategyInterface>
* @todo Extend from AbstractSingleInstancePluginManager once servicemanager 3 is no longer supported
*/
class ImporterStrategyManager extends AbstractPluginManager implements ImporterStrategyManagerInterface
{
/** @var class-string<ImporterStrategyInterface> */
protected $instanceOf = ImporterStrategyInterface::class; // phpcs:ignore

public function validate(mixed $instance): void
{
if ($instance instanceof $this->instanceOf) {
return;
}

throw new InvalidServiceException(sprintf(
'Plugin manager "%s" expected an instance of type "%s", but "%s" was received',
static::class,
$this->instanceOf,
get_debug_type($instance),
));
}
}

0 comments on commit e5f38d1

Please sign in to comment.