Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
85.71% covered (warning)
85.71%
6 / 7
CRAP
87.50% covered (warning)
87.50%
7 / 8
ConstantAssignment
0.00% covered (danger)
0.00%
0 / 1
85.71% covered (warning)
85.71%
6 / 7
7.10
87.50% covered (warning)
87.50%
7 / 8
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 uniqueId
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getServerList
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getSearchCluster
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getWritableClusters
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 canWriteToCluster
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getCrossClusterName
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
namespace CirrusSearch\Assignment;
class ConstantAssignment implements ClusterAssignment {
    /** @var string[]|array[] Elastica connection configuration */
    private $servers;
    /**
     * @param string[]|array[] $servers Elastica connection configuration
     */
    public function __construct( array $servers ) {
        $this->servers = $servers;
    }
    public function uniqueId( $cluster ) {
        return 'default';
    }
    /**
     * @param string|null $cluster
     * @return string[]|array[]
     */
    public function getServerList( $cluster = null ): array {
        return $this->servers;
    }
    public function getSearchCluster() {
        return 'default';
    }
    public function getWritableClusters(): array {
        return [ 'default' ];
    }
    public function canWriteToCluster( $clusterName ) {
        return true;
    }
    public function getCrossClusterName() {
        return null;
    }
}