1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of Laravel Service Provider. |
5
|
|
|
* |
6
|
|
|
* (c) DraperStudio <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace DraperStudio\ServiceProvider\Publisher; |
13
|
|
|
|
14
|
|
|
use Illuminate\Filesystem\Filesystem; |
15
|
|
|
|
16
|
|
|
abstract class Publisher |
17
|
|
|
{ |
18
|
|
|
use \DraperStudio\ServiceProvider\FilesTrait; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* The filesystem instance. |
22
|
|
|
* |
23
|
|
|
* @var \Illuminate\Filesystem\Filesystem |
24
|
|
|
*/ |
25
|
|
|
protected $files; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* The destination of the config files. |
29
|
|
|
* |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $publishPath; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* The path to the application's packages. |
36
|
|
|
* |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
protected $packagePath; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Create a new publisher instance. |
43
|
|
|
* |
44
|
|
|
* @param \Illuminate\Filesystem\Filesystem $files |
45
|
|
|
* @param string $publishPath |
46
|
|
|
*/ |
47
|
|
|
public function __construct(Filesystem $files, $publishPath) |
48
|
|
|
{ |
49
|
|
|
$this->files = $files; |
50
|
|
|
$this->publishPath = $publishPath; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Publish files from a given path. |
55
|
|
|
* |
56
|
|
|
* @param string $package |
57
|
|
|
* @param string $source |
|
|
|
|
58
|
|
|
* |
59
|
|
|
* @return bool |
60
|
|
|
*/ |
61
|
|
|
public function getFileList($package) |
62
|
|
|
{ |
63
|
|
|
return $this->getSource($package, $this->packagePath); |
|
|
|
|
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Set the default package path. |
68
|
|
|
* |
69
|
|
|
* @param string $packagePath |
70
|
|
|
*/ |
71
|
|
|
public function setPackagePath($packagePath) |
72
|
|
|
{ |
73
|
|
|
$this->packagePath = $packagePath; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Set the default package name. |
78
|
|
|
* |
79
|
|
|
* @param string $packageName |
80
|
|
|
*/ |
81
|
|
|
public function setPackageName($packageName) |
82
|
|
|
{ |
83
|
|
|
$this->packageName = $packageName; |
|
|
|
|
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Get the source directory to publish. |
88
|
|
|
* |
89
|
|
|
* @param string $packagePath |
90
|
|
|
* |
91
|
|
|
* @return string |
92
|
|
|
* |
93
|
|
|
* @throws \InvalidArgumentException |
94
|
|
|
*/ |
95
|
|
|
abstract protected function getSource($packagePath); |
96
|
|
|
} |
97
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.