Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drop support for Laminas 2, remove last createService methods #21

Merged
merged 1 commit into from
Jan 15, 2024
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
19 changes: 1 addition & 18 deletions src/Router/RouterFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<?php

/**
* Custom Router Factory for api routing
*/

namespace Dvsa\Olcs\Transfer\Router;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;

/**
* Custom Router Factory for api routing
Expand Down Expand Up @@ -38,16 +33,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$factory = sprintf('%s::factory', $routerClass);
return call_user_func($factory, $routerConfig);
}

/**
* @param ServiceLocatorInterface $serviceLocator
* @param $cName
* @param $rName
* @return mixed
* @deprecated Not needed after Laminas 3
*/
public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
{
return $this($serviceLocator, null);
}
}
15 changes: 1 addition & 14 deletions src/Util/Annotation/AnnotationBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Dvsa\Olcs\Transfer\Util\Annotation;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;

/**
* Class AnnotationBuilderFactory - injects validator manager and filter manager to allow transfer objects to use
Expand All @@ -21,16 +20,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o

return $service;
}

/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
* @deprecated Not needed for Laminas 3
*/
public function createService(ServiceLocatorInterface $serviceLocator): AnnotationBuilder
{
return $this($serviceLocator, AnnotationBuilder::class);
}
}
23 changes: 1 addition & 22 deletions src/Validators/XmlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,16 @@
namespace Dvsa\Olcs\Transfer\Validators;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\Xml\Security as XmlSecurityValidator;

/**
* Class XmlFactory
* @package Dvsa\Olcs\Transfer\Validators
*/
class XmlFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): Xml
{
if (method_exists($container, 'getServiceLocator') && $container->getServiceLocator()) {
$container = $container->getServiceLocator();
}

$service = new Xml();
$service->setSecurityValidator($container->get(XmlSecurityValidator::class));

return $service;
}

/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
* @deprecated Not needed in Laminas 3
*/
public function createService(ServiceLocatorInterface $serviceLocator): Xml
{
return $this($serviceLocator, Xml::class);
}
}
Loading