@@ -23,7 +23,7 @@ Imagine you have a ``Mailer`` class which has four options: ``host``,
23
23
24
24
class Mailer
25
25
{
26
- protected $options;
26
+ protected array $options;
27
27
28
28
public function __construct(array $options = [])
29
29
{
@@ -37,7 +37,7 @@ check which options are set::
37
37
class Mailer
38
38
{
39
39
// ...
40
- public function sendMail($from, $to)
40
+ public function sendMail($from, $to): void
41
41
{
42
42
$mail = ...;
43
43
@@ -884,9 +884,9 @@ can change your code to do the configuration only once per class::
884
884
// ...
885
885
class Mailer
886
886
{
887
- private static $resolversByClass = [];
887
+ private static array $resolversByClass = [];
888
888
889
- protected $options;
889
+ protected array $options;
890
890
891
891
public function __construct(array $options = [])
892
892
{
@@ -902,7 +902,7 @@ can change your code to do the configuration only once per class::
902
902
$this->options = self::$resolversByClass[$class]->resolve($options);
903
903
}
904
904
905
- public function configureOptions(OptionsResolver $resolver)
905
+ public function configureOptions(OptionsResolver $resolver): void
906
906
{
907
907
// ...
908
908
}
@@ -917,9 +917,9 @@ method ``clearOptionsConfig()`` and call it periodically::
917
917
// ...
918
918
class Mailer
919
919
{
920
- private static $resolversByClass = [];
920
+ private static array $resolversByClass = [];
921
921
922
- public static function clearOptionsConfig()
922
+ public static function clearOptionsConfig(): void
923
923
{
924
924
self::$resolversByClass = [];
925
925
}
0 commit comments