1 | <?php namespace Mascame\Artificer; |
||
11 | trait AutoPublishable |
||
12 | { |
||
13 | /** |
||
14 | * @var App |
||
15 | */ |
||
16 | protected $app; |
||
17 | |||
18 | /** |
||
19 | * Should it run only in development mode? |
||
20 | * |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $onlyDevelopment = true; |
||
24 | |||
25 | /** |
||
26 | * Determines if we are missing one or more publishable directories |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $needsPublish = false; |
||
31 | |||
32 | /** |
||
33 | * @param null $fileToCheck |
||
34 | * @return mixed |
||
35 | */ |
||
36 | protected function isPublished($fileToCheck = null) { |
||
41 | |||
42 | /** |
||
43 | * Add files to publishable array & autopublish them in case directory does not exist |
||
44 | * |
||
45 | * @param array $paths |
||
46 | * @param null $group |
||
47 | */ |
||
48 | protected function publishes(array $paths, $group = null) { |
||
62 | |||
63 | protected function autoPublishes(\Closure $closure) { |
||
70 | |||
71 | /** |
||
72 | * Publish vendor files when app is ready |
||
73 | */ |
||
74 | protected function autoPublish() { |
||
87 | |||
88 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: