Skip to content

Commit 9ecd3d8

Browse files
committed
styling using pint
1 parent aef69b1 commit 9ecd3d8

File tree

10 files changed

+30
-33
lines changed

10 files changed

+30
-33
lines changed

src/AdminResources/Emails.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function get(array $params = []): array
129129
$params = http_build_query($params);
130130
}
131131

132-
//get messages from folderId
132+
// get messages from folderId
133133
$emails = MsGraphAdmin::get('users/'.$this->userId.'/messages?'.$params);
134134

135135
$data = MsGraphAdmin::getPagination($emails, $top, $skip);
@@ -163,21 +163,21 @@ public function findInlineAttachments(array $email): array
163163
{
164164
$attachments = self::findAttachments($email['id']);
165165

166-
//replace every case of <img='cid:' with the base64 image
166+
// replace every case of <img='cid:' with the base64 image
167167
$email['body']['content'] = preg_replace_callback(
168168
'~cid.*?"~',
169169
function (array $m) use ($attachments) {
170-
//remove the last quote
170+
// remove the last quote
171171
$parts = explode('"', $m[0]);
172172

173-
//remove cid:
173+
// remove cid:
174174
$contentId = str_replace('cid:', '', $parts[0]);
175175

176-
//loop over the attachments
176+
// loop over the attachments
177177
foreach ($attachments['value'] as $file) {
178-
//if there is a match
178+
// if there is a match
179179
if ($file['contentId'] == $contentId) {
180-
//return a base64 image with a quote
180+
// return a base64 image with a quote
181181
return 'data:'.$file['contentType'].';base64,'.$file['contentBytes'].'"';
182182
}
183183
}

src/Events/NewMicrosoft365SignInEvent.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ class NewMicrosoft365SignInEvent
1212
use InteractsWithSockets;
1313
use SerializesModels;
1414

15-
public function __construct(public array $token)
16-
{
17-
18-
}
15+
public function __construct(public array $token) {}
1916
}

src/Listeners/NewMicrosoft365SignInListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function handle(object $event): void
1818
'password' => '',
1919
]);
2020

21-
(new MsGraph())->storeToken(
21+
(new MsGraph)->storeToken(
2222
$event->token['accessToken'],
2323
$event->token['refreshToken'],
2424
$event->token['expires'],

src/MsGraph.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ class MsGraph
2828
{
2929
public function contacts(): Contacts
3030
{
31-
return new Contacts();
31+
return new Contacts;
3232
}
3333

3434
public function emails(): Emails
3535
{
36-
return new Emails();
36+
return new Emails;
3737
}
3838

3939
public function files(): Files
4040
{
41-
return new Files();
41+
return new Files;
4242
}
4343

4444
public function sites(): Sites
4545
{
46-
return new Sites();
46+
return new Sites;
4747
}
4848

4949
public function tasklists(): TaskLists
5050
{
51-
return new TaskLists();
51+
return new TaskLists;
5252
}
5353

5454
public function tasks(): Tasks
5555
{
56-
return new Tasks();
56+
return new Tasks;
5757
}
5858

5959
protected static string $baseUrl = 'https://graph.microsoft.com/v1.0/';
@@ -83,7 +83,7 @@ public static function setUserModel(string $model): static
8383
{
8484
self::$userModel = $model;
8585

86-
return new static();
86+
return new static;
8787
}
8888

8989
/**
@@ -258,7 +258,7 @@ public function __call(string $function, array $args)
258258
if (in_array($function, $options)) {
259259
return self::guzzle($function, $path, $data, $headers, $id);
260260
} else {
261-
//request verb is not in the $options array
261+
// request verb is not in the $options array
262262
throw new Exception($function.' is not a valid HTTP Verb');
263263
}
264264
}

src/MsGraphAdmin.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ class MsGraphAdmin
2222
{
2323
public function calendarEvents(): CalendarEvents
2424
{
25-
return new CalendarEvents();
25+
return new CalendarEvents;
2626
}
2727

2828
public function calendars(): Calendars
2929
{
30-
return new Calendars();
30+
return new Calendars;
3131
}
3232

3333
public function contacts(): Contacts
3434
{
35-
return new Contacts();
35+
return new Contacts;
3636
}
3737

3838
public function emails(): Emails
3939
{
40-
return new Emails();
40+
return new Emails;
4141
}
4242

4343
public function events(): Events
4444
{
45-
return new Events();
45+
return new Events;
4646
}
4747

4848
public function files(): Files
4949
{
50-
return new Files();
50+
return new Files;
5151
}
5252

5353
protected static string $baseUrl = 'https://graph.microsoft.com/v1.0/';
@@ -136,7 +136,7 @@ public function getTokenData(): ?MsGraphToken
136136

137137
protected function storeToken(string $access_token, string $refresh_token, string $expires): MsGraphToken
138138
{
139-
//Create or update a new record for admin token
139+
// Create or update a new record for admin token
140140
return MsGraphToken::updateOrCreate(['user_id' => null], [
141141
'email' => 'application_token', // Placeholder name
142142
'access_token' => $access_token,
@@ -157,7 +157,7 @@ public function __call(string $function, array $args): mixed
157157
if (in_array($function, $options)) {
158158
return self::guzzle($function, $path, $data);
159159
} else {
160-
//request verb is not in the $options array
160+
// request verb is not in the $options array
161161
throw new Exception($function.' is not a valid HTTP Verb');
162162
}
163163
}

src/MsGraphServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function registerFilesystem(): void
7575
$clientId = config('msgraph.clientId');
7676
$clientSecret = config('msgraph.clientSecret');
7777

78-
$guzzle = new Client();
78+
$guzzle = new Client;
7979
$response = $guzzle->post("https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token",
8080
[
8181
'headers' => [

src/Resources/Contacts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function getParams(array $params, int $perPage): string
6161
'$count' => 'true',
6262
]);
6363
} else {
64-
//ensure $top, $skip and $count are part of params
64+
// ensure $top, $skip and $count are part of params
6565
if (! in_array('$top', $params)) {
6666
$params['$top'] = $perPage;
6767
}

src/Resources/Files.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function createFolder(string $name, string $path, string $type = 'me', st
5353

5454
return MsGraph::post($path, [
5555
'name' => $name,
56-
'folder' => new \stdClass(),
56+
'folder' => new \stdClass,
5757
'@microsoft.graph.conflictBehavior' => $behavior,
5858
]);
5959
}

src/Resources/Tasks/Tasks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function getParams(array $params, int $perPage, string $instance): arr
6464
'$skip' => $page,
6565
];
6666
} else {
67-
//ensure $top, $skip and $count are part of params
67+
// ensure $top, $skip and $count are part of params
6868
if (! in_array('$top', $params)) {
6969
$params['$top'] = $perPage;
7070
}

tests/MsGraphAdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
});
1010

1111
test('can initalise', function () {
12-
$this->assertInstanceOf(MsGraphAdmin::class, new MsGraphAdmin());
12+
$this->assertInstanceOf(MsGraphAdmin::class, new MsGraphAdmin);
1313
});
1414

1515
test('can refresh token', function () {

0 commit comments

Comments
 (0)