Code Duplication    Length = 43-43 lines in 2 locations

web/ckfinder/core/connector/php/vendor/microsoft/azure-storage/src/File/FileRestProxy.php 2 locations

@@ 1418-1460 (lines=43) @@
1415
     *
1416
     * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata
1417
     */
1418
    public function setDirectoryMetadataAsync(
1419
        $share,
1420
        $path,
1421
        array $metadata,
1422
        FileServiceOptions $options = null
1423
    ) {
1424
        Validate::isString($share, 'share');
1425
        Validate::isString($path, 'path');
1426
1427
        $method      = Resources::HTTP_PUT;
1428
        $postParams  = array();
1429
        $queryParams = array(Resources::QP_REST_TYPE => 'directory');
1430
        $path        = $this->createPath($share, $path);
1431
1432
        Utilities::validateMetadata($metadata);
1433
        $headers = $this->generateMetadataHeaders($metadata);
1434
        if (is_null($options)) {
1435
            $options = new FileServiceOptions();
1436
        }
1437
1438
        $this->addOptionalQueryParam(
1439
            $queryParams,
1440
            Resources::QP_COMP,
1441
            'metadata'
1442
        );
1443
1444
        $this->addOptionalQueryParam(
1445
            $queryParams,
1446
            Resources::QP_TIMEOUT,
1447
            $options->getTimeout()
1448
        );
1449
1450
        return $this->sendAsync(
1451
            $method,
1452
            $headers,
1453
            $queryParams,
1454
            $postParams,
1455
            $path,
1456
            Resources::STATUS_OK,
1457
            Resources::EMPTY_STRING,
1458
            $options
1459
        );
1460
    }
1461
1462
    /**
1463
     * Create a new file.
@@ 2052-2094 (lines=43) @@
2049
     *
2050
     * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-metadata
2051
     */
2052
    public function setFileMetadataAsync(
2053
        $share,
2054
        $path,
2055
        array $metadata,
2056
        FileServiceOptions $options = null
2057
    ) {
2058
        Validate::isString($share, 'share');
2059
        Validate::isString($path, 'path');
2060
2061
        $method      = Resources::HTTP_PUT;
2062
        $postParams  = array();
2063
        $queryParams = array();
2064
        $path        = $this->createPath($share, $path);
2065
2066
        Utilities::validateMetadata($metadata);
2067
        $headers = $this->generateMetadataHeaders($metadata);
2068
        if (is_null($options)) {
2069
            $options = new FileServiceOptions();
2070
        }
2071
2072
        $this->addOptionalQueryParam(
2073
            $queryParams,
2074
            Resources::QP_COMP,
2075
            'metadata'
2076
        );
2077
2078
        $this->addOptionalQueryParam(
2079
            $queryParams,
2080
            Resources::QP_TIMEOUT,
2081
            $options->getTimeout()
2082
        );
2083
2084
        return $this->sendAsync(
2085
            $method,
2086
            $headers,
2087
            $queryParams,
2088
            $postParams,
2089
            $path,
2090
            Resources::STATUS_OK,
2091
            Resources::EMPTY_STRING,
2092
            $options
2093
        );
2094
    }
2095
2096
    /**
2097
     * Writes range of bytes to a file. Range can be at most 4MB in length.