@@ -54,7 +54,7 @@ public function __construct(UnitDecorator $unitDecorator = null)
5454 *
5555 * @return string Formatted bytes.
5656 */
57- public function format ($ bytes , $ precision = null )
57+ public function format ($ bytes , $ precision = null ): string
5858 {
5959 // Use default precision when not specified.
6060 $ precision === null && $ precision = $ this ->getPrecision ();
@@ -79,7 +79,7 @@ public function format($bytes, $precision = null)
7979 *
8080 * @return string Formatted number.
8181 */
82- private function formatValue ($ value , $ precision )
82+ private function formatValue ($ value , $ precision ): string
8383 {
8484 $ formatted = sprintf ("%0. $ {precision}F " , $ value );
8585
@@ -108,7 +108,7 @@ private function formatValue($value, $precision)
108108 *
109109 * @return string sprintf() format.
110110 */
111- private function convertFormat ($ format )
111+ private function convertFormat ($ format ): string
112112 {
113113 return str_replace (['%v ' , '%u ' ], ['%1$s ' , '%2$s ' ], $ format );
114114 }
@@ -118,7 +118,7 @@ private function convertFormat($format)
118118 *
119119 * @return int Exponentiation base.
120120 */
121- public function getBase ()
121+ public function getBase (): int
122122 {
123123 return $ this ->base ;
124124 }
@@ -130,7 +130,7 @@ public function getBase()
130130 *
131131 * @return $this
132132 */
133- public function setBase ($ base )
133+ public function setBase ($ base ): self
134134 {
135135 $ this ->base = $ base |0 ;
136136
@@ -142,7 +142,7 @@ public function setBase($base)
142142 *
143143 * @return string Format specifier.
144144 */
145- public function getFormat ()
145+ public function getFormat (): string
146146 {
147147 return $ this ->format ;
148148 }
@@ -155,7 +155,7 @@ public function getFormat()
155155 *
156156 * @return $this
157157 */
158- public function setFormat ($ format )
158+ public function setFormat ($ format ): self
159159 {
160160 $ this ->sprintfFormat = $ this ->convertFormat ($ this ->format = "$ format " );
161161
@@ -167,7 +167,7 @@ public function setFormat($format)
167167 *
168168 * @return int Fractional digits.
169169 */
170- public function getPrecision ()
170+ public function getPrecision (): int
171171 {
172172 return $ this ->precision ;
173173 }
@@ -179,7 +179,7 @@ public function getPrecision()
179179 *
180180 * @return $this
181181 */
182- public function setPrecision ($ precision )
182+ public function setPrecision ($ precision ): self
183183 {
184184 $ this ->precision = $ precision |0 ;
185185
@@ -191,7 +191,7 @@ public function setPrecision($precision)
191191 *
192192 * @return $this
193193 */
194- public function enableAutomaticPrecision ()
194+ public function enableAutomaticPrecision (): self
195195 {
196196 $ this ->automaticPrecision = true ;
197197
@@ -203,7 +203,7 @@ public function enableAutomaticPrecision()
203203 *
204204 * @return $this
205205 */
206- public function disableAutomaticPrecision ()
206+ public function disableAutomaticPrecision (): self
207207 {
208208 $ this ->automaticPrecision = false ;
209209
@@ -216,7 +216,7 @@ public function disableAutomaticPrecision()
216216 * @return bool True if precision will be scaled automatically, otherwise
217217 * false.
218218 */
219- public function hasAutomaticPrecision ()
219+ public function hasAutomaticPrecision (): bool
220220 {
221221 return $ this ->automaticPrecision ;
222222 }
@@ -226,7 +226,7 @@ public function hasAutomaticPrecision()
226226 *
227227 * @return int Fixed exponent.
228228 */
229- public function getFixedExponent ()
229+ public function getFixedExponent (): int
230230 {
231231 return $ this ->exponent ;
232232 }
@@ -238,7 +238,7 @@ public function getFixedExponent()
238238 *
239239 * @return $this
240240 */
241- public function setFixedExponent ($ exponent )
241+ public function setFixedExponent ($ exponent ): self
242242 {
243243 $ this ->exponent = $ exponent |0 ;
244244
@@ -250,7 +250,7 @@ public function setFixedExponent($exponent)
250250 *
251251 * @return $this
252252 */
253- public function clearFixedExponent ()
253+ public function clearFixedExponent (): self
254254 {
255255 $ this ->exponent = null ;
256256
@@ -262,7 +262,7 @@ public function clearFixedExponent()
262262 *
263263 * @return bool True if a fixed exponent has been set, otherwise false.
264264 */
265- public function hasFixedExponent ()
265+ public function hasFixedExponent (): bool
266266 {
267267 return $ this ->exponent !== null ;
268268 }
@@ -272,7 +272,7 @@ public function hasFixedExponent()
272272 *
273273 * @return UnitDecorator
274274 */
275- public function getUnitDecorator ()
275+ public function getUnitDecorator (): UnitDecorator
276276 {
277277 return $ this ->unitDecorator ;
278278 }
@@ -284,7 +284,7 @@ public function getUnitDecorator()
284284 *
285285 * @return $this
286286 */
287- public function setUnitDecorator (UnitDecorator $ decorator )
287+ public function setUnitDecorator (UnitDecorator $ decorator ): self
288288 {
289289 $ this ->unitDecorator = $ decorator ;
290290
0 commit comments