Skip to content

Commit

Permalink
updated composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
dcblogdev committed Nov 26, 2023
1 parent 556fea1 commit 0f407d0
Show file tree
Hide file tree
Showing 31 changed files with 599 additions and 573 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Where $behavior is either rename or replace
## Fixed

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

## Changed

- Dropped support for Laravel versions below 10
- Dropped support for using cs-fixer
- Fixed an issue in MsGraph connect having an infinite loop when an error is returned from Microsoft
- Dropped support for using csfixer
23 changes: 12 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,22 @@
"Microsoft365"
],
"require": {
"illuminate/support": "5.5.x|5.6.x|5.7.x|5.8.x|6.x|7.x|8.x|9.x|^10.0",
"league/oauth2-client": "^1.4|^2",
"guzzlehttp/guzzle": "6.x|7.x",
"illuminate/support": "^10.0",
"league/oauth2-client": "^2",
"guzzlehttp/guzzle": "7.x",
"ext-json": "*",
"ext-fileinfo": "*",
"ext-curl": "*",
"shitware-ltd/flysystem-msgraph": "^1.0",
"microsoft/microsoft-graph": "^1.70"
},
"require-dev": {
"orchestra/testbench": "^7.0|^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"friendsofphp/php-cs-fixer": "^3.9",
"pestphp/pest-plugin-mock": "^1.0",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^v2.24.2",
"pestphp/pest-plugin-laravel": "^v2.2.0",
"laravel/pint": "^1.13",
"pestphp/pest-plugin-parallel": "^1.2"
"pestphp/pest-plugin-type-coverage": "^2.4",
"mockery/mockery": "^1.6"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -65,7 +64,9 @@
}
},
"scripts": {
"test": "vendor/bin/pest --parallel",
"pest": "vendor/bin/pest --parallel",
"pest-cov": "vendor/bin/pest --coverage",
"pest-type": "vendor/bin/pest --type-coverage",
"pint": "vendor/bin/pint"
}
}
}
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The MIT License (MIT)

Copyright (c) 2020 dcblogdev
Copyright (c) 2023 dcblogdev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 6 additions & 15 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<coverage>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
</source>
<testsuites>
<testsuite name="Test">
<directory suffix="Test.php">./tests</directory>
Expand Down
33 changes: 21 additions & 12 deletions src/AdminResources/CalendarEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,39 @@

class CalendarEvents extends MsGraphAdmin
{
private $userId;
private string $userId = '';

private $top;
private string $top = '';

private $skip;
private string $skip = '';

public function userid($userId)
public function userid(string $userId): static
{
$this->userId = $userId;

return $this;
}

public function top($top)
public function top(string $top): static
{
$this->top = $top;

return $this;
}

public function skip($skip)
public function skip(string $skip): static
{
$this->skip = $skip;

return $this;
}

public function get($calendarId, $params = [])
/**
* @throws Exception
*/
public function get(string $calendarId, array $params = []): array
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down Expand Up @@ -65,18 +68,24 @@ public function get($calendarId, $params = [])
];
}

public function find($calendarId, $eventId)
/**
* @throws Exception
*/
public function find(string $calendarId, string $eventId): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

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

public function store($calendarId, $data)
/**
* @throws Exception
*/
public function store(string $calendarId, array$data): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down
40 changes: 26 additions & 14 deletions src/AdminResources/Calendars.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,39 @@

class Calendars extends MsGraphAdmin
{
private $userId;
private string $userId = '';

private $top;
private string $top = '';

private $skip;
private string $skip = '';

public function userid($userId)
public function userid(string $userId): static
{
$this->userId = $userId;

return $this;
}

public function top($top)
public function top(string $top): static
{
$this->top = $top;

return $this;
}

public function skip($skip)
public function skip(string $skip): static
{
$this->skip = $skip;

return $this;
}

public function get($params = [])
/**
* @throws Exception
*/
public function get(array $params = []): array
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down Expand Up @@ -66,12 +69,15 @@ public function get($params = [])
];
}

public function find($id)
public function find(string $id): MsGraphAdmin
{
return MsGraphAdmin::get("users/$this->userId/calendar/$id");
}

public function store(array $data)
/**
* @throws Exception
*/
public function store(array $data): MsGraphAdmin
{
if ($this->userId == null) {
throw new Exception('userId is required.');
Expand All @@ -80,18 +86,24 @@ public function store(array $data)
return MsGraphAdmin::post("users/$this->userId/calendars", $data);
}

public function update($id, $data)
/**
* @throws Exception
*/
public function update(string $id, array $data): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

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

public function delete($id)
/**
* @throws Exception
*/
public function delete(string $id): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down
45 changes: 30 additions & 15 deletions src/AdminResources/Contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,39 @@

class Contacts extends MsGraphAdmin
{
private $userId;
private string $userId = '';

private $top;
private string $top = '';

private $skip;
private string $skip = '';

public function userid($userId)
public function userid(string $userId): static
{
$this->userId = $userId;

return $this;
}

public function top($top)
public function top(string $top): static
{
$this->top = $top;

return $this;
}

public function skip($skip)
public function skip(string $skip): static
{
$this->skip = $skip;

return $this;
}

public function get($params = [])
/**
* @throws Exception
*/
public function get(array $params = []): array
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down Expand Up @@ -66,7 +69,10 @@ public function get($params = [])
];
}

public function find($id)
/**
* @throws Exception
*/
public function find(string $id): MsGraphAdmin
{
if ($this->userId == null) {
throw new Exception('userId is required.');
Expand All @@ -75,27 +81,36 @@ public function find($id)
return MsGraphAdmin::get('users/'.$this->userId.'/contacts/'.$id);
}

public function store(array $data)
/**
* @throws Exception
*/
public function store(array $data): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

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

public function update($id, array $data)
/**
* @throws Exception
*/
public function update(string $id, array $data): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

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

public function delete($id)
/**
* @throws Exception
*/
public function delete(string $id): MsGraphAdmin
{
if ($this->userId == null) {
if ($this->userId === '') {
throw new Exception('userId is required.');
}

Expand Down
Loading

0 comments on commit 0f407d0

Please sign in to comment.