Code Duplication    Length = 16-16 lines in 2 locations

src/BrowscapUpdater.php 1 location

@@ 111-126 (lines=16) @@
108
     * @throws \BrowscapPHP\Exception
109
     * @return \BrowscapPHP\BrowscapUpdater
110
     */
111
    public function setCache($cache)
112
    {
113
        if ($cache instanceof BrowscapCacheInterface) {
114
            $this->cache = $cache;
115
        } elseif ($cache instanceof AdapterInterface) {
116
            $this->cache = new BrowscapCache($cache);
117
        } else {
118
            throw new Exception(
119
                'the cache has to be an instance of \BrowscapPHP\Cache\BrowscapCacheInterface or '
120
                . 'an instanceof of \WurflCache\Adapter\AdapterInterface',
121
                Exception::CACHE_INCOMPATIBLE
122
            );
123
        }
124
125
        return $this;
126
    }
127
128
    /**
129
     * Sets a logger instance

src/Browscap.php 1 location

@@ 136-151 (lines=16) @@
133
     * @throws \BrowscapPHP\Exception
134
     * @return \BrowscapPHP\Browscap
135
     */
136
    public function setCache($cache)
137
    {
138
        if ($cache instanceof BrowscapCacheInterface) {
139
            $this->cache = $cache;
140
        } elseif ($cache instanceof AdapterInterface) {
141
            $this->cache = new BrowscapCache($cache);
142
        } else {
143
            throw new Exception(
144
                'the cache has to be an instance of \BrowscapPHP\Cache\BrowscapCacheInterface or '
145
                . 'an instanceof of \WurflCache\Adapter\AdapterInterface',
146
                Exception::CACHE_INCOMPATIBLE
147
            );
148
        }
149
150
        return $this;
151
    }
152
153
    /**
154
     * Sets the parser instance to use