Skip to content

Commit b40bbf5

Browse files
committed
Fix php8.4 deprecated notices
1 parent 99db93b commit b40bbf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+52
-52
lines changed

src/Directory/Users/UserCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class UserCollection extends EntityCollection
1212
{
1313

14-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
14+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
1515
{
1616
parent::__construct($ctx, $resourcePath, User::class);
1717
}

src/Entity.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class Entity extends ClientObject
1919
{
2020

21-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, $namespace = null)
21+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, $namespace = null)
2222
{
2323
parent::__construct($ctx, $resourcePath, null, $namespace);
2424
}

src/EntityCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class EntityCollection extends ClientObjectCollection
1919
* @param ResourcePath|null $resourcePath
2020
* @param null $itemTypeName
2121
*/
22-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, $itemTypeName = null)
22+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, $itemTypeName = null)
2323
{
2424
parent::__construct($ctx, $resourcePath, $itemTypeName);
2525
}

src/OneDrive/DriveItems/DriveItemCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class DriveItemCollection extends EntityCollection
1919
{
2020

21-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
21+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
2222
{
2323
parent::__construct($ctx, $resourcePath, DriveItem::class);
2424
}

src/OneDrive/Drives/DriveCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class DriveCollection extends EntityCollection
1313
{
1414

15-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
15+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
1616
{
1717
parent::__construct($ctx, $resourcePath, Drive::class);
1818
}

src/OneDrive/ListItems/ListItemCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ListItemCollection extends EntityCollection
1212
{
1313

14-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
14+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
1515
{
1616
parent::__construct($ctx, $resourcePath, ListItem::class);
1717
}

src/OneDrive/PermissionCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class PermissionCollection extends EntityCollection
1212
{
1313

14-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
14+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
1515
{
1616
parent::__construct($ctx, $resourcePath, Permission::class);
1717
}

src/OneNote/Pages/OnenotePageCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class OnenotePageCollection extends EntityCollection
1313
{
14-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null)
14+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null)
1515
{
1616
parent::__construct($ctx, $resourcePath, OnenotePage::class);
1717
}

src/Outlook/Recipient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class Recipient extends Complex
1111
{
12-
function __construct(EmailAddress $emailAddress=null)
12+
function __construct(?EmailAddress $emailAddress=null)
1313
{
1414
$this->EmailAddress = $emailAddress;
1515
parent::__construct();

src/Runtime/ClientObject.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class ClientObject
5858
* @param string|null $namespace
5959
*/
6060
public function __construct(ClientRuntimeContext $ctx,
61-
ResourcePath $resourcePath = null,
62-
ODataQueryOptions $queryOptions = null,
61+
?ResourcePath $resourcePath = null,
62+
?ODataQueryOptions $queryOptions = null,
6363
$namespace=null)
6464
{
6565
$this->context = $ctx;

src/Runtime/ClientObjectCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ClientObjectCollection extends ClientObject implements IteratorAggregate,
9191
* @param ResourcePath $resourcePath
9292
* @param string $itemTypeName
9393
*/
94-
public function __construct(ClientRuntimeContext $ctx,ResourcePath $resourcePath = null,$itemTypeName=null)
94+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, $itemTypeName=null)
9595
{
9696
parent::__construct($ctx, $resourcePath);
9797
$this->data = array();

src/Runtime/ClientRuntimeContext.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public abstract function getServiceRootUrl();
6363
* @param string[] $includeProperties
6464
* @return ClientRuntimeContext
6565
*/
66-
public function load(ClientObject $clientObject, array $includeProperties = null)
66+
public function load(ClientObject $clientObject, ?array $includeProperties = null)
6767
{
6868
$qry = new ReadEntityQuery($clientObject,$includeProperties);
6969
$this->addQueryAndResultObject($qry, $clientObject);

src/Runtime/OData/ODataReader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function generateModel($options)
1414
{
1515
$model = new ODataModel($options);
1616
$model->onTypeResolved(function ($typeSchema){
17-
echo "${typeSchema['name']} type resolved." . PHP_EOL;
17+
echo "{$typeSchema['name']} type resolved." . PHP_EOL;
1818
});
1919
$edmx = file_get_contents($options['metadataPath']);
2020
$this->parseEdmx($edmx, $model);

src/Runtime/OData/V3/ODataV3Reader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ODataV3Reader extends ODataReader
1212
{
1313

14-
function parseEdmx($edmx, $model, SimpleXMLIterator &$parentNode = null, SimpleXMLIterator &$prevNode = null, $prevValue=null)
14+
function parseEdmx($edmx, $model, ?SimpleXMLIterator &$parentNode = null, ?SimpleXMLIterator &$prevNode = null, $prevValue=null)
1515
{
1616
if (is_null($parentNode)) {
1717
$parentNode = new SimpleXMLIterator($edmx);

src/Runtime/OData/V4/ODataV4Reader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class ODataV4Reader extends ODataReader
1111
{
1212

13-
function parseEdmx($edmx, $model, SimpleXMLIterator &$parentNode = null, SimpleXMLIterator &$prevNode = null, $prevValue=null)
13+
function parseEdmx($edmx, $model, ?SimpleXMLIterator &$parentNode = null, ?SimpleXMLIterator &$prevNode = null, $prevValue=null)
1414
{
1515
if (is_null($parentNode)) {
1616
$parentNode = new SimpleXMLIterator($edmx);

src/Runtime/Paths/EntityPath.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class EntityPath extends ResourcePath
1414
* @param string|null $key
1515
* @param ResourcePath|null $parent
1616
*/
17-
public function __construct($key = null, ResourcePath $parent = null)
17+
public function __construct($key = null, ?ResourcePath $parent = null)
1818
{
1919
parent::__construct($key, $parent);
2020
}

src/Runtime/Paths/ResourcePathUrl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
class ResourcePathUrl extends ResourcePath
1212
{
13-
public function __construct($url, ResourcePath $parent = null)
13+
public function __construct($url, ?ResourcePath $parent = null)
1414
{
1515
parent::__construct($url, $parent);
1616
}

src/Runtime/Paths/ServiceOperationPath.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ServiceOperationPath extends ResourcePath implements ICSOMCallable
2020
* @param array|ClientObject|ClientValue $methodParameters
2121
* @param ResourcePath|null $parent
2222
*/
23-
public function __construct($methodName=null, $methodParameters = null,ResourcePath $parent=null)
23+
public function __construct($methodName=null, $methodParameters = null, ?ResourcePath $parent=null)
2424
{
2525
parent::__construct($this->buildSegment($methodName,$methodParameters), $parent);
2626
$this->methodName = $methodName;

src/Runtime/ResourcePath.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ResourcePath
1010
* @param string $name
1111
* @param ResourcePath|null $parent
1212
*/
13-
public function __construct($name, ResourcePath $parent = null)
13+
public function __construct($name, ?ResourcePath $parent = null)
1414
{
1515
$this->name = $name;
1616
$this->parent = $parent;

src/SharePoint/AttachmentCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AttachmentCollection extends BaseEntityCollection
1616
* @param ResourcePath|null $resourcePath
1717
* @param ClientObject|null $parent
1818
*/
19-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
19+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2020
{
2121
parent::__construct($ctx, $resourcePath, Attachment::class, $parent);
2222
}

src/SharePoint/BaseEntity.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class BaseEntity extends ClientObject
1919
{
2020

2121
public function __construct(ClientRuntimeContext $ctx,
22-
ResourcePath $resourcePath = null,
23-
ODataQueryOptions $queryOptions = null)
22+
?ResourcePath $resourcePath = null,
23+
?ODataQueryOptions $queryOptions = null)
2424
{
2525
parent::__construct($ctx,$resourcePath,$queryOptions,"SP");
2626
}

src/SharePoint/BaseEntityCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class BaseEntityCollection extends ClientObjectCollection
2727
* @param ClientObject|null $parent
2828
*/
2929
public function __construct(ClientRuntimeContext $ctx,
30-
ResourcePath $resourcePath = null,
30+
?ResourcePath $resourcePath = null,
3131
$itemTypeName = null,
32-
ClientObject $parent=null)
32+
?ClientObject $parent=null)
3333
{
3434
parent::__construct($ctx, $resourcePath, $itemTypeName);
3535
$this->parent = $parent;

src/SharePoint/ChangeCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class ChangeCollection extends BaseEntityCollection
1111
{
12-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
12+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1313
{
1414
parent::__construct($ctx, $resourcePath, Change::class, $parent);
1515
}

src/SharePoint/ClientContext.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ClientContext extends ClientRuntimeContext
9494
* @param string $url Site or Web url
9595
* @param IAuthenticationContext $authCtx
9696
*/
97-
public function __construct($url, IAuthenticationContext $authCtx=null)
97+
public function __construct($url, ?IAuthenticationContext $authCtx=null)
9898
{
9999
$this->baseUrl = $url;
100100
$this->getPendingRequest()->beforeExecuteRequest(function (RequestOptions $request) {

src/SharePoint/ContentTypeCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ContentTypeCollection extends BaseEntityCollection
1717
* @param ResourcePath|null $resourcePath
1818
* @param ClientObject|null $parent
1919
*/
20-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
20+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2121
{
2222
parent::__construct($ctx, $resourcePath, ContentType::class, $parent);
2323
}

src/SharePoint/FieldCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class FieldCollection extends BaseEntityCollection
1515
{
1616

17-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
17+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1818
{
1919
parent::__construct($ctx, $resourcePath, Field::class, $parent);
2020
}

src/SharePoint/FileCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class FileCollection extends BaseEntityCollection
1616
{
1717

18-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
18+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1919
{
2020
parent::__construct($ctx, $resourcePath, File::class, $parent);
2121
}
@@ -81,7 +81,7 @@ public function getByUrl($serverRelativeUrl){
8181
* @param callable|null $chunkUploaded
8282
* @return UploadSession
8383
*/
84-
public function createUploadSession($sourcePath, $targetFileName,callable $chunkUploaded=null){
84+
public function createUploadSession($sourcePath, $targetFileName, ?callable $chunkUploaded=null){
8585

8686
$session = new UploadSession();
8787
$session->buildQuery($this,$sourcePath,$targetFileName,$chunkUploaded);

src/SharePoint/FileVersionCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class FileVersionCollection extends BaseEntityCollection
1212
{
13-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
13+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1414
{
1515
parent::__construct($ctx, $resourcePath, FileVersion::class, $parent);
1616
}

src/SharePoint/FolderCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FolderCollection extends BaseEntityCollection
2020
* @param ResourcePath|null $resourcePath
2121
* @param ClientObject|null $parent
2222
*/
23-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
23+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2424
{
2525
parent::__construct($ctx, $resourcePath, Folder::class, $parent);
2626
}

src/SharePoint/GroupCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class GroupCollection extends BaseEntityCollection
2323
* @param ResourcePath|null $resourcePath
2424
* @param ClientObject|null $parent
2525
*/
26-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
26+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2727
{
2828
parent::__construct($ctx, $resourcePath, Group::class, $parent);
2929
}

src/SharePoint/Internal/Paths/FileContentPath.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class FileContentPath extends ResourcePath
1111
/***
1212
* @param ResourcePath|null $parent
1313
*/
14-
public function __construct(ResourcePath $parent = null)
14+
public function __construct(?ResourcePath $parent = null)
1515
{
1616
parent::__construct("\$value", $parent);
1717
}

src/SharePoint/ListCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class ListCollection extends BaseEntityCollection
1515
{
1616

17-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
17+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1818
{
1919
parent::__construct($ctx, $resourcePath, SPList::class , $parent);
2020
}

src/SharePoint/ListItemCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class ListItemCollection extends BaseEntityCollection
1414
{
15-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
15+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1616
{
1717
parent::__construct($ctx, $resourcePath, ListItem::class, $parent);
1818
}

src/SharePoint/Publishing/SpotlightChannelCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class SpotlightChannelCollection extends BaseEntityCollection
1212
{
13-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
13+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1414
{
1515
parent::__construct($ctx, $resourcePath, SpotlightChannel::class, $parent);
1616
}

src/SharePoint/Publishing/VideoCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class VideoCollection extends BaseEntityCollection
1414
{
15-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
15+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1616
{
1717
parent::__construct($ctx, $resourcePath, VideoItem::class, $parent);
1818
}

src/SharePoint/RecycleBinItemCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class RecycleBinItemCollection extends BaseEntityCollection
1616
{
17-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
17+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1818
{
1919
parent::__construct($ctx, $resourcePath, RecycleBinItem::class, $parent);
2020
}

src/SharePoint/RoleAssignmentCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class RoleAssignmentCollection extends BaseEntityCollection
1919
{
2020

21-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
21+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2222
{
2323
parent::__construct($ctx, $resourcePath, RoleAssignment::class, $parent);
2424
}

src/SharePoint/SPList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getItemById($id)
6060
* @param CamlQuery $camlQuery
6161
* @return ListItemCollection
6262
*/
63-
public function getItems(CamlQuery $camlQuery = null)
63+
public function getItems(?CamlQuery $camlQuery = null)
6464
{
6565
$targetItems = new ListItemCollection($this->getContext(), new ResourcePath("items", $this->getResourcePath()));
6666
if (is_null($camlQuery)) {

src/SharePoint/Taxonomy/TaxonomyItemCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class TaxonomyItemCollection extends ClientObjectCollection
1717
private $parent;
1818

1919
public function __construct(ClientRuntimeContext $ctx,
20-
ResourcePath $resourcePath = null,
20+
?ResourcePath $resourcePath = null,
2121
$itemTypeName = null,
22-
TaxonomyItem $parent=null)
22+
?TaxonomyItem $parent=null)
2323
{
2424
parent::__construct($ctx, $resourcePath, $itemTypeName);
2525
$this->parent = $parent;

src/SharePoint/UploadSession.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct()
2727
* @param callable $chunkUploaded
2828
* @param int $chunkSize
2929
*/
30-
function buildQuery($files, $sourcePath, $targetFileName, callable $chunkUploaded=null,$chunkSize = 1048576){
30+
function buildQuery($files, $sourcePath, $targetFileName, ?callable $chunkUploaded=null, $chunkSize = 1048576){
3131
$ctx= $files->getContext();
3232
$fileSize = filesize($sourcePath);
3333
$firstChunk = true;

src/SharePoint/UserCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UserCollection extends BaseEntityCollection
1919
* @param ResourcePath|null $resourcePath
2020
* @param ClientObject|null $parent
2121
*/
22-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
22+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
2323
{
2424
parent::__construct($ctx, $resourcePath, User::class, $parent);
2525
}

src/SharePoint/UserCustomActionCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class UserCustomActionCollection extends BaseEntityCollection
1313
{
14-
public function __construct(ClientRuntimeContext $ctx, ResourcePath $resourcePath = null, ClientObject $parent = null)
14+
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
1515
{
1616
parent::__construct($ctx, $resourcePath, UserCustomAction::class, $parent);
1717
}

0 commit comments

Comments
 (0)