Skip to content

Commit f531a89

Browse files
committed
update
1 parent 535e4bd commit f531a89

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/Translation/NStackLoader.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
namespace NStack\Translation;
44

5-
use Illuminate\Translation\FileLoader;
5+
use Carbon\Carbon;
66
use Illuminate\Filesystem\Filesystem;
7-
use NStack\NStack;
7+
use Illuminate\Support\Collection;
8+
use Illuminate\Translation\FileLoader;
89
use NStack\Clients\LocalizeClient;
910
use NStack\Models\Resource;
10-
use Illuminate\Support\Collection;
11-
use Carbon\Carbon;
11+
use NStack\NStack;
1212

1313
/**
1414
* NStackLoader for translations
1515
*
1616
* @author Pawel Wilk <[email protected]>
17-
*
1817
*/
1918
class NStackLoader extends FileLoader
2019
{
@@ -61,10 +60,11 @@ class NStackLoader extends FileLoader
6160
* Constructor
6261
*
6362
* @param Filesystem $files
64-
* @param string $path
65-
* @param NStack $nstack
63+
* @param string $path
64+
* @param NStack $nstack
6665
*/
67-
public function __construct(Filesystem $files, $path, NStack $nstack) {
66+
public function __construct(Filesystem $files, $path, NStack $nstack)
67+
{
6868
parent::__construct($files, $path);
6969

7070
$this->nstack = $nstack;
@@ -101,8 +101,7 @@ public function load($locale, $group, $namespace = null)
101101
* Download and cache translations
102102
*
103103
* @param Resource $resource
104-
* @param bool $refresh
105-
*
104+
* @param bool $refresh
106105
* @return array
107106
*/
108107
protected function loadTranslations(Resource $resource, $refresh = true)
@@ -155,7 +154,8 @@ protected function request(\Closure $closure)
155154
*/
156155
protected function findResource($locale)
157156
{
158-
foreach ($this->getResources() as $resource) { /* @var $resource \NStack\Models\Resource */
157+
foreach ($this->getResources() as $resource) {
158+
/* @var $resource \NStack\Models\Resource */
159159
if (locale_filter_matches($resource->getLanguage()->getLocale(), $locale)) {
160160
return $resource;
161161
}
@@ -179,9 +179,12 @@ protected function getClient()
179179
}
180180

181181
/**
182-
* Get available resources for platform
182+
* getResources
183183
*
184-
* @return Resource[]
184+
* @param bool $force
185+
* @return array|mixed
186+
* @throws \Exception
187+
* @author Casper Rasmussen <[email protected]>
185188
*/
186189
protected function getResources($force = false)
187190
{
@@ -207,8 +210,8 @@ protected function getResources($force = false)
207210
/**
208211
* shouldTryAgain.
209212
*
210-
* @author Casper Rasmussen <[email protected]>
211213
* @return bool
214+
* @author Casper Rasmussen <[email protected]>
212215
*/
213216
private function shouldTryAgain()
214217
{
@@ -228,8 +231,8 @@ private function shouldTryAgain()
228231
/**
229232
* performFail.
230233
*
231-
* @author Casper Rasmussen <[email protected]>
232234
* @return void
235+
* @author Casper Rasmussen <[email protected]>
233236
*/
234237
private function performFail()
235238
{

0 commit comments

Comments
 (0)