|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace MaglMarkdown\Adapter; |
|
4
|
|
|
|
|
5
|
|
|
use Interop\Container\ContainerInterface; |
|
6
|
|
|
use Interop\Container\Exception\ContainerException; |
|
7
|
|
|
use Zend\ServiceManager\Exception\ServiceNotCreatedException; |
|
8
|
|
|
use Zend\ServiceManager\Exception\ServiceNotFoundException; |
|
9
|
|
|
use Zend\ServiceManager\FactoryInterface; |
|
10
|
|
|
use Zend\ServiceManager\ServiceLocatorInterface; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Class GithubMarkdownOptionsFactory |
|
14
|
|
|
* |
|
15
|
|
|
* @package MaglMarkdown\Adapter |
|
16
|
|
|
*/ |
|
17
|
|
View Code Duplication |
class GithubMarkdownOptionsFactory implements FactoryInterface |
|
|
|
|
|
|
18
|
|
|
{ |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Create service |
|
22
|
|
|
* |
|
23
|
|
|
* @param ServiceLocatorInterface $serviceLocator |
|
24
|
|
|
* @return Options\GithubMarkdownOptions |
|
25
|
|
|
*/ |
|
26
|
|
|
public function createService(ServiceLocatorInterface $serviceLocator) |
|
27
|
|
|
{ |
|
28
|
|
|
return $this($serviceLocator, Options\GithubMarkdownOptions::class); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Create an object |
|
33
|
|
|
* |
|
34
|
|
|
* @param ContainerInterface $container |
|
35
|
|
|
* @param string $requestedName |
|
36
|
|
|
* @param null|array $options |
|
37
|
|
|
* @return Options\GithubMarkdownOptions |
|
38
|
|
|
* @throws \Interop\Container\Exception\NotFoundException |
|
39
|
|
|
* @throws ServiceNotFoundException if unable to resolve the service. |
|
40
|
|
|
* @throws ServiceNotCreatedException if an exception is raised when |
|
41
|
|
|
* creating a service. |
|
42
|
|
|
* @throws ContainerException if any other error occurs |
|
43
|
|
|
*/ |
|
44
|
1 |
|
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
45
|
|
|
{ |
|
46
|
1 |
|
$config = $container->get('config'); |
|
47
|
|
|
|
|
48
|
1 |
|
return new Options\GithubMarkdownOptions($config['magl_markdown']['adapter_config']['github_markdown']); |
|
49
|
|
|
} |
|
50
|
|
|
} |
|
51
|
|
|
|
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.