1 | <?php namespace Mascame\Artificer; |
||
10 | trait AutoPublishable |
||
11 | { |
||
12 | /** |
||
13 | * @var App |
||
14 | */ |
||
15 | protected $app; |
||
16 | |||
17 | /** |
||
18 | * Should it run only in development mode? |
||
19 | * |
||
20 | * @var bool |
||
21 | */ |
||
22 | protected $onlyDevelopment = true; |
||
23 | |||
24 | /** |
||
25 | * Determines if we are missing one or more publishable directories |
||
26 | * |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $needsPublish = false; |
||
30 | |||
31 | /** |
||
32 | * Is it going to autopublish? |
||
33 | * |
||
34 | * @var bool |
||
35 | */ |
||
36 | private $willPublish = false; |
||
37 | |||
38 | /** |
||
39 | * @param null $fileToCheck |
||
40 | * @return mixed |
||
41 | */ |
||
42 | protected function isPublished($fileToCheck = null) { |
||
51 | |||
52 | /** |
||
53 | * Add files to publishable array & autopublish them in case directory does not exist |
||
54 | * |
||
55 | * @param array $paths |
||
56 | * @param null $group |
||
57 | */ |
||
58 | protected function publishes(array $paths, $group = null) { |
||
71 | |||
72 | /** |
||
73 | * Publish vendor files when app is ready |
||
74 | */ |
||
75 | protected function autoPublish() { |
||
92 | |||
93 | } |
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: