Code Duplication    Length = 9-9 lines in 2 locations

lib/Elastica/Index.php 1 location

@@ 60-68 (lines=9) @@
57
     * @param \Elastica\Client $client Client object
58
     * @param string           $name   Index name
59
     */
60
    public function __construct(Client $client, $name)
61
    {
62
        $this->_client = $client;
63
64
        if (!is_scalar($name)) {
65
            throw new InvalidException('Index name should be a scalar type');
66
        }
67
        $this->_name = (string) $name;
68
    }
69
70
    /**
71
     * Returns a type object for the current index with the given name.

lib/Elastica/IndexTemplate.php 1 location

@@ 38-46 (lines=9) @@
35
     *
36
     * @throws \Elastica\Exception\InvalidException
37
     */
38
    public function __construct(Client $client, $name)
39
    {
40
        $this->_client = $client;
41
42
        if (!is_scalar($name)) {
43
            throw new InvalidException('Index template should be a scalar type');
44
        }
45
        $this->_name = (string) $name;
46
    }
47
48
    /**
49
     * Deletes the index template.