1313
1414class Configuration implements ConfigurationInterface
1515{
16- public const SOLR_HTTP_CLIENT_DEFAULT_TIMEOUT = 10 ;
17- public const SOLR_HTTP_CLIENT_DEFAULT_MAX_RETRIES = 3 ;
18-
19- protected $ rootNodeName ;
16+ public const int SOLR_HTTP_CLIENT_DEFAULT_TIMEOUT = 10 ;
17+ public const int SOLR_HTTP_CLIENT_DEFAULT_MAX_RETRIES = 3 ;
2018
2119 /**
2220 * Holds default endpoint values.
2321 *
24- * @var array
22+ * @var array<string, string|int|null>
2523 */
26- protected $ defaultEndpointValues = [
24+ protected array $ defaultEndpointValues = [
2725 'scheme ' => 'http ' ,
2826 'host ' => '127.0.0.1 ' ,
2927 'port ' => 8983 ,
@@ -32,14 +30,15 @@ class Configuration implements ConfigurationInterface
3230 'path ' => '/solr ' ,
3331 ];
3432
35- protected $ metaFieldNames = [
33+ /** @var list<string> */
34+ protected array $ metaFieldNames = [
3635 'name ' ,
3736 'text ' ,
3837 ];
3938
40- public function __construct ($ rootNodeName )
41- {
42- $ this -> rootNodeName = $ rootNodeName ;
39+ public function __construct (
40+ protected string $ rootNodeName
41+ ) {
4342 }
4443
4544 public function getConfigTreeBuilder (): TreeBuilder
@@ -58,7 +57,7 @@ public function getConfigTreeBuilder(): TreeBuilder
5857 /**
5958 * Adds endpoints definition.
6059 */
61- protected function addEndpointsSection (ArrayNodeDefinition $ node )
60+ protected function addEndpointsSection (ArrayNodeDefinition $ node ): void
6261 {
6362 $ node ->children ()
6463 ->arrayNode ('endpoints ' )
@@ -103,7 +102,7 @@ protected function addEndpointsSection(ArrayNodeDefinition $node)
103102 *
104103 * @throws \RuntimeException
105104 */
106- protected function addConnectionsSection (ArrayNodeDefinition $ node )
105+ protected function addConnectionsSection (ArrayNodeDefinition $ node ): void
107106 {
108107 $ node ->children ()
109108 ->scalarNode ('default_connection ' )
@@ -116,11 +115,7 @@ protected function addConnectionsSection(ArrayNodeDefinition $node)
116115 ->prototype ('array ' )
117116 ->beforeNormalization ()
118117 ->ifTrue (
119- static function ($ v ): bool {
120- return
121- !empty ($ v ['mapping ' ]) && !\is_array ($ v ['mapping ' ])
122- ;
123- }
118+ static fn ($ v ): bool => !empty ($ v ['mapping ' ]) && !\is_array ($ v ['mapping ' ])
124119 )
125120 ->then (
126121 static function (array $ v ) {
@@ -136,16 +131,12 @@ static function (array $v) {
136131 ->end ()
137132 ->beforeNormalization ()
138133 ->ifTrue (
139- static function ($ v ): bool {
140- return
141- empty ($ v ['entry_endpoints ' ]) &&
142- (
143- !empty ($ v ['mapping ' ]['translations ' ]) ||
144- !empty ($ v ['mapping ' ]['default ' ]) ||
145- !empty ($ v ['mapping ' ]['main_translations ' ])
146- )
147- ;
148- }
134+ static fn ($ v ): bool => empty ($ v ['entry_endpoints ' ]) &&
135+ (
136+ !empty ($ v ['mapping ' ]['translations ' ]) ||
137+ !empty ($ v ['mapping ' ]['default ' ]) ||
138+ !empty ($ v ['mapping ' ]['main_translations ' ])
139+ )
149140 )
150141 ->then (
151142 // If entry endpoints are not provided use mapping endpoints
0 commit comments