@@ -43,15 +43,12 @@ public function write($path, $locale, $data, $fallback = true)
43
43
/**
44
44
* Writes a "resourceBundle" node.
45
45
*
46
- * @param resource $file The file handle to write to
47
- * @param string $bundleName The name of the bundle
48
- * @param mixed $value The value of the node
49
- * @param bool $fallback Whether the resource bundle should be merged
50
- * with the fallback locale
46
+ * @param resource $file The file handle to write to
47
+ * @param mixed $value The value of the node
51
48
*
52
49
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
53
50
*/
54
- private function writeResourceBundle ($ file , $ bundleName , $ value , $ fallback )
51
+ private function writeResourceBundle ($ file , string $ bundleName , $ value , bool $ fallback )
55
52
{
56
53
fwrite ($ file , $ bundleName );
57
54
@@ -63,14 +60,12 @@ private function writeResourceBundle($file, $bundleName, $value, $fallback)
63
60
/**
64
61
* Writes a "resource" node.
65
62
*
66
- * @param resource $file The file handle to write to
67
- * @param mixed $value The value of the node
68
- * @param int $indentation The number of levels to indent
69
- * @param bool $requireBraces Whether to require braces to be printedaround the value
63
+ * @param resource $file The file handle to write to
64
+ * @param mixed $value The value of the node
70
65
*
71
66
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
72
67
*/
73
- private function writeResource ($ file , $ value , $ indentation , $ requireBraces = true )
68
+ private function writeResource ($ file , $ value , int $ indentation , bool $ requireBraces = true )
74
69
{
75
70
if (\is_int ($ value )) {
76
71
$ this ->writeInteger ($ file , $ value );
@@ -117,26 +112,23 @@ private function writeResource($file, $value, $indentation, $requireBraces = tru
117
112
/**
118
113
* Writes an "integer" node.
119
114
*
120
- * @param resource $file The file handle to write to
121
- * @param int $value The value of the node
115
+ * @param resource $file The file handle to write to
122
116
*
123
117
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
124
118
*/
125
- private function writeInteger ($ file , $ value )
119
+ private function writeInteger ($ file , int $ value )
126
120
{
127
121
fprintf ($ file , ':int{%d} ' , $ value );
128
122
}
129
123
130
124
/**
131
125
* Writes an "intvector" node.
132
126
*
133
- * @param resource $file The file handle to write to
134
- * @param array $value The value of the node
135
- * @param int $indentation The number of levels to indent
127
+ * @param resource $file The file handle to write to
136
128
*
137
129
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
138
130
*/
139
- private function writeIntVector ($ file , array $ value , $ indentation )
131
+ private function writeIntVector ($ file , array $ value , int $ indentation )
140
132
{
141
133
fwrite ($ file , ":intvector{ \n" );
142
134
@@ -150,14 +142,11 @@ private function writeIntVector($file, array $value, $indentation)
150
142
/**
151
143
* Writes a "string" node.
152
144
*
153
- * @param resource $file The file handle to write to
154
- * @param string $value The value of the node
155
- * @param bool $requireBraces Whether to require braces to be printed
156
- * around the value
145
+ * @param resource $file The file handle to write to
157
146
*
158
147
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
159
148
*/
160
- private function writeString ($ file , $ value , $ requireBraces = true )
149
+ private function writeString ($ file , string $ value , bool $ requireBraces = true )
161
150
{
162
151
if ($ requireBraces ) {
163
152
fprintf ($ file , '{"%s"} ' , $ value );
@@ -171,13 +160,11 @@ private function writeString($file, $value, $requireBraces = true)
171
160
/**
172
161
* Writes an "array" node.
173
162
*
174
- * @param resource $file The file handle to write to
175
- * @param array $value The value of the node
176
- * @param int $indentation The number of levels to indent
163
+ * @param resource $file The file handle to write to
177
164
*
178
165
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
179
166
*/
180
- private function writeArray ($ file , array $ value , $ indentation )
167
+ private function writeArray ($ file , array $ value , int $ indentation )
181
168
{
182
169
fwrite ($ file , "{ \n" );
183
170
@@ -195,16 +182,12 @@ private function writeArray($file, array $value, $indentation)
195
182
/**
196
183
* Writes a "table" node.
197
184
*
198
- * @param resource $file The file handle to write to
199
- * @param iterable $value The value of the node
200
- * @param int $indentation The number of levels to indent
201
- * @param bool $fallback Whether the table should be merged
202
- * with the fallback locale
185
+ * @param resource $file The file handle to write to
203
186
*
204
187
* @throws UnexpectedTypeException when $value is not an array and not a
205
188
* \Traversable instance
206
189
*/
207
- private function writeTable ($ file , $ value , $ indentation , $ fallback = true )
190
+ private function writeTable ($ file , iterable $ value , int $ indentation , bool $ fallback = true )
208
191
{
209
192
if (!\is_array ($ value ) && !$ value instanceof \Traversable) {
210
193
throw new UnexpectedTypeException ($ value , 'array or \Traversable ' );
0 commit comments