@@ -31,6 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
33 | 33 | * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
34 | + * @param string $field |
|
34 | 35 | */ |
35 | 36 | public function iFillInSelect2Field($field, $value) |
36 | 37 | { |
@@ -42,7 +43,7 @@ discard block |
||
42 | 43 | |
43 | 44 | /** |
44 | 45 | * @When I fill in select2 search :field with :search and I choose :choice |
45 | - * @param $field |
|
46 | + * @param string $field |
|
46 | 47 | * @param $value |
47 | 48 | */ |
48 | 49 | public function iFillInSelect2FieldWith($field,$search,$choice=null) |
@@ -24,130 +24,130 @@ |
||
24 | 24 | */ |
25 | 25 | class Select2Context extends RawMinkContext implements Context |
26 | 26 | { |
27 | - protected $timeout = 5; |
|
27 | + protected $timeout = 5; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Fills in Select2 field with specified |
|
31 | - * |
|
32 | - * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
|
33 | - * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
|
34 | - */ |
|
35 | - public function iFillInSelect2Field($field, $value) |
|
36 | - { |
|
37 | - $page = $this->getSession()->getPage(); |
|
29 | + /** |
|
30 | + * Fills in Select2 field with specified |
|
31 | + * |
|
32 | + * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
|
33 | + * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
|
34 | + */ |
|
35 | + public function iFillInSelect2Field($field, $value) |
|
36 | + { |
|
37 | + $page = $this->getSession()->getPage(); |
|
38 | 38 | |
39 | - $this->openField($page, $field); |
|
40 | - $this->selectValue($page, $field, $value, $this->timeout); |
|
41 | - } |
|
39 | + $this->openField($page, $field); |
|
40 | + $this->selectValue($page, $field, $value, $this->timeout); |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @When I fill in select2 search :field with :search and I choose :choice |
|
45 | - * @param $field |
|
46 | - * @param $value |
|
47 | - */ |
|
48 | - public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
49 | - { |
|
50 | - $page = $this->getSession()->getPage(); |
|
51 | - $this->openField($page, $field); |
|
52 | - $this->fillSearchField($page,$field,$search); |
|
53 | - $this->selectValue($page, $field, $choice); |
|
54 | - } |
|
43 | + /** |
|
44 | + * @When I fill in select2 search :field with :search and I choose :choice |
|
45 | + * @param $field |
|
46 | + * @param $value |
|
47 | + */ |
|
48 | + public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
49 | + { |
|
50 | + $page = $this->getSession()->getPage(); |
|
51 | + $this->openField($page, $field); |
|
52 | + $this->fillSearchField($page,$field,$search); |
|
53 | + $this->selectValue($page, $field, $choice); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Fill Select2 search field |
|
58 | - * |
|
59 | - * @param DocumentElement $page |
|
60 | - * @param string $field |
|
61 | - * @param string $value |
|
62 | - * @throws \Exception |
|
63 | - */ |
|
64 | - private function fillSearchField(DocumentElement $page, $field, $value) |
|
65 | - { |
|
66 | - $driver = $this->getSession()->getDriver(); |
|
67 | - if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
|
68 | - // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
|
56 | + /** |
|
57 | + * Fill Select2 search field |
|
58 | + * |
|
59 | + * @param DocumentElement $page |
|
60 | + * @param string $field |
|
61 | + * @param string $value |
|
62 | + * @throws \Exception |
|
63 | + */ |
|
64 | + private function fillSearchField(DocumentElement $page, $field, $value) |
|
65 | + { |
|
66 | + $driver = $this->getSession()->getDriver(); |
|
67 | + if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
|
68 | + // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
|
69 | 69 | |
70 | - $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
71 | - $xpath = $element->getXpath(); |
|
72 | - $select2Input = $this->getSession() |
|
73 | - ->getDriver() |
|
74 | - ->getWebDriverSession() |
|
75 | - ->element('xpath',$xpath) |
|
76 | - //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
|
77 | - ; |
|
78 | - if (!$select2Input) { |
|
79 | - throw new \Exception(sprintf('No field "%s" found', $field)); |
|
80 | - } |
|
70 | + $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
71 | + $xpath = $element->getXpath(); |
|
72 | + $select2Input = $this->getSession() |
|
73 | + ->getDriver() |
|
74 | + ->getWebDriverSession() |
|
75 | + ->element('xpath',$xpath) |
|
76 | + //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
|
77 | + ; |
|
78 | + if (!$select2Input) { |
|
79 | + throw new \Exception(sprintf('No field "%s" found', $field)); |
|
80 | + } |
|
81 | 81 | |
82 | - $select2Input->postValue(['value' => [$value]]); |
|
83 | - } else { |
|
84 | - $select2Input = $page->find('css', '.select2-search__field'); |
|
85 | - if (!$select2Input) { |
|
86 | - throw new \Exception(sprintf('No input found for "%s"', $field)); |
|
87 | - } |
|
88 | - $select2Input->setValue($value); |
|
89 | - } |
|
82 | + $select2Input->postValue(['value' => [$value]]); |
|
83 | + } else { |
|
84 | + $select2Input = $page->find('css', '.select2-search__field'); |
|
85 | + if (!$select2Input) { |
|
86 | + throw new \Exception(sprintf('No input found for "%s"', $field)); |
|
87 | + } |
|
88 | + $select2Input->setValue($value); |
|
89 | + } |
|
90 | 90 | |
91 | - $this->waitForLoadingResults($this->timeout); |
|
92 | - } |
|
91 | + $this->waitForLoadingResults($this->timeout); |
|
92 | + } |
|
93 | 93 | |
94 | - /** |
|
95 | - * Select value in choice list |
|
96 | - * |
|
97 | - * @param DocumentElement $page |
|
98 | - * @param string $field |
|
99 | - * @param string $value |
|
100 | - * @param int $time |
|
101 | - * @throws \Exception |
|
102 | - */ |
|
103 | - private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
104 | - { |
|
105 | - $this->waitForLoadingResults($time); |
|
94 | + /** |
|
95 | + * Select value in choice list |
|
96 | + * |
|
97 | + * @param DocumentElement $page |
|
98 | + * @param string $field |
|
99 | + * @param string $value |
|
100 | + * @param int $time |
|
101 | + * @throws \Exception |
|
102 | + */ |
|
103 | + private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
104 | + { |
|
105 | + $this->waitForLoadingResults($time); |
|
106 | 106 | |
107 | - $chosenResults = $page->findAll('css', '.select2-results li'); |
|
108 | - foreach ($chosenResults as $result) { |
|
109 | - $text = $result->getText(); |
|
110 | - if (false!==strpos($text,$value)) { |
|
111 | - $result->click(); |
|
112 | - return; |
|
113 | - } |
|
114 | - } |
|
107 | + $chosenResults = $page->findAll('css', '.select2-results li'); |
|
108 | + foreach ($chosenResults as $result) { |
|
109 | + $text = $result->getText(); |
|
110 | + if (false!==strpos($text,$value)) { |
|
111 | + $result->click(); |
|
112 | + return; |
|
113 | + } |
|
114 | + } |
|
115 | 115 | |
116 | - throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field)); |
|
117 | - } |
|
116 | + throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field)); |
|
117 | + } |
|
118 | 118 | |
119 | - private function openField(DocumentElement $page, $field) |
|
120 | - { |
|
121 | - $inputField = $page->find('css',$field); |
|
122 | - if(!$inputField){ |
|
123 | - $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
|
124 | - $inputField = $page->find('css', $fieldName); |
|
125 | - } |
|
126 | - if (!$inputField) { |
|
127 | - throw new \Exception(sprintf('No field "%s" found', $field)); |
|
128 | - } |
|
119 | + private function openField(DocumentElement $page, $field) |
|
120 | + { |
|
121 | + $inputField = $page->find('css',$field); |
|
122 | + if(!$inputField){ |
|
123 | + $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
|
124 | + $inputField = $page->find('css', $fieldName); |
|
125 | + } |
|
126 | + if (!$inputField) { |
|
127 | + throw new \Exception(sprintf('No field "%s" found', $field)); |
|
128 | + } |
|
129 | 129 | |
130 | - $choice = $inputField->find('css', '.select2-selection'); |
|
131 | - if (!$choice) { |
|
132 | - throw new \Exception(sprintf('No select2 choice found for "%s"', $field)); |
|
133 | - } |
|
134 | - $choice->press(); |
|
135 | - } |
|
130 | + $choice = $inputField->find('css', '.select2-selection'); |
|
131 | + if (!$choice) { |
|
132 | + throw new \Exception(sprintf('No select2 choice found for "%s"', $field)); |
|
133 | + } |
|
134 | + $choice->press(); |
|
135 | + } |
|
136 | 136 | |
137 | - /** |
|
138 | - * Wait the end of fetching Select2 results |
|
139 | - * |
|
140 | - * @param int $time Time to wait in seconds |
|
141 | - */ |
|
142 | - private function waitForLoadingResults($time) |
|
143 | - { |
|
144 | - for ($i = 0; $i < $time; $i++) { |
|
145 | - if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) { |
|
146 | - return; |
|
147 | - } |
|
137 | + /** |
|
138 | + * Wait the end of fetching Select2 results |
|
139 | + * |
|
140 | + * @param int $time Time to wait in seconds |
|
141 | + */ |
|
142 | + private function waitForLoadingResults($time) |
|
143 | + { |
|
144 | + for ($i = 0; $i < $time; $i++) { |
|
145 | + if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) { |
|
146 | + return; |
|
147 | + } |
|
148 | 148 | |
149 | - sleep(1); |
|
150 | - } |
|
151 | - } |
|
149 | + sleep(1); |
|
150 | + } |
|
151 | + } |
|
152 | 152 | |
153 | 153 | } |
154 | 154 | \ No newline at end of file |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | * @param $field |
46 | 46 | * @param $value |
47 | 47 | */ |
48 | - public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
48 | + public function iFillInSelect2FieldWith($field, $search, $choice = null) |
|
49 | 49 | { |
50 | 50 | $page = $this->getSession()->getPage(); |
51 | 51 | $this->openField($page, $field); |
52 | - $this->fillSearchField($page,$field,$search); |
|
52 | + $this->fillSearchField($page, $field, $search); |
|
53 | 53 | $this->selectValue($page, $field, $choice); |
54 | 54 | } |
55 | 55 | |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
68 | 68 | // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
69 | 69 | |
70 | - $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
70 | + $element = $page->find('css', '.select2-container--open .select2-search__field'); |
|
71 | 71 | $xpath = $element->getXpath(); |
72 | 72 | $select2Input = $this->getSession() |
73 | 73 | ->getDriver() |
74 | 74 | ->getWebDriverSession() |
75 | - ->element('xpath',$xpath) |
|
75 | + ->element('xpath', $xpath) |
|
76 | 76 | //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
77 | 77 | ; |
78 | 78 | if (!$select2Input) { |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | * @param int $time |
101 | 101 | * @throws \Exception |
102 | 102 | */ |
103 | - private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
103 | + private function selectValue(DocumentElement $page, $field, $value, $time = 5) |
|
104 | 104 | { |
105 | 105 | $this->waitForLoadingResults($time); |
106 | 106 | |
107 | 107 | $chosenResults = $page->findAll('css', '.select2-results li'); |
108 | 108 | foreach ($chosenResults as $result) { |
109 | 109 | $text = $result->getText(); |
110 | - if (false!==strpos($text,$value)) { |
|
110 | + if (false !== strpos($text, $value)) { |
|
111 | 111 | $result->click(); |
112 | 112 | return; |
113 | 113 | } |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | |
119 | 119 | private function openField(DocumentElement $page, $field) |
120 | 120 | { |
121 | - $inputField = $page->find('css',$field); |
|
122 | - if(!$inputField){ |
|
121 | + $inputField = $page->find('css', $field); |
|
122 | + if (!$inputField) { |
|
123 | 123 | $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
124 | 124 | $inputField = $page->find('css', $fieldName); |
125 | 125 | } |
@@ -23,31 +23,31 @@ |
||
23 | 23 | */ |
24 | 24 | class TracyListener implements ListenerAggregateInterface |
25 | 25 | { |
26 | - use ListenerAggregateTrait; |
|
26 | + use ListenerAggregateTrait; |
|
27 | 27 | |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | - */ |
|
32 | - public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | - { |
|
34 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | - $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + * @see \Zend\EventManager\ListenerAggregateInterface::attach() |
|
31 | + */ |
|
32 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
33 | + { |
|
34 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleError'], $priority); |
|
35 | + $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'handleError'], $priority); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param MvcEvent $e |
|
40 | - */ |
|
41 | - public function handleError(MvcEvent $e) |
|
42 | - { |
|
43 | - if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | - if (Debugger::$productionMode) { |
|
45 | - // log an exception in production environment (this will send email as well if email address is set) |
|
46 | - Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | - } else { |
|
48 | - // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | - throw $e->getParam('exception'); |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
38 | + /** |
|
39 | + * @param MvcEvent $e |
|
40 | + */ |
|
41 | + public function handleError(MvcEvent $e) |
|
42 | + { |
|
43 | + if ($e->getError() == \Zend\Mvc\Application::ERROR_EXCEPTION) { |
|
44 | + if (Debugger::$productionMode) { |
|
45 | + // log an exception in production environment (this will send email as well if email address is set) |
|
46 | + Debugger::log($e->getParam('exception'), Debugger::ERROR); |
|
47 | + } else { |
|
48 | + // just re-throw an exception in non-production environment to let tracy display so called blue screen |
|
49 | + throw $e->getParam('exception'); |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | 53 | } |
@@ -22,55 +22,55 @@ |
||
22 | 22 | */ |
23 | 23 | class LazyControllerFactory implements AbstractFactoryInterface |
24 | 24 | { |
25 | - protected $aliases = [ |
|
26 | - FormElementManager::class => 'FormElementManager', |
|
27 | - ValidatorPluginManager::class => 'ValidatorManager', |
|
28 | - Translator::class => 'translator', |
|
29 | - ]; |
|
25 | + protected $aliases = [ |
|
26 | + FormElementManager::class => 'FormElementManager', |
|
27 | + ValidatorPluginManager::class => 'ValidatorManager', |
|
28 | + Translator::class => 'translator', |
|
29 | + ]; |
|
30 | 30 | |
31 | - public function canCreate( ContainerInterface $container, $requestedName ) |
|
32 | - { |
|
33 | - list( $module, ) = explode( '\\', __NAMESPACE__, 2 ); |
|
34 | - return strstr( $requestedName, $module . '\Controller') !== false; |
|
35 | - } |
|
31 | + public function canCreate( ContainerInterface $container, $requestedName ) |
|
32 | + { |
|
33 | + list( $module, ) = explode( '\\', __NAMESPACE__, 2 ); |
|
34 | + return strstr( $requestedName, $module . '\Controller') !== false; |
|
35 | + } |
|
36 | 36 | |
37 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
38 | - { |
|
39 | - $class = new \ReflectionClass($requestedName); |
|
40 | - $parentLocator = $container; |
|
41 | - if( $constructor = $class->getConstructor() ) |
|
42 | - { |
|
43 | - if( $params = $constructor->getParameters() ) |
|
44 | - { |
|
45 | - $parameter_instances = []; |
|
46 | - foreach( $params as $p ) |
|
47 | - { |
|
37 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
38 | + { |
|
39 | + $class = new \ReflectionClass($requestedName); |
|
40 | + $parentLocator = $container; |
|
41 | + if( $constructor = $class->getConstructor() ) |
|
42 | + { |
|
43 | + if( $params = $constructor->getParameters() ) |
|
44 | + { |
|
45 | + $parameter_instances = []; |
|
46 | + foreach( $params as $p ) |
|
47 | + { |
|
48 | 48 | |
49 | - if( $p->getClass() ) { |
|
50 | - $cn = $p->getClass()->getName(); |
|
51 | - if (array_key_exists($cn, $this->aliases)) { |
|
52 | - $cn = $this->aliases[$cn]; |
|
53 | - } |
|
49 | + if( $p->getClass() ) { |
|
50 | + $cn = $p->getClass()->getName(); |
|
51 | + if (array_key_exists($cn, $this->aliases)) { |
|
52 | + $cn = $this->aliases[$cn]; |
|
53 | + } |
|
54 | 54 | |
55 | - try { |
|
56 | - $parameter_instances[] = $parentLocator->get($cn); |
|
57 | - } |
|
58 | - catch (\Exception $x) { |
|
59 | - echo __CLASS__ |
|
60 | - . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
61 | - exit; |
|
62 | - } |
|
63 | - } |
|
64 | - else{ |
|
65 | - if( $p->isArray() && $p->getName() == 'config' ) |
|
66 | - $parameter_instances[] = $parentLocator->get('config'); |
|
67 | - } |
|
55 | + try { |
|
56 | + $parameter_instances[] = $parentLocator->get($cn); |
|
57 | + } |
|
58 | + catch (\Exception $x) { |
|
59 | + echo __CLASS__ |
|
60 | + . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
61 | + exit; |
|
62 | + } |
|
63 | + } |
|
64 | + else{ |
|
65 | + if( $p->isArray() && $p->getName() == 'config' ) |
|
66 | + $parameter_instances[] = $parentLocator->get('config'); |
|
67 | + } |
|
68 | 68 | |
69 | - } |
|
70 | - return $class->newInstanceArgs($parameter_instances); |
|
71 | - } |
|
72 | - } |
|
69 | + } |
|
70 | + return $class->newInstanceArgs($parameter_instances); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | |
74 | - return new $requestedName; |
|
75 | - } |
|
74 | + return new $requestedName; |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | \ No newline at end of file |
@@ -28,25 +28,25 @@ discard block |
||
28 | 28 | Translator::class => 'translator', |
29 | 29 | ]; |
30 | 30 | |
31 | - public function canCreate( ContainerInterface $container, $requestedName ) |
|
31 | + public function canCreate(ContainerInterface $container, $requestedName) |
|
32 | 32 | { |
33 | - list( $module, ) = explode( '\\', __NAMESPACE__, 2 ); |
|
34 | - return strstr( $requestedName, $module . '\Controller') !== false; |
|
33 | + list($module,) = explode('\\', __NAMESPACE__, 2); |
|
34 | + return strstr($requestedName, $module.'\Controller') !== false; |
|
35 | 35 | } |
36 | 36 | |
37 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
37 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
38 | 38 | { |
39 | 39 | $class = new \ReflectionClass($requestedName); |
40 | 40 | $parentLocator = $container; |
41 | - if( $constructor = $class->getConstructor() ) |
|
41 | + if ($constructor = $class->getConstructor()) |
|
42 | 42 | { |
43 | - if( $params = $constructor->getParameters() ) |
|
43 | + if ($params = $constructor->getParameters()) |
|
44 | 44 | { |
45 | 45 | $parameter_instances = []; |
46 | - foreach( $params as $p ) |
|
46 | + foreach ($params as $p) |
|
47 | 47 | { |
48 | 48 | |
49 | - if( $p->getClass() ) { |
|
49 | + if ($p->getClass()) { |
|
50 | 50 | $cn = $p->getClass()->getName(); |
51 | 51 | if (array_key_exists($cn, $this->aliases)) { |
52 | 52 | $cn = $this->aliases[$cn]; |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | exit; |
62 | 62 | } |
63 | 63 | } |
64 | - else{ |
|
65 | - if( $p->isArray() && $p->getName() == 'config' ) |
|
64 | + else { |
|
65 | + if ($p->isArray() && $p->getName() == 'config') |
|
66 | 66 | $parameter_instances[] = $parentLocator->get('config'); |
67 | 67 | } |
68 | 68 |
@@ -54,16 +54,15 @@ |
||
54 | 54 | |
55 | 55 | try { |
56 | 56 | $parameter_instances[] = $parentLocator->get($cn); |
57 | - } |
|
58 | - catch (\Exception $x) { |
|
57 | + } catch (\Exception $x) { |
|
59 | 58 | echo __CLASS__ |
60 | 59 | . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
61 | 60 | exit; |
62 | 61 | } |
63 | - } |
|
64 | - else{ |
|
65 | - if( $p->isArray() && $p->getName() == 'config' ) |
|
66 | - $parameter_instances[] = $parentLocator->get('config'); |
|
62 | + } else{ |
|
63 | + if( $p->isArray() && $p->getName() == 'config' ) { |
|
64 | + $parameter_instances[] = $parentLocator->get('config'); |
|
65 | + } |
|
67 | 66 | } |
68 | 67 | |
69 | 68 | } |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class Index extends AbstractActionController |
28 | 28 | { |
29 | - protected $installForm; |
|
29 | + protected $installForm; |
|
30 | 30 | |
31 | - public function __construct(FormElementManager $formElementManager) |
|
32 | - { |
|
33 | - $this->installForm = $formElementManager->get('Install/Installation'); |
|
34 | - } |
|
31 | + public function __construct(FormElementManager $formElementManager) |
|
32 | + { |
|
33 | + $this->installForm = $formElementManager->get('Install/Installation'); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
36 | + /** |
|
37 | 37 | * Hook for custom preDispatch event. |
38 | 38 | * |
39 | 39 | * @param MvcEvent $event |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $routeMatch->setParam('action', $p); |
51 | 51 | $response = $this->getResponse(); |
52 | 52 | $response->getHeaders() |
53 | - ->addHeaderLine('Content-Type', 'application/json') |
|
54 | - ->addHeaderLine('Content-Encoding', 'utf8'); |
|
53 | + ->addHeaderLine('Content-Type', 'application/json') |
|
54 | + ->addHeaderLine('Content-Encoding', 'utf8'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $form = $this->installForm; |
66 | 66 | $prereqs = $this->plugin('Install/Prerequisites')->check(); |
67 | 67 | |
68 | - return $this->createViewModel( |
|
69 | - array( |
|
70 | - 'prerequisites' => $prereqs, |
|
71 | - 'form' => $form, |
|
72 | - 'lang' => $this->params('lang'), |
|
73 | - ) |
|
74 | - ); |
|
68 | + return $this->createViewModel( |
|
69 | + array( |
|
70 | + 'prerequisites' => $prereqs, |
|
71 | + 'form' => $form, |
|
72 | + 'lang' => $this->params('lang'), |
|
73 | + ) |
|
74 | + ); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $form->setData($_POST); |
101 | 101 | |
102 | 102 | if (!$form->isValid()) { |
103 | - return $this->createJsonResponse( |
|
104 | - array( |
|
105 | - 'ok' => false, |
|
106 | - 'errors' => $form->getMessages(), |
|
107 | - ) |
|
108 | - ); |
|
103 | + return $this->createJsonResponse( |
|
104 | + array( |
|
105 | + 'ok' => false, |
|
106 | + 'errors' => $form->getMessages(), |
|
107 | + ) |
|
108 | + ); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $data = $form->getData(); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function attachDefaultListeners() |
135 | 135 | { |
136 | - parent::attachDefaultListeners(); |
|
136 | + parent::attachDefaultListeners(); |
|
137 | 137 | |
138 | - $events = $this->getEventManager(); |
|
139 | - $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
138 | + $events = $this->getEventManager(); |
|
139 | + $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | $data = $form->getData(); |
116 | 116 | |
117 | - try{ |
|
117 | + try { |
|
118 | 118 | $options = [ |
119 | 119 | 'connection' => $data['db_conn'], |
120 | 120 | ]; |
121 | - $userOk = $this->plugin('Install/UserCreator',$options)->process($data['username'], $data['password'], $data['email']); |
|
121 | + $userOk = $this->plugin('Install/UserCreator', $options)->process($data['username'], $data['password'], $data['email']); |
|
122 | 122 | $ok = $this->plugin('Install/ConfigCreator')->process($data['db_conn'], $data['email']); |
123 | - }catch (\Exception $exception){ |
|
123 | + } catch (\Exception $exception) { |
|
124 | 124 | /* @TODO: provide a way to handle global error message */ |
125 | 125 | return $this->createJsonResponse([ |
126 | 126 | 'ok' => false, |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | parent::attachDefaultListeners(); |
154 | 154 | |
155 | 155 | $events = $this->getEventManager(); |
156 | - $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
156 | + $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -120,7 +120,7 @@ |
||
120 | 120 | ]; |
121 | 121 | $userOk = $this->plugin('Install/UserCreator',$options)->process($data['username'], $data['password'], $data['email']); |
122 | 122 | $ok = $this->plugin('Install/ConfigCreator')->process($data['db_conn'], $data['email']); |
123 | - }catch (\Exception $exception){ |
|
123 | + } catch (\Exception $exception){ |
|
124 | 124 | /* @TODO: provide a way to handle global error message */ |
125 | 125 | return $this->createJsonResponse([ |
126 | 126 | 'ok' => false, |
@@ -26,57 +26,57 @@ discard block |
||
26 | 26 | |
27 | 27 | public function init() |
28 | 28 | { |
29 | - $this->setName('installation'); |
|
29 | + $this->setName('installation'); |
|
30 | 30 | |
31 | - $this->setAttributes( |
|
32 | - array( |
|
33 | - 'method' => 'post', |
|
34 | - ) |
|
35 | - ); |
|
31 | + $this->setAttributes( |
|
32 | + array( |
|
33 | + 'method' => 'post', |
|
34 | + ) |
|
35 | + ); |
|
36 | 36 | |
37 | - $this->add( |
|
38 | - array( |
|
39 | - 'type' => 'Text', |
|
40 | - 'name' => 'db_conn', |
|
41 | - 'options' => array( |
|
42 | - 'label' => /* @translate */ 'Database connection string', |
|
43 | - ), |
|
44 | - 'attributes' => array( |
|
45 | - 'placeholder' => 'mongodb://localhost:27017/YAWIK', |
|
46 | - ), |
|
37 | + $this->add( |
|
38 | + array( |
|
39 | + 'type' => 'Text', |
|
40 | + 'name' => 'db_conn', |
|
41 | + 'options' => array( |
|
42 | + 'label' => /* @translate */ 'Database connection string', |
|
43 | + ), |
|
44 | + 'attributes' => array( |
|
45 | + 'placeholder' => 'mongodb://localhost:27017/YAWIK', |
|
46 | + ), |
|
47 | 47 | |
48 | - ) |
|
49 | - ); |
|
48 | + ) |
|
49 | + ); |
|
50 | 50 | |
51 | - $this->add( |
|
52 | - array( |
|
53 | - 'type' => 'Text', |
|
54 | - 'name' => 'username', |
|
55 | - 'options' => array( |
|
56 | - 'label' => /* @translate */ 'Initial user name', |
|
57 | - ), |
|
58 | - ) |
|
59 | - ); |
|
51 | + $this->add( |
|
52 | + array( |
|
53 | + 'type' => 'Text', |
|
54 | + 'name' => 'username', |
|
55 | + 'options' => array( |
|
56 | + 'label' => /* @translate */ 'Initial user name', |
|
57 | + ), |
|
58 | + ) |
|
59 | + ); |
|
60 | 60 | |
61 | - $this->add( |
|
62 | - array( |
|
63 | - 'type' => 'Password', |
|
64 | - 'name' => 'password', |
|
65 | - 'options' => array( |
|
66 | - 'label' => /* @translate */ 'Password', |
|
67 | - ), |
|
68 | - ) |
|
69 | - ); |
|
61 | + $this->add( |
|
62 | + array( |
|
63 | + 'type' => 'Password', |
|
64 | + 'name' => 'password', |
|
65 | + 'options' => array( |
|
66 | + 'label' => /* @translate */ 'Password', |
|
67 | + ), |
|
68 | + ) |
|
69 | + ); |
|
70 | 70 | |
71 | - $this->add( |
|
72 | - array( |
|
73 | - 'type' => 'Text', |
|
74 | - 'name' => 'email', |
|
75 | - 'options' => array( |
|
76 | - 'label' => /* @translate */ 'Email address for system messages', |
|
77 | - ), |
|
78 | - ) |
|
79 | - ); |
|
71 | + $this->add( |
|
72 | + array( |
|
73 | + 'type' => 'Text', |
|
74 | + 'name' => 'email', |
|
75 | + 'options' => array( |
|
76 | + 'label' => /* @translate */ 'Email address for system messages', |
|
77 | + ), |
|
78 | + ) |
|
79 | + ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function getInputFilterSpecification() |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ), |
91 | 91 | 'validators' => array( |
92 | 92 | array('name' => MongoDbConnectionString::class, |
93 | - 'break_chain_on_failure' => true), |
|
93 | + 'break_chain_on_failure' => true), |
|
94 | 94 | array('name' => MongoDbConnection::class), |
95 | 95 | ), |
96 | 96 | ), |
@@ -14,133 +14,133 @@ |
||
14 | 14 | |
15 | 15 | return [ |
16 | 16 | |
17 | - 'doctrine' => [ |
|
18 | - 'driver' => [ |
|
19 | - 'odm_default' => [ |
|
20 | - 'drivers' => [ |
|
21 | - 'Settings\Entity' => 'annotation', |
|
22 | - ], |
|
23 | - ], |
|
24 | - ], |
|
25 | - 'eventmanager' => [ |
|
26 | - 'odm_default' => [ |
|
27 | - 'subscribers' => [ |
|
28 | - 'Settings/InjectEntityResolverListener', |
|
29 | - ], |
|
30 | - ], |
|
31 | - ], |
|
32 | - ], |
|
17 | + 'doctrine' => [ |
|
18 | + 'driver' => [ |
|
19 | + 'odm_default' => [ |
|
20 | + 'drivers' => [ |
|
21 | + 'Settings\Entity' => 'annotation', |
|
22 | + ], |
|
23 | + ], |
|
24 | + ], |
|
25 | + 'eventmanager' => [ |
|
26 | + 'odm_default' => [ |
|
27 | + 'subscribers' => [ |
|
28 | + 'Settings/InjectEntityResolverListener', |
|
29 | + ], |
|
30 | + ], |
|
31 | + ], |
|
32 | + ], |
|
33 | 33 | |
34 | 34 | |
35 | - // Translations |
|
36 | - 'translator' => [ |
|
37 | - 'translation_file_patterns' => [ |
|
38 | - [ |
|
39 | - 'type' => 'gettext', |
|
40 | - 'base_dir' => __DIR__ . '/../language', |
|
41 | - 'pattern' => '%s.mo', |
|
42 | - ], |
|
43 | - ], |
|
44 | - ], |
|
45 | - // Routes |
|
46 | - 'router' => [ |
|
47 | - 'routes' => [ |
|
48 | - 'lang' => [ |
|
49 | - 'child_routes' => [ |
|
50 | - 'settings' => [ |
|
51 | - 'type' => 'Segment', |
|
52 | - 'options' => [ |
|
53 | - 'route' => '/settings[/:module]', |
|
54 | - 'defaults' => [ |
|
55 | - 'controller' => 'Settings\Controller\Index', |
|
56 | - 'action' => 'index', |
|
57 | - 'module' => 'Core', |
|
58 | - ], |
|
59 | - ], |
|
60 | - 'may_terminate' => true, |
|
61 | - ], |
|
62 | - ], |
|
63 | - ], |
|
64 | - ], |
|
65 | - ], |
|
35 | + // Translations |
|
36 | + 'translator' => [ |
|
37 | + 'translation_file_patterns' => [ |
|
38 | + [ |
|
39 | + 'type' => 'gettext', |
|
40 | + 'base_dir' => __DIR__ . '/../language', |
|
41 | + 'pattern' => '%s.mo', |
|
42 | + ], |
|
43 | + ], |
|
44 | + ], |
|
45 | + // Routes |
|
46 | + 'router' => [ |
|
47 | + 'routes' => [ |
|
48 | + 'lang' => [ |
|
49 | + 'child_routes' => [ |
|
50 | + 'settings' => [ |
|
51 | + 'type' => 'Segment', |
|
52 | + 'options' => [ |
|
53 | + 'route' => '/settings[/:module]', |
|
54 | + 'defaults' => [ |
|
55 | + 'controller' => 'Settings\Controller\Index', |
|
56 | + 'action' => 'index', |
|
57 | + 'module' => 'Core', |
|
58 | + ], |
|
59 | + ], |
|
60 | + 'may_terminate' => true, |
|
61 | + ], |
|
62 | + ], |
|
63 | + ], |
|
64 | + ], |
|
65 | + ], |
|
66 | 66 | |
67 | - 'acl' => ['rules' => [ |
|
68 | - 'user' => [ |
|
69 | - 'allow' => [ |
|
70 | - 'route/lang/settings', |
|
71 | - 'Settings\Controller\Index', |
|
72 | - ], |
|
73 | - ], |
|
74 | - ]], |
|
75 | - 'navigation' => [ |
|
76 | - 'default' => [ |
|
77 | - 'settings' => [ |
|
78 | - 'label' => /*@translate*/ 'Settings', |
|
79 | - 'route' => 'lang/settings', |
|
80 | - 'resource' => 'route/lang/settings', |
|
81 | - 'order' => 100, |
|
82 | - 'params' => ['module' => null], |
|
83 | - ], |
|
84 | - ], |
|
85 | - ], |
|
67 | + 'acl' => ['rules' => [ |
|
68 | + 'user' => [ |
|
69 | + 'allow' => [ |
|
70 | + 'route/lang/settings', |
|
71 | + 'Settings\Controller\Index', |
|
72 | + ], |
|
73 | + ], |
|
74 | + ]], |
|
75 | + 'navigation' => [ |
|
76 | + 'default' => [ |
|
77 | + 'settings' => [ |
|
78 | + 'label' => /*@translate*/ 'Settings', |
|
79 | + 'route' => 'lang/settings', |
|
80 | + 'resource' => 'route/lang/settings', |
|
81 | + 'order' => 100, |
|
82 | + 'params' => ['module' => null], |
|
83 | + ], |
|
84 | + ], |
|
85 | + ], |
|
86 | 86 | |
87 | - // Configuration of the controller service manager (Which loads controllers) |
|
88 | - 'controllers' => [ |
|
89 | - 'factories' => [ |
|
90 | - 'Settings\Controller\Index' => [\Settings\Controller\IndexController::class,'factory'] |
|
91 | - ], |
|
92 | - ], |
|
87 | + // Configuration of the controller service manager (Which loads controllers) |
|
88 | + 'controllers' => [ |
|
89 | + 'factories' => [ |
|
90 | + 'Settings\Controller\Index' => [\Settings\Controller\IndexController::class,'factory'] |
|
91 | + ], |
|
92 | + ], |
|
93 | 93 | |
94 | - // Configure the view service manager |
|
95 | - 'view_manager' => [ |
|
96 | - // Map template to files. Speeds up the lookup through the template stack. |
|
97 | - 'template_map' => [ |
|
98 | - ], |
|
94 | + // Configure the view service manager |
|
95 | + 'view_manager' => [ |
|
96 | + // Map template to files. Speeds up the lookup through the template stack. |
|
97 | + 'template_map' => [ |
|
98 | + ], |
|
99 | 99 | |
100 | - // Where to look for view templates not mapped above |
|
101 | - 'template_path_stack' => [ |
|
102 | - __DIR__ . '/../view', |
|
103 | - ], |
|
104 | - ], |
|
100 | + // Where to look for view templates not mapped above |
|
101 | + 'template_path_stack' => [ |
|
102 | + __DIR__ . '/../view', |
|
103 | + ], |
|
104 | + ], |
|
105 | 105 | |
106 | - 'view_helpers' => [ |
|
107 | - 'invokables' => [ |
|
108 | - 'Settings/FormDisableElementsCapableFormSettings' => 'Settings\Form\View\Helper\FormDisableElementsCapableFormSettings', |
|
109 | - ], |
|
110 | - 'factories' => [ |
|
111 | - ], |
|
112 | - ], |
|
106 | + 'view_helpers' => [ |
|
107 | + 'invokables' => [ |
|
108 | + 'Settings/FormDisableElementsCapableFormSettings' => 'Settings\Form\View\Helper\FormDisableElementsCapableFormSettings', |
|
109 | + ], |
|
110 | + 'factories' => [ |
|
111 | + ], |
|
112 | + ], |
|
113 | 113 | |
114 | - 'service_manager' => [ |
|
115 | - 'factories' => [ |
|
116 | - 'Settings' => '\Settings\Settings\SettingsFactory', |
|
117 | - 'Settings/EntityResolver' => '\Settings\Repository\SettingsEntityResolverFactory', |
|
118 | - 'Settings/InjectEntityResolverListener' => [\Settings\Repository\Event\InjectSettingsEntityResolverListener::class,'factory'], |
|
119 | - ], |
|
120 | - 'initializers' => [], |
|
121 | - 'shared' => [], |
|
122 | - 'aliases' => [], |
|
123 | - ], |
|
114 | + 'service_manager' => [ |
|
115 | + 'factories' => [ |
|
116 | + 'Settings' => '\Settings\Settings\SettingsFactory', |
|
117 | + 'Settings/EntityResolver' => '\Settings\Repository\SettingsEntityResolverFactory', |
|
118 | + 'Settings/InjectEntityResolverListener' => [\Settings\Repository\Event\InjectSettingsEntityResolverListener::class,'factory'], |
|
119 | + ], |
|
120 | + 'initializers' => [], |
|
121 | + 'shared' => [], |
|
122 | + 'aliases' => [], |
|
123 | + ], |
|
124 | 124 | |
125 | - 'controller_plugins' => [ |
|
126 | - 'factories' => ['settings' => '\Settings\Controller\Plugin\SettingsFactory'], |
|
127 | - ], |
|
125 | + 'controller_plugins' => [ |
|
126 | + 'factories' => ['settings' => '\Settings\Controller\Plugin\SettingsFactory'], |
|
127 | + ], |
|
128 | 128 | |
129 | - 'form_elements' => [ |
|
130 | - 'factories' => [ |
|
131 | - 'Settings/Form' => [\Settings\Form\AbstractSettingsForm::class,'factory'], |
|
132 | - 'Settings/DisableElementsCapableFormSettingsFieldset' => [\Settings\Form\DisableElementsCapableFormSettingsFieldset::class,'factory'], |
|
133 | - 'Settings/Fieldset' => \Settings\Form\Factory\SettingsFieldsetFactory::class, |
|
134 | - ], |
|
135 | - 'aliases' => [ |
|
136 | - ], |
|
137 | - ], |
|
129 | + 'form_elements' => [ |
|
130 | + 'factories' => [ |
|
131 | + 'Settings/Form' => [\Settings\Form\AbstractSettingsForm::class,'factory'], |
|
132 | + 'Settings/DisableElementsCapableFormSettingsFieldset' => [\Settings\Form\DisableElementsCapableFormSettingsFieldset::class,'factory'], |
|
133 | + 'Settings/Fieldset' => \Settings\Form\Factory\SettingsFieldsetFactory::class, |
|
134 | + ], |
|
135 | + 'aliases' => [ |
|
136 | + ], |
|
137 | + ], |
|
138 | 138 | |
139 | - 'filters' => [ |
|
140 | - 'invokables' => [ |
|
141 | - 'Settings/Filter/DisableElementsCapableFormSettings' => \Settings\Form\Filter\DisableElementsCapableFormSettings::class, |
|
142 | - ] |
|
143 | - ] |
|
139 | + 'filters' => [ |
|
140 | + 'invokables' => [ |
|
141 | + 'Settings/Filter/DisableElementsCapableFormSettings' => \Settings\Form\Filter\DisableElementsCapableFormSettings::class, |
|
142 | + ] |
|
143 | + ] |
|
144 | 144 | |
145 | 145 | |
146 | 146 | ]; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'translation_file_patterns' => [ |
38 | 38 | [ |
39 | 39 | 'type' => 'gettext', |
40 | - 'base_dir' => __DIR__ . '/../language', |
|
40 | + 'base_dir' => __DIR__.'/../language', |
|
41 | 41 | 'pattern' => '%s.mo', |
42 | 42 | ], |
43 | 43 | ], |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | // Configuration of the controller service manager (Which loads controllers) |
88 | 88 | 'controllers' => [ |
89 | 89 | 'factories' => [ |
90 | - 'Settings\Controller\Index' => [\Settings\Controller\IndexController::class,'factory'] |
|
90 | + 'Settings\Controller\Index' => [\Settings\Controller\IndexController::class, 'factory'] |
|
91 | 91 | ], |
92 | 92 | ], |
93 | 93 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // Where to look for view templates not mapped above |
101 | 101 | 'template_path_stack' => [ |
102 | - __DIR__ . '/../view', |
|
102 | + __DIR__.'/../view', |
|
103 | 103 | ], |
104 | 104 | ], |
105 | 105 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'factories' => [ |
116 | 116 | 'Settings' => '\Settings\Settings\SettingsFactory', |
117 | 117 | 'Settings/EntityResolver' => '\Settings\Repository\SettingsEntityResolverFactory', |
118 | - 'Settings/InjectEntityResolverListener' => [\Settings\Repository\Event\InjectSettingsEntityResolverListener::class,'factory'], |
|
118 | + 'Settings/InjectEntityResolverListener' => [\Settings\Repository\Event\InjectSettingsEntityResolverListener::class, 'factory'], |
|
119 | 119 | ], |
120 | 120 | 'initializers' => [], |
121 | 121 | 'shared' => [], |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | |
129 | 129 | 'form_elements' => [ |
130 | 130 | 'factories' => [ |
131 | - 'Settings/Form' => [\Settings\Form\AbstractSettingsForm::class,'factory'], |
|
132 | - 'Settings/DisableElementsCapableFormSettingsFieldset' => [\Settings\Form\DisableElementsCapableFormSettingsFieldset::class,'factory'], |
|
131 | + 'Settings/Form' => [\Settings\Form\AbstractSettingsForm::class, 'factory'], |
|
132 | + 'Settings/DisableElementsCapableFormSettingsFieldset' => [\Settings\Form\DisableElementsCapableFormSettingsFieldset::class, 'factory'], |
|
133 | 133 | 'Settings/Fieldset' => \Settings\Form\Factory\SettingsFieldsetFactory::class, |
134 | 134 | ], |
135 | 135 | 'aliases' => [ |
@@ -3,12 +3,12 @@ |
||
3 | 3 | return array( |
4 | 4 | 'service_manager' => array( |
5 | 5 | 'factories' => array( |
6 | - 'Html2PdfConverter' => [Pdf\Module::class,'factory'], //'Pdf\Module::factory', |
|
6 | + 'Html2PdfConverter' => [Pdf\Module::class, 'factory'], //'Pdf\Module::factory', |
|
7 | 7 | ) |
8 | 8 | ), |
9 | 9 | 'view_manager' => array( |
10 | 10 | 'template_map' => array( |
11 | - 'pdf/application/details/button' => __DIR__ . '/../view/applicationDetailsButton.phtml', |
|
11 | + 'pdf/application/details/button' => __DIR__.'/../view/applicationDetailsButton.phtml', |
|
12 | 12 | ) |
13 | 13 | ), |
14 | 14 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'aliases' => [ |
81 | 81 | 'assertions' => 'Acl\AssertionManager', |
82 | 82 | 'Auth/UserTokenGenerator' => 'Auth\Service\UserUniqueTokenGenerator', |
83 | - 'acl' => 'Acl' |
|
83 | + 'acl' => 'Acl' |
|
84 | 84 | ] |
85 | 85 | ], |
86 | 86 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | 'Auth/SocialProfiles' => 'Auth\Controller\SocialProfilesController', |
92 | 92 | ], |
93 | 93 | 'factories' => [ |
94 | - 'Auth\Controller\Manage' => [ManageController::class,'factory'], |
|
95 | - 'Auth/ManageGroups' => [ManageGroupsController::class,'factory'], |
|
94 | + 'Auth\Controller\Manage' => [ManageController::class,'factory'], |
|
95 | + 'Auth/ManageGroups' => [ManageGroupsController::class,'factory'], |
|
96 | 96 | 'Auth\Controller\ForgotPassword' => 'Auth\Factory\Controller\ForgotPasswordControllerFactory', |
97 | 97 | 'Auth\Controller\GotoResetPassword' => 'Auth\Factory\Controller\GotoResetPasswordControllerFactory', |
98 | 98 | 'Auth\Controller\Register' => 'Auth\Factory\Controller\RegisterControllerFactory', |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | 'shared' => [ |
117 | 117 | 'OAuth' => false, |
118 | 118 | ], |
119 | - 'aliases' => [ |
|
120 | - 'acl' => 'Acl', |
|
121 | - 'auth' => 'Auth' |
|
122 | - ] |
|
119 | + 'aliases' => [ |
|
120 | + 'acl' => 'Acl', |
|
121 | + 'auth' => 'Auth' |
|
122 | + ] |
|
123 | 123 | ], |
124 | 124 | 'hybridauth' => [ |
125 | 125 | "Facebook" => [ |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | 'Auth/Users' => 'switch', |
225 | 225 | ], |
226 | 226 | 'deny' => [ |
227 | - // 'route/lang/auth', |
|
227 | + // 'route/lang/auth', |
|
228 | 228 | 'route/auth-provider', |
229 | 229 | 'route/auth-extern', |
230 | 230 | 'route/lang/forgot-password', |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | 'factories' => [ |
312 | 312 | 'auth' => '\Auth\Factory\View\Helper\AuthFactory', |
313 | 313 | 'acl' => '\Acl\Factory\View\Helper\AclFactory', |
314 | - ], |
|
314 | + ], |
|
315 | 315 | ], |
316 | 316 | |
317 | 317 | 'form_elements' => [ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * for multiple paths. |
42 | 42 | * example https://github.com/doctrine/DoctrineORMModule |
43 | 43 | */ |
44 | - 'paths' => [ __DIR__ . '/../src/Auth/Entity'], |
|
44 | + 'paths' => [__DIR__.'/../src/Auth/Entity'], |
|
45 | 45 | ], |
46 | 46 | ], |
47 | 47 | ], |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | 'Auth/SocialProfiles' => 'Auth\Controller\SocialProfilesController', |
92 | 92 | ], |
93 | 93 | 'factories' => [ |
94 | - 'Auth\Controller\Manage' => [ManageController::class,'factory'], |
|
95 | - 'Auth/ManageGroups' => [ManageGroupsController::class,'factory'], |
|
94 | + 'Auth\Controller\Manage' => [ManageController::class, 'factory'], |
|
95 | + 'Auth/ManageGroups' => [ManageGroupsController::class, 'factory'], |
|
96 | 96 | 'Auth\Controller\ForgotPassword' => 'Auth\Factory\Controller\ForgotPasswordControllerFactory', |
97 | 97 | 'Auth\Controller\GotoResetPassword' => 'Auth\Factory\Controller\GotoResetPasswordControllerFactory', |
98 | 98 | 'Auth\Controller\Register' => 'Auth\Factory\Controller\RegisterControllerFactory', |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | 'Auth/SocialProfiles' => 'Auth\Controller\Plugin\Service\SocialProfilesFactory', |
110 | 110 | 'Acl' => '\Acl\Controller\Plugin\AclFactory', |
111 | 111 | 'Auth/LoginFilter' => 'Auth\Controller\Plugin\LoginFilter::factory', |
112 | - 'OAuth' => [\Auth\Controller\Plugin\OAuth::class,'factory'], |
|
113 | - 'Auth' => [Auth::class,'factory'], |
|
112 | + 'OAuth' => [\Auth\Controller\Plugin\OAuth::class, 'factory'], |
|
113 | + 'Auth' => [Auth::class, 'factory'], |
|
114 | 114 | 'Auth/User/Switcher' => 'Auth\Factory\Controller\Plugin\UserSwitcherFactory', |
115 | 115 | ], |
116 | 116 | 'shared' => [ |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | 'hybridauth' => [ |
125 | 125 | "Facebook" => [ |
126 | 126 | "enabled" => true, |
127 | - "keys" => [ "id" => "", "secret" => "" ], |
|
127 | + "keys" => ["id" => "", "secret" => ""], |
|
128 | 128 | "scope" => 'email, user_about_me, user_birthday, user_hometown, user_website', |
129 | 129 | "display" => 'popup', |
130 | 130 | ], |
131 | 131 | "LinkedIn" => [ |
132 | 132 | "enabled" => true, |
133 | - "keys" => [ "key" => "", "secret" => "" ], |
|
133 | + "keys" => ["key" => "", "secret" => ""], |
|
134 | 134 | ], |
135 | 135 | "XING" => [ |
136 | 136 | "enabled" => true, |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'class' => 'Hybrid_Providers_XING', |
141 | 141 | 'path' => __FILE__, |
142 | 142 | ], |
143 | - "keys" => [ "key" => "", "secret" => "" ], |
|
143 | + "keys" => ["key" => "", "secret" => ""], |
|
144 | 144 | ], |
145 | 145 | "Github" => [ |
146 | 146 | "enabled" => true, |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | 'class' => 'Hybrid_Providers_Github', |
151 | 151 | 'path' => __FILE__, |
152 | 152 | ], |
153 | - "keys" => [ "key" => "", "secret" => "" ], |
|
153 | + "keys" => ["key" => "", "secret" => ""], |
|
154 | 154 | ], |
155 | 155 | |
156 | 156 | ], |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'translation_file_patterns' => [ |
254 | 254 | [ |
255 | 255 | 'type' => 'gettext', |
256 | - 'base_dir' => __DIR__ . '/../language', |
|
256 | + 'base_dir' => __DIR__.'/../language', |
|
257 | 257 | 'pattern' => '%s.mo', |
258 | 258 | ], |
259 | 259 | ], |
@@ -262,30 +262,30 @@ discard block |
||
262 | 262 | // Configure the view service manager |
263 | 263 | 'view_manager' => [ |
264 | 264 | 'template_map' => [ |
265 | - 'form/auth/contact.form' => __DIR__ . '/../view/form/contact.form.phtml', |
|
266 | - 'form/auth/contact.view' => __DIR__ . '/../view/form/contact.view.phtml', |
|
267 | - 'form/auth/status.form' => __DIR__ . '/../view/form/status.form.phtml', |
|
268 | - 'form/auth/status.view' => __DIR__ . '/../view/form/status.view.phtml', |
|
269 | - 'auth/error/social-profiles-unconfigured' => __DIR__ . '/../view/error/social-profiles-unconfigured.phtml', |
|
270 | - 'auth/form/user-info-container' => __DIR__ . '/../view/form/user-info-container.phtml', |
|
271 | - 'auth/form/user-status-container' => __DIR__ . '/../view/form/user-status-container.phtml', |
|
272 | - 'auth/form/userselect' => __DIR__ . '/../view/form/userselect.phtml', |
|
273 | - 'auth/form/social-profiles-fieldset' => __DIR__ . '/../view/form/social-profiles-fieldset.phtml', |
|
274 | - 'auth/form/social-profiles-button' => __DIR__ . '/../view/form/social-profiles-button.phtml', |
|
275 | - 'auth/sidebar/groups-menu' => __DIR__ . '/../view/sidebar/groups-menu.phtml', |
|
276 | - 'mail/first-external-login' => __DIR__ . '/../view/mail/first-external-login.phtml', |
|
277 | - 'mail/first-socialmedia-login' => __DIR__ . '/../view/mail/first-socialmedia-login.phtml', |
|
278 | - 'mail/forgotPassword' => __DIR__ . '/../view/mail/forgot-password.phtml', |
|
279 | - 'mail/forgotPassword.en' => __DIR__ . '/../view/mail/forgot-password.en.phtml', |
|
280 | - 'mail/register' => __DIR__ . '/../view/mail/register.phtml', |
|
281 | - 'auth/mail/new-registration' => __DIR__ . '/../view/mail/new-registration.phtml', |
|
282 | - 'auth/mail/new-registration.de' => __DIR__ . '/../view/mail/new-registration.de.phtml', |
|
283 | - 'auth/mail/user-confirmed' => __DIR__ . '/../view/mail/user-confirmed.phtml', |
|
284 | - 'auth/mail/user-confirmed.de' => __DIR__ . '/../view/mail/user-confirmed.de.phtml', |
|
265 | + 'form/auth/contact.form' => __DIR__.'/../view/form/contact.form.phtml', |
|
266 | + 'form/auth/contact.view' => __DIR__.'/../view/form/contact.view.phtml', |
|
267 | + 'form/auth/status.form' => __DIR__.'/../view/form/status.form.phtml', |
|
268 | + 'form/auth/status.view' => __DIR__.'/../view/form/status.view.phtml', |
|
269 | + 'auth/error/social-profiles-unconfigured' => __DIR__.'/../view/error/social-profiles-unconfigured.phtml', |
|
270 | + 'auth/form/user-info-container' => __DIR__.'/../view/form/user-info-container.phtml', |
|
271 | + 'auth/form/user-status-container' => __DIR__.'/../view/form/user-status-container.phtml', |
|
272 | + 'auth/form/userselect' => __DIR__.'/../view/form/userselect.phtml', |
|
273 | + 'auth/form/social-profiles-fieldset' => __DIR__.'/../view/form/social-profiles-fieldset.phtml', |
|
274 | + 'auth/form/social-profiles-button' => __DIR__.'/../view/form/social-profiles-button.phtml', |
|
275 | + 'auth/sidebar/groups-menu' => __DIR__.'/../view/sidebar/groups-menu.phtml', |
|
276 | + 'mail/first-external-login' => __DIR__.'/../view/mail/first-external-login.phtml', |
|
277 | + 'mail/first-socialmedia-login' => __DIR__.'/../view/mail/first-socialmedia-login.phtml', |
|
278 | + 'mail/forgotPassword' => __DIR__.'/../view/mail/forgot-password.phtml', |
|
279 | + 'mail/forgotPassword.en' => __DIR__.'/../view/mail/forgot-password.en.phtml', |
|
280 | + 'mail/register' => __DIR__.'/../view/mail/register.phtml', |
|
281 | + 'auth/mail/new-registration' => __DIR__.'/../view/mail/new-registration.phtml', |
|
282 | + 'auth/mail/new-registration.de' => __DIR__.'/../view/mail/new-registration.de.phtml', |
|
283 | + 'auth/mail/user-confirmed' => __DIR__.'/../view/mail/user-confirmed.phtml', |
|
284 | + 'auth/mail/user-confirmed.de' => __DIR__.'/../view/mail/user-confirmed.de.phtml', |
|
285 | 285 | ], |
286 | 286 | |
287 | 287 | 'template_path_stack' => [ |
288 | - 'Auth' => __DIR__ . '/../view', |
|
288 | + 'Auth' => __DIR__.'/../view', |
|
289 | 289 | ], |
290 | 290 | ], |
291 | 291 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | 'Auth/UserImage' => 'Auth\Form\UserImageFactory', |
342 | 342 | 'Auth\Form\Login' => 'Auth\Factory\Form\LoginFactory', |
343 | 343 | 'Auth\Form\Register' => 'Auth\Factory\Form\RegisterFactory', |
344 | - 'user-password' => [\Auth\Form\UserPassword::class,'factory'], |
|
344 | + 'user-password' => [\Auth\Form\UserPassword::class, 'factory'], |
|
345 | 345 | ] |
346 | 346 | ], |
347 | 347 | |
@@ -350,9 +350,9 @@ discard block |
||
350 | 350 | 'service' => 'Core/EventManager', |
351 | 351 | 'event' => AuthEvent::class, |
352 | 352 | 'listeners' => [ |
353 | - Listener\MailForgotPassword::class => [ AuthEvent::EVENT_AUTH_NEWPASSWORD, 10, true ], |
|
353 | + Listener\MailForgotPassword::class => [AuthEvent::EVENT_AUTH_NEWPASSWORD, 10, true], |
|
354 | 354 | Listener\SendRegistrationNotifications::class => [ |
355 | - [ AuthEvent::EVENT_USER_REGISTERED, AuthEvent::EVENT_USER_CONFIRMED ], |
|
355 | + [AuthEvent::EVENT_USER_REGISTERED, AuthEvent::EVENT_USER_CONFIRMED], |
|
356 | 356 | true |
357 | 357 | ], |
358 | 358 | ], |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @param EventManagerInterface $events |
60 | 60 | * @param integer $priority |
61 | - */ |
|
61 | + */ |
|
62 | 62 | public function attach(EventManagerInterface $events, $priority=1) |
63 | 63 | { |
64 | 64 | $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onRoute'), -10); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | - /** |
|
84 | - * @param MvcEvent $event |
|
85 | - * |
|
86 | - * @return array|\ArrayAccess|mixed|object |
|
87 | - */ |
|
83 | + /** |
|
84 | + * @param MvcEvent $event |
|
85 | + * |
|
86 | + * @return array|\ArrayAccess|mixed|object |
|
87 | + */ |
|
88 | 88 | public function onRoute(MvcEvent $event) |
89 | 89 | { |
90 | 90 | if ($event->isError()) { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | |
117 | 117 | if ($resourceId && !$acl->isAllowed($role, $resourceId, $privilege)) { |
118 | - /* |
|
118 | + /* |
|
119 | 119 | * Exceptions are only catched within the dispatch listener, so |
120 | 120 | * we have to set the exception manually in the event |
121 | 121 | * and trigger the DISPATCH_ERROR event. |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @param EventManagerInterface $events |
60 | 60 | * @param integer $priority |
61 | 61 | */ |
62 | - public function attach(EventManagerInterface $events, $priority=1) |
|
62 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
63 | 63 | { |
64 | 64 | $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onRoute'), -10); |
65 | 65 | $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 10); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $eventManager->setEventPrototype($event); |
128 | 128 | $results = $eventManager->trigger(MvcEvent::EVENT_DISPATCH_ERROR); |
129 | 129 | if (count($results)) { |
130 | - $return = $results->last(); |
|
130 | + $return = $results->last(); |
|
131 | 131 | } else { |
132 | 132 | $return = $event->getParams(); |
133 | 133 | } |