Skip to content

Commit 039829a

Browse files
authored
Merge pull request #1 from moufmouf/service-providers-0.4
Migrating to service-providers 0.4.
2 parents a1502d4 + f506b32 commit 039829a

File tree

6 files changed

+14
-305
lines changed

6 files changed

+14
-305
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.idea
22
vendor
3-
.puli
43
composer.lock
54
build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ composer require thecodingmachine/stash-universal-module
1414

1515
Once installed, you need to register the [`TheCodingMachine\StashServiceProvider`](src/StashServiceProvider.php) into your container.
1616

17-
If your container supports Puli integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.
17+
If your container supports thecodingmachine/discovery integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.
1818

1919
## Introduction
2020

composer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
},
1111
"require": {
1212
"php": ">=7.0",
13-
"container-interop/service-provider": "~0.3.0",
14-
"thecodingmachine/common-factories": "^0.3",
13+
"container-interop/service-provider": "^0.4",
14+
"thecodingmachine/common-factories": "^0.4",
1515
"tedivm/stash": "~0.14.0"
1616
},
1717
"require-dev": {
18-
"puli/cli":"^1.0",
19-
"puli/composer-plugin": "^1.0",
20-
"mnapoli/simplex": "~0.2.0",
18+
"mnapoli/simplex": "~0.3.0",
2119
"phpunit/phpunit": "^5.0",
2220
"satooshi/php-coveralls": "^1.0"
2321
},

discovery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"Interop\\Container\\ServiceProvider": "TheCodingMachine\\StashServiceProvider"
2+
"Interop\\Container\\ServiceProviderInterface": "TheCodingMachine\\StashServiceProvider"
33
}

puli.json

Lines changed: 0 additions & 291 deletions
This file was deleted.

src/StashServiceProvider.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace TheCodingMachine;
44

5-
use Interop\Container\ContainerInterface;
5+
use Psr\Container\ContainerInterface;
66
use Interop\Container\Factories\Alias;
77
use Interop\Container\Factories\Parameter;
8-
use Interop\Container\ServiceProvider;
8+
use Interop\Container\ServiceProviderInterface;
99
use Psr\Cache\CacheItemPoolInterface;
1010
use Stash\Driver\Apc;
1111
use Stash\Driver\BlackHole;
@@ -24,7 +24,7 @@
2424
use Twig_Loader_Chain;
2525
use Twig_Loader_Filesystem;
2626

27-
class StashServiceProvider implements ServiceProvider
27+
class StashServiceProvider implements ServiceProviderInterface
2828
{
2929
const PACKAGE = 'thecodingmachine.stash-universal-module';
3030

@@ -38,7 +38,7 @@ public function __construct(string $suffix = null)
3838
$this->suffix = $suffix ? '.'.$suffix : '';
3939
}
4040

41-
public function getServices()
41+
public function getFactories()
4242
{
4343
return [
4444
'stash'.$this->suffix.'.composite.options' => function(ContainerInterface $container) : array
@@ -105,6 +105,11 @@ public function getServices()
105105
];
106106
}
107107

108+
public function getExtensions()
109+
{
110+
return [];
111+
}
112+
108113
/**
109114
* Returns the entry named PACKAGE.$name, of simply $name if PACKAGE.$name is not found.
110115
*
@@ -129,6 +134,4 @@ public static function createBlackHoleDriver() : BlackHole
129134
{
130135
return new BlackHole();
131136
}
132-
133-
134137
}

0 commit comments

Comments
 (0)