GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Module::onBootstrap()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
/**
4
 * Steven Bühner
5
 * 
6
 * @copyright Steven Bühner
7
 * @license MIT
8
 */
9
namespace HtpasswdManager;
10
11
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
12
use Zend\Mvc\ModuleRouteListener;
13
use Zend\Mvc\MvcEvent;
14
use HtpasswdManager\Service\HtpasswdService;
15
use HtpasswdManager\Service\UserService;
16
17
class Module implements AutoloaderProviderInterface {
18
19
	public function getAutoloaderConfig() {
20
		return array( 
21
				'Zend\Loader\StandardAutoloader' => array( 
22
						'namespaces' => array( 
23
								// if we're in a namespace deeper than one level we need to fix the \ in the path
24
								__NAMESPACE__ => __DIR__ . '/src/' . str_replace ( '\\', '/', __NAMESPACE__ ) 
25
						) 
26
				) 
27
		);
28
	}
29
30
	public function getConfig() {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
31
		return include __DIR__ . '/config/module.config.php';
32
	}
33
34
	public function onBootstrap(MvcEvent $e) {
35
		// You may not need to do this if you're doing it elsewhere in your
36
		// application
37
		$eventManager = $e->getApplication ()->getEventManager ();
38
		$moduleRouteListener = new ModuleRouteListener ();
39
		$moduleRouteListener->attach ( $eventManager );
40
	}
41
42
	public function getServiceConfig() {
43
		return array( 
44
				'factories' => array( 
45
						'HtpasswdManager\Service\HtpasswdService' => function ($sm) {
46
							$config = $sm->get ( 'Config' );
47
							
48
							if (! isset ( $config ['HtpasswdManager'] ) || ! is_array ( $config ['HtpasswdManager'] ) || ! isset ( $config ['HtpasswdManager'] ['htpasswd'] ) || empty ( $config ['HtpasswdManager'] ['htpasswd'] )) {
49
								throw new \Exception ( 'HtpasswdManager Config not found' );
50
							}
51
							
52
							$htpasswd_filename = $config ['HtpasswdManager'] ['htpasswd'];
53
							$service = new HtpasswdService ( $htpasswd_filename );
54
							
55
							return $service;
56
						} 
57
				) 
58
		);
59
	}
60
61
}