Skip to content

Commit

Permalink
Merge pull request #86 from dcblogdev/corrected-types
Browse files Browse the repository at this point in the history
Corrected types
  • Loading branch information
dcblogdev authored Nov 14, 2024
2 parents 212d328 + 5e85d83 commit 9c58e3c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Resources/Contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function update(string $id, array $data): array
return MsGraph::patch("me/contacts/$id", $data);
}

public function delete(string $id): array
public function delete(string $id): string
{
return MsGraph::delete("me/contacts/$id");
}
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function downloadFile(string $id, string $type = 'me'): object
return redirect()->away($id['@microsoft.graph.downloadUrl']);
}

public function deleteFile(string $id, string $type = 'me'): array
public function deleteFile(string $id, string $type = 'me'): string
{
return MsGraph::delete($type."/drive/items/$id");
}

public function createFolder(string $name, string $path, string $type = 'me', string $behavior = 'rename'): array
public function createFolder(string $name, string $path = '', string $type = 'me', string $behavior = 'rename'): array
{
$path = $path === '' ? $type.'/drive/root/children' : $type.'/drive/root:'.$this->forceStartingSlash($path).':/children';

Expand Down Expand Up @@ -75,6 +75,7 @@ public function rename(string $name, string $id, string $type = 'me'): array
public function upload(string $name, string $uploadPath, string $path = '', string $type = 'me', string $behavior = 'rename'): void
{
$uploadSession = $this->createUploadSession($name, $path, $type, $behavior);
dd($uploadSession);
$uploadUrl = $uploadSession['uploadUrl'];

$fragSize = 320 * 1024;
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/Tasks/TaskLists.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@

class TaskLists extends MsGraph
{
public function get(array $params = []): MsGraph
public function get(array $params = []): array
{
$params = http_build_query($params);

return MsGraph::get('me/todo/lists?'.$params);
}

public function find(string $listId): MsGraph
public function find(string $listId): array
{
return MsGraph::get("me/todo/lists/$listId");
}

public function store(string $name): MsGraph
public function store(string $name): array
{
return MsGraph::post('me/todo/lists', [
'displayName' => $name,
]);
}

public function update(string $listId, string $name): MsGraph
public function update(string $listId, string $name): array
{
return MsGraph::patch("me/todo/lists/$listId", [
'displayName' => $name,
]);
}

public function delete(string $listId): MsGraph
public function delete(string $listId): string
{
return MsGraph::delete("me/todo/lists/$listId");
}
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/Tasks/Tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ public function get(string $taskListId, array $params = [], int $perPage = 25, s
];
}

public function find(string $taskListId, string $taskId): MsGraph
public function find(string $taskListId, string $taskId): array
{
return MsGraph::get("me/todo/lists/$taskListId/tasks/$taskId");
}

public function store(string $taskListId, array $data): MsGraph
public function store(string $taskListId, array $data): array
{
return MsGraph::post("me/todo/lists/$taskListId/tasks", $data);
}

public function update(string $taskListId, string $taskId, array $data): MsGraph
public function update(string $taskListId, string $taskId, array $data): array
{
return MsGraph::patch("me/todo/lists/$taskListId/tasks/$taskId", $data);
}

public function delete(string $taskListId, string $taskId): MsGraph
public function delete(string $taskListId, string $taskId): string
{
return MsGraph::delete("me/todo/lists/$taskListId/tasks/$taskId");
}
Expand Down
1 change: 0 additions & 1 deletion tests/MsGraphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Dcblogdev\MsGraph\MsGraph;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\GenericProvider;
use League\OAuth2\Client\Token\AccessToken;
use Mockery\MockInterface;
Expand Down

0 comments on commit 9c58e3c

Please sign in to comment.