Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "microsoft/azure-storage-common",
"version": "1.5.2",
"description": "This project provides a set of common code shared by Azure Storage Blob, Table, Queue and File PHP client libraries.",
"keywords": [ "php", "azure", "storage", "sdk", "common" ],
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Internal/Middlewares/CommonRequestMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class CommonRequestMiddleware extends MiddlewareBase
* @param array $headers The headers to be added.
*/
public function __construct(
IAuthScheme $authenticationScheme = null,
$storageAPIVersion,
$serviceSDKVersion,
?IAuthScheme $authenticationScheme = null,
?string $storageAPIVersion = null,
?string $serviceSDKVersion = null,
array $headers = array()
) {
$this->authenticationScheme = $authenticationScheme;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Internal/RestProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RestProxy
*
* @param Serialization\ISerializer $dataSerializer The data serializer.
*/
public function __construct(Serialization\ISerializer $dataSerializer = null)
public function __construct(?Serialization\ISerializer $dataSerializer = null)
{
$this->middlewares = array();
$this->dataSerializer = $dataSerializer;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Internal/Serialization/ISerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function objectSerialize($targetObject, $rootName);
*
* @return string
*/
public function serialize(array $array, array $properties = null);
public function serialize(array $array, ?array $properties = null);


/**
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Internal/Serialization/XmlSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class XmlSerializer implements ISerializer
*
* @return array
*/
private function sxml2arr($sxml, array $arr = null)
private function sxml2arr($sxml, ?array $arr = null)
{
foreach ((array) $sxml as $key => $value) {
if (is_object($value) || (is_array($value))) {
Expand All @@ -77,7 +77,7 @@ private function sxml2arr($sxml, array $arr = null)
*
* @return void
*/
private function arr2xml(\XMLWriter $xmlw, array $data, $defaultTag = null)
private function arr2xml(\XMLWriter $xmlw, array $data, ?string $defaultTag = null)
{
foreach ($data as $key => $value) {
if ($key === Resources::XTAG_ATTRIBUTES) {
Expand Down Expand Up @@ -190,7 +190,7 @@ public static function objectSerialize($targetObject, $rootName)
*
* @return string
*/
public function serialize(array $array, array $properties = null)
public function serialize(array $array, ?array $properties = null)
{
$xmlVersion = '1.0';
$xmlEncoding = 'UTF-8';
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Internal/ServiceRestProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ protected function sendAsync(
$path,
$expected = Resources::STATUS_OK,
$body = Resources::EMPTY_STRING,
ServiceOptions $serviceOptions = null
?ServiceOptions $serviceOptions = null
) {
if ($serviceOptions == null) {
$serviceOptions = new ServiceOptions();
Expand Down Expand Up @@ -560,7 +560,7 @@ public static function groupQueryValues(array $values)
*
* @return array
*/
protected function addMetadataHeaders(array $headers, array $metadata = null)
protected function addMetadataHeaders(array $headers, ?array $metadata = null)
{
Utilities::validateMetadata($metadata);

Expand All @@ -577,7 +577,7 @@ protected function addMetadataHeaders(array $headers, array $metadata = null)
*
* @return array
*/
public function generateMetadataHeaders(array $metadata = null)
public function generateMetadataHeaders(?array $metadata = null)
{
$metadataHeaders = array();

Expand Down
12 changes: 6 additions & 6 deletions src/Common/Internal/ServiceRestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ trait ServiceRestTrait
* @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452239.aspx
*/
public function getServiceProperties(
ServiceOptions $options = null
?ServiceOptions $options = null
) {
return $this->getServicePropertiesAsync($options)->wait();
}
Expand All @@ -71,7 +71,7 @@ public function getServiceProperties(
* @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452239.aspx
*/
public function getServicePropertiesAsync(
ServiceOptions $options = null
?ServiceOptions $options = null
) {
$method = Resources::HTTP_GET;
$headers = array();
Expand Down Expand Up @@ -126,7 +126,7 @@ public function getServicePropertiesAsync(
*/
public function setServiceProperties(
ServiceProperties $serviceProperties,
ServiceOptions $options = null
?ServiceOptions $options = null
) {
$this->setServicePropertiesAsync($serviceProperties, $options)->wait();
}
Expand All @@ -146,7 +146,7 @@ public function setServiceProperties(
*/
public function setServicePropertiesAsync(
ServiceProperties $serviceProperties,
ServiceOptions $options = null
?ServiceOptions $options = null
) {
Validate::isTrue(
$serviceProperties instanceof ServiceProperties,
Expand Down Expand Up @@ -202,7 +202,7 @@ public function setServicePropertiesAsync(
*
* @return GetServiceStatsResult
*/
public function getServiceStats(ServiceOptions $options = null)
public function getServiceStats(?ServiceOptions $options = null)
{
return $this->getServiceStatsAsync($options)->wait();
}
Expand All @@ -215,7 +215,7 @@ public function getServiceStats(ServiceOptions $options = null)
*
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getServiceStatsAsync(ServiceOptions $options = null)
public function getServiceStatsAsync(?ServiceOptions $options = null)
{
$method = Resources::HTTP_GET;
$headers = array();
Expand Down
14 changes: 7 additions & 7 deletions src/Common/Internal/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Utilities
*
* @return mixed
*/
public static function tryGetValue($array, $key, $default = null)
public static function tryGetValue($array, $key, mixed $default = null)
{
return (!is_null($array)) && is_array($array) && array_key_exists($key, $array)
? $array[$key]
Expand Down Expand Up @@ -260,7 +260,7 @@ public static function unserialize($xml)
*
* @return array
*/
private static function _sxml2arr($sxml, array $arr = null)
private static function _sxml2arr($sxml, ?array $arr = null)
{
foreach ((array) $sxml as $key => $value) {
if (is_object($value) || (is_array($value))) {
Expand All @@ -287,8 +287,8 @@ private static function _sxml2arr($sxml, array $arr = null)
public static function serialize(
array $array,
$rootName,
$defaultTag = null,
$standalone = null
?string $defaultTag = null,
?string $standalone = null
) {
$xmlVersion = '1.0';
$xmlEncoding = 'UTF-8';
Expand Down Expand Up @@ -323,7 +323,7 @@ public static function serialize(
private static function _arr2xml(
\XMLWriter $xmlw,
array $data,
$defaultTag = null
?string $defaultTag = null
) {
foreach ($data as $key => $value) {
if (strcmp($key, '@attributes') == 0) {
Expand Down Expand Up @@ -528,7 +528,7 @@ public static function arrayKeyExistsInsensitive($key, array $search)
*
* @return mixed
*/
public static function tryGetValueInsensitive($key, $haystack, $default = null)
public static function tryGetValueInsensitive($key, $haystack,mixed $default = null)
{
$array = array_change_key_case($haystack);
return Utilities::tryGetValue($array, strtolower($key), $default);
Expand Down Expand Up @@ -751,7 +751,7 @@ public static function getMetadataArray(array $headers)
*
* @return void
*/
public static function validateMetadata(array $metadata = null)
public static function validateMetadata(?array $metadata = null)
{
if (!is_null($metadata)) {
Validate::isArray($metadata, 'metadata');
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Models/ServiceOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class ServiceOptions
/**
* Initialize the properties to default value.
*/
public function __construct(ServiceOptions $options = null)
public function __construct(?ServiceOptions $options = null)
{
if ($options == null) {
$this->setNumberOfConcurrency(Resources::NUMBER_OF_CONCURRENCY);
Expand Down