Skip to content

Commit

Permalink
refactor: code style and smell
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Mar 7, 2021
1 parent 0249907 commit 39e1221
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
}
],
"require": {
"php": "^7.3||^8.0",
"php": "^7.4||^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "~6||~7",
"illuminate/support": "~6||~7||~8",
"laravel/framework": "~6||~7||~8",
"illuminate/http": "~6||~7||~8",
"symfony/http-foundation": "^4.4.7 || ^5.1",
"symfony/psr-http-message-bridge": "^1.0 || ^2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private function requestNewToken()
*/
private function cache($accessToken, $expiry)
{
$minutes = ($expiry / 60);
$minutes = (int) ($expiry / 60);
Cache::store('file')->put($this->cacheKey, $accessToken, now()->addMinutes($minutes));

return Cache::store('file')->get($this->cacheKey);
Expand Down
5 changes: 3 additions & 2 deletions src/Controllers/HumanResourcesEmployeeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use spkm\isams\Endpoint;
use spkm\isams\Wrappers\Employee;
use spkm\isams\Wrappers\EmployeePhoto;
use Exception;

class HumanResourcesEmployeeController extends Endpoint
{
Expand Down Expand Up @@ -129,10 +130,10 @@ public function show(int $id): Employee
public function getCurrentPhoto(int $id, int $quality = 75): EmployeePhoto
{
/**
* At the moment this package doesn't auto-include Intervention, so we need to check for its existance first.
* At the moment this package doesn't auto-include Intervention, so we need to check for its existence first.
*/
if (! method_exists(ImageManagerStatic::class, 'make')) {
throw new \Exception('This method requires Intervention/Image package.', 500);
throw new Exception('This method requires Intervention/Image package.', 500);
}

try {
Expand Down
4 changes: 2 additions & 2 deletions src/Controllers/StorageFileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function setEndpoint()
*
* @param string $path
* @param string $name
* @return binary|string
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show(string $path, string $name)
Expand All @@ -42,7 +42,7 @@ public function show(string $path, string $name)
* @author Fred Bradley <[email protected]>
* @param string $path
* @param string $name
* @return binary|string
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function download(string $path, string $name)
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract protected function setEndpoint();
/**
* Get the School to be queried.
*
* @return \spkm\Isams\Contracts\Institution
* @return \spkm\isams\Contracts\Institution
*/
protected function getInstitution()
{
Expand Down
1 change: 1 addition & 0 deletions src/Wrappers/TeachingSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
class TeachingSubject extends Wrapper
{
protected bool $isHidden;
/**
* Handle the data.
*
Expand Down

0 comments on commit 39e1221

Please sign in to comment.