From 9d9f893ea36eb4f6716f0d55815146cdca506bef Mon Sep 17 00:00:00 2001 From: carl-boisvert Date: Fri, 14 Jul 2017 13:54:21 -0400 Subject: [PATCH] Updated Silex to ~2.0. The ServiceProviderInterface has change namespace in version ~2.0. It's now: use Pimple\ServiceProviderInterface; Updated the StatsdServiceProvider to reflect that change --- composer.json | 2 +- src/Silex/Provider/StatsdServiceProvider.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index daa70ab..ff68989 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ } ], "require-dev": { - "silex/silex": "~1.0", + "silex/silex": "~2.0", "phpunit/phpunit": "~4.0" }, "autoload": { diff --git a/src/Silex/Provider/StatsdServiceProvider.php b/src/Silex/Provider/StatsdServiceProvider.php index 0f10a01..070ba69 100644 --- a/src/Silex/Provider/StatsdServiceProvider.php +++ b/src/Silex/Provider/StatsdServiceProvider.php @@ -3,8 +3,10 @@ namespace League\StatsD\Silex\Provider; use Silex\Application; -use Silex\ServiceProviderInterface; +use Pimple\Container; +use Pimple\ServiceProviderInterface; use League\StatsD\Client as StatsdClient; +use Symfony\Component\HttpKernel\Tests\Controller; /** * StatsD Service provider for Silex @@ -16,12 +18,11 @@ class StatsdServiceProvider implements ServiceProviderInterface /** * Register Service Provider - * @param Application $app Silex application instance + * @param Container $app Pimple container instance */ - public function register(Application $app) + public function register(Container $app) { - $app['statsd'] = $app->share( - function () use ($app) { + $app['statsd'] = function () use ($app) { // Set Default host and port $options = array(); @@ -46,8 +47,7 @@ function () use ($app) { $statsd->configure($options); return $statsd; - } - ); + }; }