-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Rich2k/p8-support
Refactor return types and documentation
- Loading branch information
Showing
10 changed files
with
299 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/.idea | ||
/.vscode | ||
.env | ||
composer.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
<?php | ||
return [ | ||
'jwttoken' => env('WEATHERKIT_JWT_TOKEN', ''), | ||
'auth' => [ | ||
'config' => [ | ||
'jwt' => env('WEATHERKIT_JWT_TOKEN', ''), | ||
], | ||
|
||
'type' => 'jwt', | ||
], | ||
|
||
'languageCode' => env('WEATHERKIT_LANGUAGE_CODE', config('app.locale', 'en')), | ||
|
||
'timezone' => env('WEATHERKIT_TIMEZONE', config('app.timezone', 'UTC')), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
namespace Rich2k\LaravelWeatherKit\Exceptions; | ||
|
||
/** | ||
* Class DataSetNotFoundException | ||
* | ||
* @package Rich2k\LaravelWeatherKit\Exceptions | ||
*/ | ||
class DataSetNotFoundException extends LaravelWeatherKitException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
namespace Rich2k\LaravelWeatherKit\Exceptions; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Class LaravelWeatherKitException | ||
* | ||
* @package Rich2k\LaravelWeatherKit\Exceptions | ||
*/ | ||
class LaravelWeatherKitException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
namespace Rich2k\LaravelWeatherKit\Exceptions; | ||
|
||
/** | ||
* Class MissingCoordinatesException | ||
* | ||
* @package Rich2k\LaravelWeatherKit\Exceptions | ||
*/ | ||
class MissingCoordinatesException extends LaravelWeatherKitException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Rich2k\LaravelWeatherKit\Providers; | ||
|
||
use Illuminate\Support\Collection; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class CollectionsServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->recursive(); | ||
} | ||
|
||
/** | ||
* Recursively collect arrays within a collection | ||
* | ||
* @return void | ||
*/ | ||
private function recursive() | ||
{ | ||
Collection::macro('recursive', function () { | ||
return $this->map(function ($value) { | ||
if (is_array($value) || is_object($value)) { | ||
return collect($value)->recursive(); | ||
} | ||
return $value; | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.