_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q255400
ConnectionStringParser._extractKey
test
private function _extractKey() { $key = null; $firstPos = $this->_pos; $ch = $this->_value[$this->_pos]; if ($ch == '"' || $ch == '\'') { $this->_pos++; $key = $this->_extractString($ch); } elseif ($ch == ';' || $ch == '=') { //...
php
{ "resource": "" }
q255401
ConnectionStringParser._extractString
test
private function _extractString($quote) { $firstPos = $this->_pos; while ($this->_pos < strlen($this->_value) && $this->_value[$this->_pos] != $quote ) { $this->_pos++; } if ($this->_pos == strlen($this->_value)) { // Runaway string. ...
php
{ "resource": "" }
q255402
ConnectionStringParser._skipOperator
test
private function _skipOperator($operatorChar) { if ($this->_value[$this->_pos] != $operatorChar) { // Character was expected. throw $this->_createException( $this->_pos, Resources::MISSING_CONNECTION_STRING_CHAR, $operatorChar ...
php
{ "resource": "" }
q255403
GetShareACLResult.create
test
public static function create( $etag, \DateTime $lastModified, array $parsed = null ) { $result = new GetShareAclResult(); $result->setETag($etag); $result->setLastModified($lastModified); $acl = ShareACL::create($parsed); $result->setShareAcl($acl); ...
php
{ "resource": "" }
q255404
CommonRequestMiddleware.onRequest
test
protected function onRequest(RequestInterface $request) { $result = $request; //Adding headers. foreach ($this->headers as $key => $value) { $headers = $result->getHeaders(); if (!array_key_exists($key, $headers)) { $result = $result->withHeader($key,...
php
{ "resource": "" }
q255405
ServiceSettings.settingWithFunc
test
protected static function settingWithFunc($name, $predicate) { $requirement = array(); $requirement[Resources::SETTING_NAME] = $name; $requirement[Resources::SETTING_CONSTRAINT] = $predicate; return $requirement; }
php
{ "resource": "" }
q255406
ServiceSettings.setting
test
protected static function setting($name) { $validValues = func_get_args(); // Remove $name argument. unset($validValues[0]); $validValuesCount = func_num_args(); $predicate = function ($settingValue) use ($validValuesCount, $validValues) { if (empty($validValue...
php
{ "resource": "" }
q255407
ServiceSettings.matchedSpecification
test
protected static function matchedSpecification(array $settings) { $constraints = func_get_args(); // Remove first element which corresponds to $settings unset($constraints[0]); foreach ($constraints as $constraint) { $remainingSettings = $constraint($settings); ...
php
{ "resource": "" }
q255408
TableContinuationTokenTrait.setNextRowKey
test
public function setNextRowKey($nextRowKey) { if ($this->continuationToken == null) { $this->setContinuationToken(new TableContinuationToken()); } $this->continuationToken->setNextRowKey($nextRowKey); }
php
{ "resource": "" }
q255409
TableContinuationTokenTrait.setNextPartitionKey
test
public function setNextPartitionKey($nextPartitionKey) { if ($this->continuationToken == null) { $this->setContinuationToken(new TableContinuationToken()); } $this->continuationToken->setNextPartitionKey($nextPartitionKey); }
php
{ "resource": "" }
q255410
EdmType.processType
test
public static function processType($type) { $type = empty($type) ? self::STRING : $type; Validate::isTrue(self::isValid($type), Resources::INVALID_EDM_MSG); return $type; }
php
{ "resource": "" }
q255411
EdmType.validateEdmValue
test
public static function validateEdmValue($type, $value, &$condition = null) { // Having null value means that the user wants to remove the property name // associated with this value. Leave the value as null so this hold. if (is_null($value)) { return true; } else { ...
php
{ "resource": "" }
q255412
EdmType.serializeValue
test
public static function serializeValue($type, $value) { switch ($type) { case null: return $value; case EdmType::INT32: return intval($value); case EdmType::INT64: case EdmType::GUID: case EdmType::STRING: return strval($value); ...
php
{ "resource": "" }
q255413
EdmType.serializeQueryValue
test
public static function serializeQueryValue($type, $value) { switch ($type) { case EdmType::DATETIME: $edmDate = Utilities::convertToEdmDateTime($value); return 'datetime\'' . $edmDate . '\''; case EdmType::BINARY: return 'X\'' . implode('', unpack("H*", $...
php
{ "resource": "" }
q255414
EdmType.unserializeQueryValue
test
public static function unserializeQueryValue($type, $value) { // Having null value means that the user wants to remove the property name // associated with this value. Leave the value as null so this hold. if (is_null($value)) { return null; } else { switch ($...
php
{ "resource": "" }
q255415
ServiceProperties.create
test
public static function create(array $parsedResponse) { $result = new ServiceProperties(); if (array_key_exists(Resources::XTAG_DEFAULT_SERVICE_VERSION, $parsedResponse) && $parsedResponse[Resources::XTAG_DEFAULT_SERVICE_VERSION] != null) { $result->setDefaultServiceVersion($...
php
{ "resource": "" }
q255416
ServiceProperties.getCorsesArray
test
private function getCorsesArray() { $corsesArray = array(); if (count($this->getCorses()) == 1) { $corsesArray = array( Resources::XTAG_CORS_RULE => $this->getCorses()[0]->toArray() ); } elseif ($this->getCorses() != array()) { foreach ($th...
php
{ "resource": "" }
q255417
ConnectionStringSource._init
test
private static function _init() { if (!self::$_isInitialized) { self::$_defaultSources = array( self::ENVIRONMENT_SOURCE => array(__CLASS__, 'environmentSource') ); self::$_isInitialized = true; } }
php
{ "resource": "" }
q255418
JsonODataReaderWriter.parseTableEntries
test
public function parseTableEntries($body) { $tables = array(); $result = json_decode($body, true); $rawEntries = $result[Resources::JSON_VALUE]; foreach ($rawEntries as $entry) { $tables[] = $entry[Resources::JSON_TABLE_NAME]; } return $tables; ...
php
{ "resource": "" }
q255419
JsonODataReaderWriter.getEntity
test
public function getEntity(Entity $entity) { $entityProperties = $entity->getProperties(); $properties = array(); foreach ($entityProperties as $name => $property) { $edmType = $property->getEdmType(); $edmValue = $property->getValue(); if (is_...
php
{ "resource": "" }
q255420
JsonODataReaderWriter.parseEntities
test
public function parseEntities($body) { $rawEntities = json_decode($body, true); $entities = array(); foreach ($rawEntities[Resources::JSON_VALUE] as $rawEntity) { $entities[] = $this->parseOneEntity($rawEntity); } return $entities; }
php
{ "resource": "" }
q255421
AccessPolicy.setStart
test
public function setStart(\DateTime $start = null) { if ($start != null) { Validate::isDate($start); } $this->start = $start; }
php
{ "resource": "" }
q255422
AccessPolicy.validatePermission
test
private function validatePermission($permission) { $validPermissions = static::getResourceValidPermissions(); $result = ''; foreach ($validPermissions as $validPermission) { if (strpos($permission, $validPermission) !== false) { //append the valid permission to re...
php
{ "resource": "" }
q255423
FileRestProxy.createPath
test
private function createPath($share, $directory = '') { if (empty($directory) && ($directory != '0')) { return empty($share) ? '/' : $share; } $encodedFile = urlencode($directory); // Unencode the forward slashes to match what the server expects. $encodedFile = str...
php
{ "resource": "" }
q255424
FileRestProxy.getSharePropertiesAsyncImpl
test
private function getSharePropertiesAsyncImpl( $share, FileServiceOptions $options = null, $operation = null ) { Validate::canCastAsString($share, 'share'); Validate::isTrue( $operation == 'properties' || $operation == 'metadata', Resources::FILE_SHARE_...
php
{ "resource": "" }
q255425
FileRestProxy.setSharePropertiesAsyncImpl
test
private function setSharePropertiesAsyncImpl( $share, array $properties, FileServiceOptions $options = null, $operation = 'properties' ) { Validate::canCastAsString($share, 'share'); Validate::isTrue( $operation == 'properties' || $operation == 'metadata',...
php
{ "resource": "" }
q255426
FileRestProxy.listSharesAsync
test
public function listSharesAsync(ListSharesOptions $options = null) { $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = Resources::EMPTY_STRING; if (is_null($options)) { $options = ne...
php
{ "resource": "" }
q255427
FileRestProxy.createShare
test
public function createShare( $share, CreateShareOptions $options = null ) { $this->createShareAsync($share, $options)->wait(); }
php
{ "resource": "" }
q255428
FileRestProxy.createShareAsync
test
public function createShareAsync( $share, CreateShareOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($share, 'share'); $method = Resources::HTTP_PUT; $postParams = array(); $queryParams = array(Resources:...
php
{ "resource": "" }
q255429
FileRestProxy.deleteShare
test
public function deleteShare( $share, FileServiceOptions $options = null ) { $this->deleteShareAsync($share, $options)->wait(); }
php
{ "resource": "" }
q255430
FileRestProxy.getShareProperties
test
public function getShareProperties( $share, FileServiceOptions $options = null ) { return $this->getSharePropertiesAsync($share, $options)->wait(); }
php
{ "resource": "" }
q255431
FileRestProxy.setShareProperties
test
public function setShareProperties( $share, $quota, FileServiceOptions $options = null ) { $this->setSharePropertiesAsync($share, $quota, $options)->wait(); }
php
{ "resource": "" }
q255432
FileRestProxy.setSharePropertiesAsync
test
public function setSharePropertiesAsync( $share, $quota, FileServiceOptions $options = null ) { return $this->setSharePropertiesAsyncImpl( $share, [Resources::X_MS_SHARE_QUOTA => $quota], $options, 'properties' ); }
php
{ "resource": "" }
q255433
FileRestProxy.getShareMetadata
test
public function getShareMetadata( $share, FileServiceOptions $options = null ) { return $this->getShareMetadataAsync($share, $options)->wait(); }
php
{ "resource": "" }
q255434
FileRestProxy.setShareMetadata
test
public function setShareMetadata( $share, array $metadata, FileServiceOptions $options = null ) { $this->setShareMetadataAsync($share, $metadata, $options)->wait(); }
php
{ "resource": "" }
q255435
FileRestProxy.setShareMetadataAsync
test
public function setShareMetadataAsync( $share, array $metadata, FileServiceOptions $options = null ) { return $this->setSharePropertiesAsyncImpl( $share, $metadata, $options, 'metadata' ); }
php
{ "resource": "" }
q255436
FileRestProxy.setShareAcl
test
public function setShareAcl( $share, ShareACL $acl, FileServiceOptions $options = null ) { $this->setShareAclAsync($share, $acl, $options)->wait(); }
php
{ "resource": "" }
q255437
FileRestProxy.setShareAclAsync
test
public function setShareAclAsync( $share, ShareACL $acl, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($acl, 'acl'); $method = Resources::HTTP_PUT; $headers = array(); $postParams ...
php
{ "resource": "" }
q255438
FileRestProxy.listDirectoriesAndFiles
test
public function listDirectoriesAndFiles( $share, $path = '', ListDirectoriesAndFilesOptions $options = null ) { return $this->listDirectoriesAndFilesAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255439
FileRestProxy.listDirectoriesAndFilesAsync
test
public function listDirectoriesAndFilesAsync( $share, $path = '', ListDirectoriesAndFilesOptions $options = null ) { Validate::notNull($share, 'share'); Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resou...
php
{ "resource": "" }
q255440
FileRestProxy.createDirectory
test
public function createDirectory( $share, $path, CreateDirectoryOptions $options = null ) { $this->createDirectoryAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255441
FileRestProxy.createDirectoryAsync
test
public function createDirectoryAsync( $share, $path, CreateDirectoryOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path, 'path'); $method = Resources::HTTP_PUT; ...
php
{ "resource": "" }
q255442
FileRestProxy.deleteDirectory
test
public function deleteDirectory( $share, $path, FileServiceOptions $options = null ) { $this->deleteDirectoryAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255443
FileRestProxy.getDirectoryProperties
test
public function getDirectoryProperties( $share, $path, FileServiceOptions $options = null ) { return $this->getDirectoryPropertiesAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255444
FileRestProxy.getDirectoryPropertiesAsync
test
public function getDirectoryPropertiesAsync( $share, $path, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resources::HTTP_GET; $headers = array(); $postP...
php
{ "resource": "" }
q255445
FileRestProxy.getDirectoryMetadata
test
public function getDirectoryMetadata( $share, $path, FileServiceOptions $options = null ) { return $this->getDirectoryMetadataAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255446
FileRestProxy.setDirectoryMetadata
test
public function setDirectoryMetadata( $share, $path, array $metadata, FileServiceOptions $options = null ) { $this->setDirectoryMetadataAsync( $share, $path, $metadata, $options )->wait(); }
php
{ "resource": "" }
q255447
FileRestProxy.createFile
test
public function createFile( $share, $path, $size, CreateFileOptions $options = null ) { return $this->createFileAsync( $share, $path, $size, $options )->wait(); }
php
{ "resource": "" }
q255448
FileRestProxy.createFileAsync
test
public function createFileAsync( $share, $path, $size, CreateFileOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::notNullOrEmpty($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path...
php
{ "resource": "" }
q255449
FileRestProxy.deleteFile
test
public function deleteFile( $share, $path, FileServiceOptions $options = null ) { $this->deleteFileAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255450
FileRestProxy.deleteFileAsync
test
public function deleteFileAsync( $share, $path, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resources::HTTP_DELETE; $headers = array(); $postParams = ...
php
{ "resource": "" }
q255451
FileRestProxy.getFile
test
public function getFile( $share, $path, GetFileOptions $options = null ) { return $this->getFileAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255452
FileRestProxy.getFileAsync
test
public function getFileAsync( $share, $path, GetFileOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resources::HTTP_GET; $headers = array(); $postParams = array(); ...
php
{ "resource": "" }
q255453
FileRestProxy.getFileProperties
test
public function getFileProperties( $share, $path, FileServiceOptions $options = null ) { return $this->getFilePropertiesAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255454
FileRestProxy.getFilePropertiesAsync
test
public function getFilePropertiesAsync( $share, $path, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resources::HTTP_HEAD; $headers = array(); $queryPara...
php
{ "resource": "" }
q255455
FileRestProxy.setFileProperties
test
public function setFileProperties( $share, $path, FileProperties $properties, FileServiceOptions $options = null ) { $this->setFilePropertiesAsync($share, $path, $properties, $options)->wait(); }
php
{ "resource": "" }
q255456
FileRestProxy.setFilePropertiesAsync
test
public function setFilePropertiesAsync( $share, $path, FileProperties $properties, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $headers = array(); $method = Resourc...
php
{ "resource": "" }
q255457
FileRestProxy.getFileMetadata
test
public function getFileMetadata( $share, $path, FileServiceOptions $options = null ) { return $this->getFileMetadataAsync($share, $path, $options)->wait(); }
php
{ "resource": "" }
q255458
FileRestProxy.setFileMetadata
test
public function setFileMetadata( $share, $path, array $metadata, FileServiceOptions $options = null ) { return $this->setFileMetadataAsync( $share, $path, $metadata, $options )->wait(); }
php
{ "resource": "" }
q255459
FileRestProxy.setFileMetadataAsync
test
public function setFileMetadataAsync( $share, $path, array $metadata, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); $method = Resources::HTTP_PUT; $postParams = array...
php
{ "resource": "" }
q255460
FileRestProxy.putFileRange
test
public function putFileRange( $share, $path, $content, Range $range, PutFileRangeOptions $options = null ) { $this->putFileRangeAsync( $share, $path, $content, $range, $options )->wait(); }
php
{ "resource": "" }
q255461
FileRestProxy.putFileRangeAsync
test
public function putFileRangeAsync( $share, $path, $content, Range $range, PutFileRangeOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path, 'path'); Val...
php
{ "resource": "" }
q255462
FileRestProxy.createFileFromContent
test
public function createFileFromContent( $share, $path, $content, CreateFileFromContentOptions $options = null ) { $this->createFileFromContentAsync($share, $path, $content, $options)->wait(); }
php
{ "resource": "" }
q255463
FileRestProxy.createFileFromContentAsync
test
public function createFileFromContentAsync( $share, $path, $content, CreateFileFromContentOptions $options = null ) { $stream = Psr7\stream_for($content); $size = $stream->getSize(); if ($options == null) { $options = new CreateFileFromContentOpti...
php
{ "resource": "" }
q255464
FileRestProxy.clearFileRange
test
public function clearFileRange( $share, $path, Range $range, FileServiceOptions $options = null ) { $this->clearFileRangeAsync($share, $path, $range, $options)->wait(); }
php
{ "resource": "" }
q255465
FileRestProxy.clearFileRangeAsync
test
public function clearFileRangeAsync( $share, $path, Range $range, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path, 'path'); Validate::notNullOrE...
php
{ "resource": "" }
q255466
FileRestProxy.listFileRange
test
public function listFileRange( $share, $path, Range $range = null, FileServiceOptions $options = null ) { return $this->listFileRangeAsync($share, $path, $range, $options)->wait(); }
php
{ "resource": "" }
q255467
FileRestProxy.listFileRangeAsync
test
public function listFileRangeAsync( $share, $path, Range $range = null, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::notNullOrEmpty($path, 'path'); Validate::notN...
php
{ "resource": "" }
q255468
FileRestProxy.abortCopy
test
public function abortCopy( $share, $path, $copyID, FileServiceOptions $options = null ) { return $this->abortCopyAsync( $share, $path, $copyID, $options )->wait(); }
php
{ "resource": "" }
q255469
FileRestProxy.abortCopyAsync
test
public function abortCopyAsync( $share, $path, $copyID, FileServiceOptions $options = null ) { Validate::canCastAsString($share, 'share'); Validate::canCastAsString($path, 'path'); Validate::canCastAsString($copyID, 'copyID'); Validate::notNullOrEmpty(...
php
{ "resource": "" }
q255470
BatchOperation.setType
test
public function setType($type) { Validate::isTrue( BatchOperationType::isValid($type), Resources::INVALID_BO_TYPE_MSG ); $this->_type = $type; }
php
{ "resource": "" }
q255471
BatchOperation.addParameter
test
public function addParameter($name, $value) { Validate::isTrue( BatchOperationParameterName::isValid($name), Resources::INVALID_BO_PN_MSG ); $this->_params[$name] = $value; }
php
{ "resource": "" }
q255472
BatchResult._constructResponses
test
private static function _constructResponses($body, IMimeReaderWriter $mimeSerializer) { $responses = array(); $parts = $mimeSerializer->decodeMimeMultipart($body); // Decrease the count of parts to remove the batch response body and just // include change sets response body. We m...
php
{ "resource": "" }
q255473
BatchResult._compareUsingContentId
test
private static function _compareUsingContentId($r1, $r2) { $h1 = array_change_key_case($r1->headers); $h2 = array_change_key_case($r2->headers); $c1 = Utilities::tryGetValue($h1, Resources::CONTENT_ID, 0); $c2 = Utilities::tryGetValue($h2, Resources::CONTENT_ID, 0); return i...
php
{ "resource": "" }
q255474
BatchResult.create
test
public static function create( $body, array $operations, array $contexts, IODataReaderWriter $odataSerializer, IMimeReaderWriter $mimeSerializer ) { $result = new BatchResult(); $responses = self::_constructResponses($body, $mimeSerializer); $...
php
{ "resource": "" }
q255475
XmlSerializer.getInstanceAttributes
test
private static function getInstanceAttributes($targetObject, array $methodArray) { foreach ($methodArray as $method) { if ($method->name == 'getAttributes') { $classProperty = $method->invoke($targetObject); return $classProperty; } } r...
php
{ "resource": "" }
q255476
XmlSerializer.serialize
test
public function serialize(array $array, array $properties = null) { $xmlVersion = '1.0'; $xmlEncoding = 'UTF-8'; $standalone = Utilities::tryGetValue($properties, self::STANDALONE); $defaultTag = Utilities::tryGetValue($properties, self::DEFAULT_TAG); $rootName = U...
php
{ "resource": "" }
q255477
CORS.create
test
public static function create(array $parsedResponse) { Validate::hasKey( Resources::XTAG_ALLOWED_ORIGINS, 'parsedResponse', $parsedResponse ); Validate::hasKey( Resources::XTAG_ALLOWED_METHODS, 'parsedResponse', $parsedR...
php
{ "resource": "" }
q255478
ServiceRestTrait.getServicePropertiesAsync
test
public function getServicePropertiesAsync( ServiceOptions $options = null ) { $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = Resources::EMPTY_STRING; if (is_null($options)) { ...
php
{ "resource": "" }
q255479
ServiceRestTrait.setServiceProperties
test
public function setServiceProperties( ServiceProperties $serviceProperties, ServiceOptions $options = null ) { $this->setServicePropertiesAsync($serviceProperties, $options)->wait(); }
php
{ "resource": "" }
q255480
ServiceRestTrait.setServicePropertiesAsync
test
public function setServicePropertiesAsync( ServiceProperties $serviceProperties, ServiceOptions $options = null ) { Validate::isTrue( $serviceProperties instanceof ServiceProperties, Resources::INVALID_SVC_PROP_MSG ); $method = Resources::HTTP_PU...
php
{ "resource": "" }
q255481
ServiceRestTrait.getServiceStatsAsync
test
public function getServiceStatsAsync(ServiceOptions $options = null) { $method = Resources::HTTP_GET; $headers = array(); $queryParams = array(); $postParams = array(); $path = Resources::EMPTY_STRING; if (is_null($options)) { $options = ...
php
{ "resource": "" }
q255482
ListQueuesResult.create
test
public static function create(array $parsedResponse, $location = '') { $result = new ListQueuesResult(); $serviceEndpoint = Utilities::tryGetKeysChainValue( $parsedResponse, Resources::XTAG_ATTRIBUTES, Resources::XTAG_SERVICE_ENDPOINT );...
php
{ "resource": "" }
q255483
ListQueuesResult.setQueues
test
protected function setQueues(array $queues) { $this->_queues = array(); foreach ($queues as $queue) { $this->_queues[] = clone $queue; } }
php
{ "resource": "" }
q255484
Utilities.tryGetSecondaryEndpointFromPrimaryEndpoint
test
public static function tryGetSecondaryEndpointFromPrimaryEndpoint($uri) { $splitTokens = explode('.', $uri); if (count($splitTokens) > 0 && $splitTokens[0] != '') { $schemaAccountToken = $splitTokens[0]; $schemaAccountSplitTokens = explode('/', $schemaAccountToken); ...
php
{ "resource": "" }
q255485
Utilities.serialize
test
public static function serialize( array $array, $rootName, $defaultTag = null, $standalone = null ) { $xmlVersion = '1.0'; $xmlEncoding = 'UTF-8'; if (!is_array($array)) { return false; } $xmlw = new \XmlWriter(); $xmlw->...
php
{ "resource": "" }
q255486
Utilities.toBoolean
test
public static function toBoolean($obj, $skipNull = false) { if ($skipNull && is_null($obj)) { return null; } return filter_var($obj, FILTER_VALIDATE_BOOLEAN); }
php
{ "resource": "" }
q255487
Utilities.rfc1123ToDateTime
test
public static function rfc1123ToDateTime($date) { $timeZone = new \DateTimeZone('GMT'); $format = Resources::AZURE_DATE_FORMAT; return \DateTime::createFromFormat($format, $date, $timeZone); }
php
{ "resource": "" }
q255488
Utilities.isoDate
test
public static function isoDate(\DateTimeInterface $date) { $date = clone $date; $date = $date->setTimezone(new \DateTimeZone('UTC')); return str_replace('+00:00', 'Z', $date->format('c')); }
php
{ "resource": "" }
q255489
Utilities.convertToDateTime
test
public static function convertToDateTime($value) { if ($value instanceof \DateTime) { return $value; } if (substr($value, -1) == 'Z') { $value = substr($value, 0, strlen($value) - 1); } return new \DateTime($value, new \DateTimeZone('UTC')); }
php
{ "resource": "" }
q255490
Utilities.base256ToDec
test
public static function base256ToDec($number) { Validate::canCastAsString($number, 'number'); $result = 0; $base = 1; for ($i = strlen($number) - 1; $i >= 0; $i--) { $result = bcadd($result, bcmul(ord($number[$i]), $base)); $base = bcmul($base, 256); ...
php
{ "resource": "" }
q255491
Utilities.allZero
test
public static function allZero($content) { $size = strlen($content); // If all Zero, skip this range for ($i = 0; $i < $size; $i++) { if (ord($content[$i]) != 0) { return false; } } return true; }
php
{ "resource": "" }
q255492
Utilities.appendDelimiter
test
public static function appendDelimiter($string, $delimiter) { if (!self::endsWith($string, $delimiter)) { $string .= $delimiter; } return $string; }
php
{ "resource": "" }
q255493
Utilities.requestSentToSecondary
test
public static function requestSentToSecondary( \Psr\Http\Message\RequestInterface $request, array $options ) { $uri = $request->getUri(); $secondaryUri = $options[Resources::ROS_SECONDARY_URI]; $isSecondary = false; if (strpos((string)$uri, (string)$secondaryUri) !== ...
php
{ "resource": "" }
q255494
Utilities.getLocationFromHeaders
test
public static function getLocationFromHeaders(array $headers) { $value = Utilities::tryGetValue( $headers, Resources::X_MS_CONTINUATION_LOCATION_MODE ); $result = ''; if (\is_string($value)) { $result = $value; } elseif (!empty($value)) { ...
php
{ "resource": "" }
q255495
Utilities.calculateContentMD5
test
public static function calculateContentMD5($content) { Validate::notNull($content, 'content'); Validate::canCastAsString($content, 'content'); return base64_encode(md5($content, true)); }
php
{ "resource": "" }
q255496
ShareACL.validateResourceType
test
protected static function validateResourceType($resourceType) { Validate::isTrue( $resourceType == Resources::RESOURCE_TYPE_SHARE || $resourceType == Resources::RESOURCE_TYPE_FILE, Resources::INVALID_RESOURCE_TYPE ); }
php
{ "resource": "" }
q255497
UpdateMessageResult.create
test
public static function create(array $headers) { $result = new UpdateMessageResult(); $result->setPopReceipt(Utilities::tryGetValueInsensitive( Resources::X_MS_POPRECEIPT, $headers )); $timeNextVisible = Utilities::tryGetValueInsensitive( Resources:...
php
{ "resource": "" }
q255498
RetryMiddlewareFactory.create
test
public static function create( $type = self::GENERAL_RETRY_TYPE, $numberOfRetries = Resources::DEFAULT_NUMBER_OF_RETRIES, $interval = Resources::DEFAULT_RETRY_INTERVAL, $accumulationMethod = self::LINEAR_INTERVAL_ACCUMULATION, $retryConnect = false ) { //Validate the ...
php
{ "resource": "" }
q255499
RetryMiddlewareFactory.createRetryDecider
test
protected static function createRetryDecider($type, $maxRetries, $retryConnect) { return function ( $retries, $request, $response = null, $exception = null, $isSecondary = false ) use ( $type, $maxRetries, ...
php
{ "resource": "" }