1 | <?php |
||
16 | abstract class Publisher |
||
17 | { |
||
18 | /** |
||
19 | * The filesystem instance. |
||
20 | * |
||
21 | * @var \Illuminate\Filesystem\Filesystem |
||
22 | */ |
||
23 | protected $files; |
||
24 | |||
25 | /** |
||
26 | * The destination of the config files. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $publishPath; |
||
31 | |||
32 | /** |
||
33 | * The path to the application's packages. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $packagePath; |
||
38 | |||
39 | /** |
||
40 | * The destination paths for source files. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $destinationPaths; |
||
45 | |||
46 | /** |
||
47 | * Create a new publisher instance. |
||
48 | * |
||
49 | * @param \Illuminate\Filesystem\Filesystem $files |
||
50 | * @param string $publishPath |
||
51 | */ |
||
52 | public function __construct(Filesystem $files, $publishPath) |
||
53 | { |
||
54 | $this->files = $files; |
||
55 | $this->publishPath = $publishPath; |
||
56 | |||
57 | $this->destinationPaths = [ |
||
|
|||
58 | 'migrations' => database_path('/migrations/%s_%s'), |
||
59 | 'seeds' => database_path('/seeds/%s'), |
||
60 | 'config' => config_path('%s'), |
||
61 | 'views' => base_path('resources/views/vendor/%s'), |
||
62 | 'translations' => base_path('resources/lang/%s'), |
||
63 | 'assets' => public_path('vendor/%s'), |
||
64 | 'routes' => null, |
||
65 | ]; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * Publish files from a given path. |
||
70 | * |
||
71 | * @param string $package |
||
72 | * @param string $source |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function getFileList($package) |
||
77 | { |
||
78 | return $this->getSource($package, $this->packagePath); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Set the default package path. |
||
83 | * |
||
84 | * @param string $packagePath |
||
85 | */ |
||
86 | public function setPackagePath($packagePath) |
||
87 | { |
||
88 | $this->packagePath = $packagePath; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * Set the default package name. |
||
93 | * |
||
94 | * @param string $packageName |
||
95 | */ |
||
96 | public function setPackageName($packageName) |
||
97 | { |
||
98 | $this->packageName = $packageName; |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * Get the source directory to publish. |
||
103 | * |
||
104 | * @param string $packagePath |
||
105 | * |
||
106 | * @return string |
||
107 | * |
||
108 | * @throws \InvalidArgumentException |
||
109 | */ |
||
110 | abstract protected function getSource($packagePath); |
||
111 | |||
112 | /** |
||
113 | * @param $file |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | protected function getFileName($file) |
||
127 | |||
128 | /** |
||
129 | * Get the target destination path for the files. |
||
130 | * |
||
131 | * @param string $package |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function getDestinationPath($type, $args) |
||
139 | |||
140 | /** |
||
141 | * @param $type |
||
142 | * @param $files |
||
143 | * |
||
144 | * @return array |
||
145 | */ |
||
146 | protected function getSourceFiles($path) |
||
155 | |||
156 | /** |
||
157 | * @param $path |
||
158 | * |
||
159 | * @return mixed |
||
160 | */ |
||
161 | protected function getClassFromFile($path) |
||
171 | } |
||
172 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..