This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
ConfigProvider.php
159 lines (152 loc) · 6.34 KB
/
ConfigProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
/**
* @see https://github.com/zendframework/zend-i18n for the canonical source repository
* @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-i18n/blob/master/LICENSE.md New BSD License
*/
namespace Zend\I18n;
use Zend\ServiceManager\Factory\InvokableFactory;
class ConfigProvider
{
/**
* Return general-purpose zend-i18n configuration.
*
* @return array
*/
public function __invoke()
{
return [
'dependencies' => $this->getDependencyConfig(),
'filters' => $this->getFilterConfig(),
'validators' => $this->getValidatorConfig(),
'view_helpers' => $this->getViewHelperConfig(),
];
}
/**
* Return application-level dependency configuration.
*
* @return array
*/
public function getDependencyConfig()
{
return [
'aliases' => [
'TranslatorPluginManager' => Translator\LoaderPluginManager::class,
],
'factories' => [
Translator\TranslatorInterface::class => Translator\TranslatorServiceFactory::class,
Translator\LoaderPluginManager::class => Translator\LoaderPluginManagerFactory::class,
],
];
}
/**
* Return zend-filter configuration.
*
* @return array
*/
public function getFilterConfig()
{
return [
'aliases' => [
'alnum' => Filter\Alnum::class,
'Alnum' => Filter\Alnum::class,
'alpha' => Filter\Alpha::class,
'Alpha' => Filter\Alpha::class,
'numberformat' => Filter\NumberFormat::class,
'numberFormat' => Filter\NumberFormat::class,
'NumberFormat' => Filter\NumberFormat::class,
'numberparse' => Filter\NumberParse::class,
'numberParse' => Filter\NumberParse::class,
'NumberParse' => Filter\NumberParse::class,
],
'factories' => [
Filter\Alnum::class => InvokableFactory::class,
Filter\Alpha::class => InvokableFactory::class,
Filter\NumberFormat::class => InvokableFactory::class,
Filter\NumberParse::class => InvokableFactory::class,
],
];
}
/**
* Return zend-validator configuration.
*
* @return array
*/
public function getValidatorConfig()
{
return [
'aliases' => [
'alnum' => Validator\Alnum::class,
'Alnum' => Validator\Alnum::class,
'alpha' => Validator\Alpha::class,
'Alpha' => Validator\Alpha::class,
'datetime' => Validator\DateTime::class,
'dateTime' => Validator\DateTime::class,
'DateTime' => Validator\DateTime::class,
'float' => Validator\IsFloat::class,
'Float' => Validator\IsFloat::class,
'int' => Validator\IsInt::class,
'Int' => Validator\IsInt::class,
'isfloat' => Validator\IsFloat::class,
'isFloat' => Validator\IsFloat::class,
'IsFloat' => Validator\IsFloat::class,
'isint' => Validator\IsInt::class,
'isInt' => Validator\IsInt::class,
'IsInt' => Validator\IsInt::class,
'phonenumber' => Validator\PhoneNumber::class,
'phoneNumber' => Validator\PhoneNumber::class,
'PhoneNumber' => Validator\PhoneNumber::class,
'postcode' => Validator\PostCode::class,
'postCode' => Validator\PostCode::class,
'PostCode' => Validator\PostCode::class,
],
'factories' => [
Validator\Alnum::class => InvokableFactory::class,
Validator\Alpha::class => InvokableFactory::class,
Validator\DateTime::class => InvokableFactory::class,
Validator\IsFloat::class => InvokableFactory::class,
Validator\IsInt::class => InvokableFactory::class,
Validator\PhoneNumber::class => InvokableFactory::class,
Validator\PostCode::class => InvokableFactory::class,
],
];
}
/**
* Return zend-view helper configuration.
*
* Obsoletes View\HelperConfig.
*
* @return array
*/
public function getViewHelperConfig()
{
return [
'aliases' => [
'currencyformat' => View\Helper\CurrencyFormat::class,
'currencyFormat' => View\Helper\CurrencyFormat::class,
'CurrencyFormat' => View\Helper\CurrencyFormat::class,
'dateformat' => View\Helper\DateFormat::class,
'dateFormat' => View\Helper\DateFormat::class,
'DateFormat' => View\Helper\DateFormat::class,
'numberformat' => View\Helper\NumberFormat::class,
'numberFormat' => View\Helper\NumberFormat::class,
'NumberFormat' => View\Helper\NumberFormat::class,
'plural' => View\Helper\Plural::class,
'Plural' => View\Helper\Plural::class,
'translate' => View\Helper\Translate::class,
'Translate' => View\Helper\Translate::class,
'translateplural' => View\Helper\TranslatePlural::class,
'translatePlural' => View\Helper\TranslatePlural::class,
'TranslatePlural' => View\Helper\TranslatePlural::class,
],
'factories' => [
View\Helper\CurrencyFormat::class => InvokableFactory::class,
View\Helper\DateFormat::class => InvokableFactory::class,
View\Helper\NumberFormat::class => InvokableFactory::class,
View\Helper\Plural::class => InvokableFactory::class,
View\Helper\Translate::class => InvokableFactory::class,
View\Helper\TranslatePlural::class => InvokableFactory::class,
],
];
}
}