Skip to content

Commit

Permalink
Merge pull request #1 from Orkin/develop
Browse files Browse the repository at this point in the history
[REMOVE] zend service manager dependency
  • Loading branch information
Orkin authored Apr 13, 2019
2 parents 8a40457 + 1ccca4d commit aff6576
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 31 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"sentry/sentry": "^1.7",
"zendframework/zend-stratigility": "^3.0",
"zendframework/zend-servicemanager": "^3.3"
"psr/container": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 5 additions & 10 deletions src/Listener/ListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@

namespace Stickee\Sentry\Listener;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use Psr\Container\ContainerInterface;

class ListenerFactory implements FactoryInterface
class ListenerFactory
{
/**
* Create an object
*
* @param \Interop\Container\ContainerInterface $container
* @param string $requestedName
* @param array|null $options
* @param ContainerInterface $container
*
* @return \Stickee\Sentry\Listener\Listener
* @return Listener
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
public function __invoke(ContainerInterface $container)
{
/** @var \Raven_Client $raven */
$raven = $container->get(\Raven_Client::class);
Expand Down
15 changes: 7 additions & 8 deletions src/ListenerDelegator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

namespace Stickee\Sentry;

use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;
use Stickee\Sentry\Listener\Listener;
use Zend\ServiceManager\Factory\DelegatorFactoryInterface;
use Zend\Stratigility\Middleware\ErrorHandler;

class ListenerDelegator implements DelegatorFactoryInterface
;

class ListenerDelegator
{
/**
* A factory that creates delegates of a given service
Expand All @@ -19,16 +21,13 @@ class ListenerDelegator implements DelegatorFactoryInterface
* @param callable $callback
* @param null|array $options
*
* @return \Zend\Stratigility\Middleware\ErrorHandler
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @return ErrorHandler
*/
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
{
$listener = $container->get(Listener::class);

/** @var \Zend\Stratigility\Middleware\ErrorHandler $errorHandler */
/** @var ErrorHandler $errorHandler */
$errorHandler = $callback();

$errorHandler->attachListener($listener);
Expand Down
15 changes: 3 additions & 12 deletions src/Raven/RavenFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,19 @@

namespace Stickee\Sentry\Raven;

use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Psr\Container\ContainerInterface;
use Raven_Client;
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\Factory\FactoryInterface;

class RavenFactory implements FactoryInterface
class RavenFactory
{
/**
* Create an object
*
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
*
* @return Raven_Client
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
public function __invoke(ContainerInterface $container)
{
$config = $container->get('config');

Expand Down

0 comments on commit aff6576

Please sign in to comment.