Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
17 | 27 | public static function factory($config = array()) |
|
18 | { |
||
19 | // We just use this for validation. The configs are set in the parent's |
||
20 | // factory methid. |
||
21 | 27 | Collection::fromConfig($config, array(), array('index_id', 'derived_key')); |
|
22 | 21 | $solr = parent::factory($config); |
|
23 | |||
24 | // Get the configs relevant to Acquia Search. |
||
25 | 21 | $indexId = $solr->getConfig('index_id'); |
|
|
|||
26 | 21 | $derivedKey = $solr->getConfig('derived_key'); |
|
27 | |||
28 | // Set the base bath to point to the configured index. |
||
29 | 21 | $solr->getConfig()->set('base_path', '/solr/' . $indexId); |
|
30 | |||
31 | // Attach the Acquia Search HMAC Authentication plugin to the client. |
||
32 | 21 | $signature = new Signature($derivedKey); |
|
33 | 21 | $plugin = new AcquiaSearchAuthPlugin($indexId, $signature); |
|
34 | 21 | $solr->addSubscriber($plugin); |
|
35 | |||
36 | 21 | return $solr; |
|
37 | } |
||
38 | |||
51 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: