Skip to content

Commit 0f407d0

Browse files
committed
updated composer.json
1 parent 556fea1 commit 0f407d0

31 files changed

+599
-573
lines changed

changelog.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Where $behavior is either rename or replace
355355
## Fixed
356356

357357
- Corrected refresh tokens after they expire
358-
- Stopped an infinate loop when a token needs to be refreshed
358+
- Stopped an infinite loop when a token needs to be refreshed
359359
- Stopped duplicating users when using a listener
360360
- Stopped token getting deleted on logout
361361
- Stopped token getting overwritten when another user logs in
@@ -414,5 +414,7 @@ Where $behavior is either rename or replace
414414
- Added isaac/composer-git-hooks package to run scripts on commit
415415

416416
## Changed
417+
418+
- Dropped support for Laravel versions below 10
419+
- Dropped support for using cs-fixer
417420
- Fixed an issue in MsGraph connect having an infinite loop when an error is returned from Microsoft
418-
- Dropped support for using csfixer

composer.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,22 @@
1919
"Microsoft365"
2020
],
2121
"require": {
22-
"illuminate/support": "5.5.x|5.6.x|5.7.x|5.8.x|6.x|7.x|8.x|9.x|^10.0",
23-
"league/oauth2-client": "^1.4|^2",
24-
"guzzlehttp/guzzle": "6.x|7.x",
22+
"illuminate/support": "^10.0",
23+
"league/oauth2-client": "^2",
24+
"guzzlehttp/guzzle": "7.x",
2525
"ext-json": "*",
2626
"ext-fileinfo": "*",
2727
"ext-curl": "*",
2828
"shitware-ltd/flysystem-msgraph": "^1.0",
2929
"microsoft/microsoft-graph": "^1.70"
3030
},
3131
"require-dev": {
32-
"orchestra/testbench": "^7.0|^8.0",
33-
"pestphp/pest": "^1.21",
34-
"pestphp/pest-plugin-laravel": "^1.1",
35-
"friendsofphp/php-cs-fixer": "^3.9",
36-
"pestphp/pest-plugin-mock": "^1.0",
32+
"orchestra/testbench": "^8.0",
33+
"pestphp/pest": "^v2.24.2",
34+
"pestphp/pest-plugin-laravel": "^v2.2.0",
3735
"laravel/pint": "^1.13",
38-
"pestphp/pest-plugin-parallel": "^1.2"
36+
"pestphp/pest-plugin-type-coverage": "^2.4",
37+
"mockery/mockery": "^1.6"
3938
},
4039
"autoload": {
4140
"psr-4": {
@@ -65,7 +64,9 @@
6564
}
6665
},
6766
"scripts": {
68-
"test": "vendor/bin/pest --parallel",
67+
"pest": "vendor/bin/pest --parallel",
68+
"pest-cov": "vendor/bin/pest --coverage",
69+
"pest-type": "vendor/bin/pest --type-coverage",
6970
"pint": "vendor/bin/pint"
7071
}
71-
}
72+
}

license.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The MIT License (MIT)
44

5-
Copyright (c) 2020 dcblogdev
5+
Copyright (c) 2023 dcblogdev
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

phpunit.xml

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
bootstrap="vendor/autoload.php"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
colors="true"
8-
verbose="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
156
>
16-
<coverage>
7+
<source>
178
<include>
189
<directory suffix=".php">src/</directory>
1910
</include>
20-
</coverage>
11+
</source>
2112
<testsuites>
2213
<testsuite name="Test">
2314
<directory suffix="Test.php">./tests</directory>

src/AdminResources/CalendarEvents.php

+21-12
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@
77

88
class CalendarEvents extends MsGraphAdmin
99
{
10-
private $userId;
10+
private string $userId = '';
1111

12-
private $top;
12+
private string $top = '';
1313

14-
private $skip;
14+
private string $skip = '';
1515

16-
public function userid($userId)
16+
public function userid(string $userId): static
1717
{
1818
$this->userId = $userId;
1919

2020
return $this;
2121
}
2222

23-
public function top($top)
23+
public function top(string $top): static
2424
{
2525
$this->top = $top;
2626

2727
return $this;
2828
}
2929

30-
public function skip($skip)
30+
public function skip(string $skip): static
3131
{
3232
$this->skip = $skip;
3333

3434
return $this;
3535
}
3636

37-
public function get($calendarId, $params = [])
37+
/**
38+
* @throws Exception
39+
*/
40+
public function get(string $calendarId, array $params = []): array
3841
{
39-
if ($this->userId == null) {
42+
if ($this->userId === '') {
4043
throw new Exception('userId is required.');
4144
}
4245

@@ -65,18 +68,24 @@ public function get($calendarId, $params = [])
6568
];
6669
}
6770

68-
public function find($calendarId, $eventId)
71+
/**
72+
* @throws Exception
73+
*/
74+
public function find(string $calendarId, string $eventId): MsGraphAdmin
6975
{
70-
if ($this->userId == null) {
76+
if ($this->userId === '') {
7177
throw new Exception('userId is required.');
7278
}
7379

7480
return MsGraphAdmin::get("users/$this->userId/calendars/$calendarId/events/$eventId");
7581
}
7682

77-
public function store($calendarId, $data)
83+
/**
84+
* @throws Exception
85+
*/
86+
public function store(string $calendarId, array$data): MsGraphAdmin
7887
{
79-
if ($this->userId == null) {
88+
if ($this->userId === '') {
8089
throw new Exception('userId is required.');
8190
}
8291

src/AdminResources/Calendars.php

+26-14
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@
77

88
class Calendars extends MsGraphAdmin
99
{
10-
private $userId;
10+
private string $userId = '';
1111

12-
private $top;
12+
private string $top = '';
1313

14-
private $skip;
14+
private string $skip = '';
1515

16-
public function userid($userId)
16+
public function userid(string $userId): static
1717
{
1818
$this->userId = $userId;
1919

2020
return $this;
2121
}
2222

23-
public function top($top)
23+
public function top(string $top): static
2424
{
2525
$this->top = $top;
2626

2727
return $this;
2828
}
2929

30-
public function skip($skip)
30+
public function skip(string $skip): static
3131
{
3232
$this->skip = $skip;
3333

3434
return $this;
3535
}
3636

37-
public function get($params = [])
37+
/**
38+
* @throws Exception
39+
*/
40+
public function get(array $params = []): array
3841
{
39-
if ($this->userId == null) {
42+
if ($this->userId === '') {
4043
throw new Exception('userId is required.');
4144
}
4245

@@ -66,12 +69,15 @@ public function get($params = [])
6669
];
6770
}
6871

69-
public function find($id)
72+
public function find(string $id): MsGraphAdmin
7073
{
7174
return MsGraphAdmin::get("users/$this->userId/calendar/$id");
7275
}
7376

74-
public function store(array $data)
77+
/**
78+
* @throws Exception
79+
*/
80+
public function store(array $data): MsGraphAdmin
7581
{
7682
if ($this->userId == null) {
7783
throw new Exception('userId is required.');
@@ -80,18 +86,24 @@ public function store(array $data)
8086
return MsGraphAdmin::post("users/$this->userId/calendars", $data);
8187
}
8288

83-
public function update($id, $data)
89+
/**
90+
* @throws Exception
91+
*/
92+
public function update(string $id, array $data): MsGraphAdmin
8493
{
85-
if ($this->userId == null) {
94+
if ($this->userId === '') {
8695
throw new Exception('userId is required.');
8796
}
8897

8998
return MsGraphAdmin::patch("users/$this->userId/calendars/$id", $data);
9099
}
91100

92-
public function delete($id)
101+
/**
102+
* @throws Exception
103+
*/
104+
public function delete(string $id): MsGraphAdmin
93105
{
94-
if ($this->userId == null) {
106+
if ($this->userId === '') {
95107
throw new Exception('userId is required.');
96108
}
97109

src/AdminResources/Contacts.php

+30-15
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@
77

88
class Contacts extends MsGraphAdmin
99
{
10-
private $userId;
10+
private string $userId = '';
1111

12-
private $top;
12+
private string $top = '';
1313

14-
private $skip;
14+
private string $skip = '';
1515

16-
public function userid($userId)
16+
public function userid(string $userId): static
1717
{
1818
$this->userId = $userId;
1919

2020
return $this;
2121
}
2222

23-
public function top($top)
23+
public function top(string $top): static
2424
{
2525
$this->top = $top;
2626

2727
return $this;
2828
}
2929

30-
public function skip($skip)
30+
public function skip(string $skip): static
3131
{
3232
$this->skip = $skip;
3333

3434
return $this;
3535
}
3636

37-
public function get($params = [])
37+
/**
38+
* @throws Exception
39+
*/
40+
public function get(array $params = []): array
3841
{
39-
if ($this->userId == null) {
42+
if ($this->userId === '') {
4043
throw new Exception('userId is required.');
4144
}
4245

@@ -66,7 +69,10 @@ public function get($params = [])
6669
];
6770
}
6871

69-
public function find($id)
72+
/**
73+
* @throws Exception
74+
*/
75+
public function find(string $id): MsGraphAdmin
7076
{
7177
if ($this->userId == null) {
7278
throw new Exception('userId is required.');
@@ -75,27 +81,36 @@ public function find($id)
7581
return MsGraphAdmin::get('users/'.$this->userId.'/contacts/'.$id);
7682
}
7783

78-
public function store(array $data)
84+
/**
85+
* @throws Exception
86+
*/
87+
public function store(array $data): MsGraphAdmin
7988
{
80-
if ($this->userId == null) {
89+
if ($this->userId === '') {
8190
throw new Exception('userId is required.');
8291
}
8392

8493
return MsGraphAdmin::post('users/'.$this->userId.'/contacts', $data);
8594
}
8695

87-
public function update($id, array $data)
96+
/**
97+
* @throws Exception
98+
*/
99+
public function update(string $id, array $data): MsGraphAdmin
88100
{
89-
if ($this->userId == null) {
101+
if ($this->userId === '') {
90102
throw new Exception('userId is required.');
91103
}
92104

93105
return MsGraphAdmin::patch('users/'.$this->userId.'/contacts/'.$id, $data);
94106
}
95107

96-
public function delete($id)
108+
/**
109+
* @throws Exception
110+
*/
111+
public function delete(string $id): MsGraphAdmin
97112
{
98-
if ($this->userId == null) {
113+
if ($this->userId === '') {
99114
throw new Exception('userId is required.');
100115
}
101116

0 commit comments

Comments
 (0)