1 | <?php |
||
39 | class PidFileHandler implements PidFileHandlerInterface |
||
40 | { |
||
41 | |||
42 | use SystemLoggerTrait; |
||
43 | |||
44 | /** |
||
45 | * The filehandle for the PID file. |
||
46 | * |
||
47 | * @var resource |
||
48 | */ |
||
49 | private $fh; |
||
50 | |||
51 | /** |
||
52 | * The PID for the running processes. |
||
53 | * |
||
54 | * @var array |
||
55 | */ |
||
56 | private $pid; |
||
57 | |||
58 | /** |
||
59 | * The system configuration. |
||
60 | * |
||
61 | * @var \TechDivision\Import\Configuration\ConfigurationInterface |
||
62 | */ |
||
63 | private $configuration; |
||
64 | |||
65 | /** |
||
66 | * The generic file handler instance. |
||
67 | * |
||
68 | * @var \TechDivision\Import\Handlers\GenericFileHandlerInterface |
||
69 | */ |
||
70 | private $genericFileHandler; |
||
71 | |||
72 | /** |
||
73 | * Initializes the file handler instance. |
||
74 | * |
||
75 | * @param \TechDivision\Import\Configuration\ConfigurationInterface $configuration The actual configuration instance |
||
76 | * @param \TechDivision\Import\Handlers\GenericFileHandlerInterface $genericFileHandler The actual file handler instance |
||
77 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system logger instances |
||
78 | */ |
||
79 | public function __construct( |
||
90 | |||
91 | /** |
||
92 | * The array with the system loggers. |
||
93 | * |
||
94 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The system logger instances |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | public function setSystemLoggers(Collection $systemLoggers) |
||
102 | |||
103 | /** |
||
104 | * Return's the system configuration. |
||
105 | * |
||
106 | * @return \TechDivision\Import\Configuration\ConfigurationInterface The system configuration |
||
107 | */ |
||
108 | protected function getConfiguration() |
||
112 | |||
113 | /** |
||
114 | * Return's the generic file handler instance. |
||
115 | * |
||
116 | * @return \TechDivision\Import\Handlers\GenericFileHandlerInterface The generic file handler instance |
||
117 | */ |
||
118 | protected function getGenericFileHandler() |
||
122 | |||
123 | /** |
||
124 | * Return's the PID filename to use. |
||
125 | * |
||
126 | * @return string The PID filename |
||
127 | */ |
||
128 | protected function getPidFilename() |
||
132 | |||
133 | /** |
||
134 | * Return's the unique serial for this import process. |
||
135 | * |
||
136 | * @return string The unique serial |
||
137 | */ |
||
138 | protected function getSerial() |
||
142 | |||
143 | /** |
||
144 | * Remove's the passed line from the file with the passed name. |
||
145 | * |
||
146 | * @param string $line The line to be removed |
||
147 | * @param resource $fh The file handle of the file the line has to be removed |
||
148 | * |
||
149 | * @return void |
||
150 | * @throws \Exception Is thrown, if the file doesn't exists, the line is not found or can not be removed |
||
151 | */ |
||
152 | protected function removeLineFromFile($line, $fh) |
||
156 | |||
157 | /** |
||
158 | * Persist the UUID of the actual import process to the PID file. |
||
159 | * |
||
160 | * @return void |
||
161 | * @throws \Exception Is thrown, if the PID can not be locked or the PID can not be added |
||
162 | * @throws \TechDivision\Import\Exceptions\ImportAlreadyRunningException Is thrown, if a import process is already running |
||
163 | */ |
||
164 | public function lock() |
||
188 | |||
189 | /** |
||
190 | * Remove's the UUID of the actual import process from the PID file. |
||
191 | * |
||
192 | * @return void |
||
193 | * @throws \Exception Is thrown, if the PID can not be removed |
||
194 | */ |
||
195 | public function unlock() |
||
220 | } |
||
221 |
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..