@@ -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
@@ -908,9 +908,9 @@ can change your code to do the configuration only once per class::
908
908
// ...
909
909
class Mailer
910
910
{
911
- private static $resolversByClass = [];
911
+ private static array $resolversByClass = [];
912
912
913
- protected $options;
913
+ protected array $options;
914
914
915
915
public function __construct(array $options = [])
916
916
{
@@ -926,7 +926,7 @@ can change your code to do the configuration only once per class::
926
926
$this->options = self::$resolversByClass[$class]->resolve($options);
927
927
}
928
928
929
- public function configureOptions(OptionsResolver $resolver)
929
+ public function configureOptions(OptionsResolver $resolver): void
930
930
{
931
931
// ...
932
932
}
@@ -941,9 +941,9 @@ method ``clearOptionsConfig()`` and call it periodically::
941
941
// ...
942
942
class Mailer
943
943
{
944
- private static $resolversByClass = [];
944
+ private static array $resolversByClass = [];
945
945
946
- public static function clearOptionsConfig()
946
+ public static function clearOptionsConfig(): void
947
947
{
948
948
self::$resolversByClass = [];
949
949
}
0 commit comments