Code Duplication    Length = 12-12 lines in 2 locations

src/Connection.php 1 location

@@ 587-598 (lines=12) @@
584
    {
585
        $cacheKey = md5(json_encode($parameters));
586
587
        if (!array_key_exists($cacheKey, self::$listContainersCache)) {
588
            $tmp = array();
589
590
            foreach ($parameters as $k => $v) {
591
                if (in_array($k, self::$allowedParameters)) {
592
                    $tmp[$k] = $v;
593
                }
594
            }
595
596
            $response = $this->makeRequest(Client::GET, array(), array(), $tmp);
597
            self::$listContainersCache[$cacheKey] = $response['body'];
598
        }
599
600
        return self::$listContainersCache[$cacheKey];
601
    }

src/Container.php 1 location

@@ 621-632 (lines=12) @@
618
    {
619
        $cacheKey = md5(json_encode(array($this->getName(), $parameters)));
620
621
        if (!array_key_exists($cacheKey, self::$listObjectsCache)) {
622
            $tmp = array();
623
624
            foreach ($parameters as $k => $v) {
625
                if (in_array($k, self::$allowedParameters)) {
626
                    $tmp[$k] = $v;
627
                }
628
            }
629
630
            $response = $this->connection->makeRequest(Client::GET, array($this->name), array(), $tmp);
631
            self::$listObjectsCache[$cacheKey] = $response['body'];
632
        }
633
634
        return self::$listObjectsCache[$cacheKey];
635
    }