Skip to content

Commit f2aab5e

Browse files
committed
Begin static analysis
1 parent efbe4e8 commit f2aab5e

File tree

5 files changed

+31
-14
lines changed

5 files changed

+31
-14
lines changed

src/Config/Services.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
use CodeIgniter\Config\BaseService;
44
use CodeIgniter\View\RendererInterface;
5+
use Tatter\Assets\Libraries\Assets;
6+
use Tatter\Assets\Libraries\Manifests;
7+
use Tatter\Assets\Config\Assets as AssetsConfig;
58

69
class Services extends BaseService
710
{
8-
public static function assets(BaseConfig $config = null, bool $getShared = true)
11+
public static function assets(AssetsConfig $config = null, bool $getShared = true)
912
{
1013
if ($getShared)
1114
{
@@ -18,10 +21,10 @@ public static function assets(BaseConfig $config = null, bool $getShared = true)
1821
{
1922
$config = config('Assets');
2023
}
21-
return new \Tatter\Assets\Libraries\Assets($config);
24+
return new Assets($config);
2225
}
2326

24-
public static function manifests(BaseConfig $config = null, bool $getShared = true)
27+
public static function manifests(AssetsConfig $config = null, bool $getShared = true)
2528
{
2629
if ($getShared)
2730
{
@@ -34,6 +37,6 @@ public static function manifests(BaseConfig $config = null, bool $getShared = tr
3437
{
3538
$config = config('Assets');
3639
}
37-
return new \Tatter\Assets\Libraries\Manifests($config);
40+
return new Manifests($config);
3841
}
3942
}

src/Handlers/ConfigHandler.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
<?php namespace Tatter\Assets\Handlers;
22

3-
use CodeIgniter\Config\BaseConfig;
43
use Config\Services;
4+
use Tatter\Assets\Config\Assets as AssetsConfig;
55
use Tatter\Assets\Exceptions\AssetsException;
66
use Tatter\Assets\Handlers\DirectoryHandler;
77
use Tatter\Assets\Interfaces\AssetHandlerInterface;
88

99
class ConfigHandler implements AssetHandlerInterface
10-
{
10+
{
11+
/**
12+
* Our configuration instance.
13+
*
14+
* @var AssetsConfig
15+
*/
16+
protected $config;
17+
1118
/**
1219
* Instance of the directory handler for config routes
1320
* that point to directories instead of files.
1421
*
15-
* @var \Tatter\Assets\Handlers\DirectoryHandler
22+
* @var DirectoryHandler|null
1623
*/
1724
protected $directoryHandler;
1825

1926
// Save the config
20-
public function __construct(BaseConfig $config = null)
27+
public function __construct(AssetsConfig $config = null)
2128
{
2229
// Save the configuration
2330
$this->config = $config ?? config('Assets');

src/Handlers/DirectoryHandler.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
<?php namespace Tatter\Assets\Handlers;
22

3-
use CodeIgniter\Config\BaseConfig;
43
use Config\Services;
4+
use Tatter\Assets\Config\Assets as AssetsConfig;
55
use Tatter\Assets\Interfaces\AssetHandlerInterface;
66

77
class DirectoryHandler implements AssetHandlerInterface
88
{
9+
/**
10+
* Our configuration instance.
11+
*
12+
* @var AssetsConfig
13+
*/
14+
protected $config;
15+
916
// Save the config and intiate the helper
10-
public function __construct(BaseConfig $config = null)
17+
public function __construct(AssetsConfig $config = null)
1118
{
1219
// Save the configuration
1320
$this->config = $config ?? config('Assets');
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php namespace Tatter\Assets\Interfaces;
22

3-
use CodeIgniter\Config\BaseConfig;
3+
use Tatter\Assets\Config\Assets as AssetsConfig;
44

55
interface AssetHandlerInterface
66
{
7-
public function __construct(BaseConfig $config = null);
7+
public function __construct(AssetsConfig $config = null);
88

99
public function gather(string $route): array;
1010
}

src/Libraries/Manifests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,13 @@ protected function publishFile(string $source, string $destination): bool
408408

409409
if ($this->config->silent)
410410
{
411-
$error = lang('Files.cannotMove', [$source, $destination, -1]);
411+
$error = lang('Files.cannotMove', [$source, $destination, 'unknown error']);
412412
log_message('warning', $error);
413413
$this->messages[] = [$error, 'red'];
414414

415415
return false;
416416
}
417417

418-
throw FileException::forUnableToMove($source, $destination, -1);
418+
throw FileException::forUnableToMove($source, $destination, 'unknown error');
419419
}
420420
}

0 commit comments

Comments
 (0)