Skip to content

Commit

Permalink
Merge pull request #13 from Chris53897/feature/improve-phpdoc
Browse files Browse the repository at this point in the history
chore: improve phpdoc
  • Loading branch information
Jusdon authored Jun 6, 2024
2 parents 44466c4 + 6d6e898 commit 92ce5b5
Showing 1 changed file with 5 additions and 42 deletions.
47 changes: 5 additions & 42 deletions src/OneDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ protected function getDriveItemUrl(string $path): string
}

/**
* @param string $path
* @return bool
* @throws Exception|GuzzleException
*/
public function fileExists(string $path): bool
Expand Down Expand Up @@ -118,10 +116,6 @@ protected function ensureValidPath(string $path)
}

/**
* @param string $path
* @param string $contents
* @param Config|null $config
* @return void
* @throws Exception|GuzzleException
*/
public function write(string $path, string $contents, Config $config = null): void
Expand Down Expand Up @@ -167,10 +161,7 @@ public function createUploadSession($path): UploadSession
}

/**
* @param string $path
* @param $contents
* @param Config|null $config
* @return void
* @throws Exception|GuzzleException
*/
public function writeStream(string $path, $contents, Config $config = null): void
Expand Down Expand Up @@ -255,8 +246,6 @@ private function writeChunk(Http $http, string $upload_url, int $file_size, stri
}

/**
* @param string $path
* @return string
* @throws Exception|GuzzleException
*/
public function read(string $path): string
Expand All @@ -276,7 +265,6 @@ public function read(string $path): string
}

/**
* @param string $path
* @return array
* @throws GuzzleException
* @throws Exception
Expand Down Expand Up @@ -305,8 +293,6 @@ public function readStream(string $path): array
}

/**
* @param string $path
* @return void
* @throws GuzzleException
* @throws Exception
*/
Expand All @@ -328,8 +314,6 @@ public function delete(string $path): void
}

/**
* @param string $path
* @return void
* @throws GuzzleException
* @throws Exception
*/
Expand All @@ -343,13 +327,10 @@ public function deleteDirectory(string $path): void
}

/**
* @param string $path
* @param Config|null $config
* @return void
* @throws GuzzleException
* @throws Exception
*/
public function createDirectory(string $path, Config $config = null): void
public function createDirectory(string $path, ?Config $config = null): void
{
try {
$newDirPathArray = explode('/', $path);
Expand All @@ -375,9 +356,6 @@ public function createDirectory(string $path, Config $config = null): void
}

/**
* @param string $path
* @param string $visibility
* @return void
* @throws Exception
*/
public function setVisibility(string $path, string $visibility): void
Expand All @@ -386,8 +364,6 @@ public function setVisibility(string $path, string $visibility): void
}

/**
* @param string $path
* @return FileAttributes
* @throws Exception
*/
public function visibility(string $path): FileAttributes
Expand All @@ -396,8 +372,6 @@ public function visibility(string $path): FileAttributes
}

/**
* @param string $path
* @return FileAttributes
* @throws Exception|GuzzleException
*/
public function mimeType(string $path): FileAttributes
Expand All @@ -420,8 +394,6 @@ public function mimeType(string $path): FileAttributes
}

/**
* @param string $path
* @return FileAttributes
* @throws Exception|GuzzleException
*/
public function lastModified(string $path): FileAttributes
Expand All @@ -442,8 +414,6 @@ public function lastModified(string $path): FileAttributes
}

/**
* @param string $path
* @return FileAttributes
* @throws Exception|GuzzleException
*/
public function fileSize(string $path): FileAttributes
Expand All @@ -463,12 +433,9 @@ public function fileSize(string $path): FileAttributes


/**
* @param string $path
* @param bool $deep
* @return iterable
* @throws Exception|GuzzleException
*/

public function listContents(string $path, bool $deep = true): iterable
{
try {
Expand Down Expand Up @@ -500,6 +467,10 @@ public function listContents(string $path, bool $deep = true): iterable
}
}

/**
* @param DriveItem[] $drive_items
* @return array<int, FileAttributes|DirectoryAttributes>
*/
private function convertDriveItemsToStorageAttributes(array $drive_items): array
{
return array_map(function (DriveItem $item) {
Expand Down Expand Up @@ -539,10 +510,6 @@ private function getChildren($directory): array
}

/**
* @param string $source
* @param string $destination
* @param Config|null $config
* @return void
* @throws Exception
*/
public function move(string $source, string $destination, Config $config = null): void
Expand Down Expand Up @@ -578,10 +545,6 @@ public function move(string $source, string $destination, Config $config = null)
}

/**
* @param string $source
* @param string $destination
* @param Config|null $config
* @return void
* @throws Exception
*/
public function copy(string $source, string $destination, Config $config = null): void
Expand Down

0 comments on commit 92ce5b5

Please sign in to comment.