1 | <?php |
||
37 | class PidFileHandler implements PidFileHandlerInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The filehandle for the PID file. |
||
42 | * |
||
43 | * @var resource |
||
44 | */ |
||
45 | private $fh; |
||
46 | |||
47 | /** |
||
48 | * The PID for the running processes. |
||
49 | * |
||
50 | * @var array |
||
51 | */ |
||
52 | private $pid; |
||
53 | |||
54 | /** |
||
55 | * The system configuration. |
||
56 | * |
||
57 | * @var \TechDivision\Import\Configuration\ConfigurationInterface |
||
58 | */ |
||
59 | private $configuration; |
||
60 | |||
61 | /** |
||
62 | * The generic file handler instance. |
||
63 | * |
||
64 | * @var \TechDivision\Import\Handlers\GenericFileHandlerInterface |
||
65 | */ |
||
66 | private $genericFileHandler; |
||
67 | |||
68 | /** |
||
69 | * Initializes the file handler instance. |
||
70 | * |
||
71 | * @param \TechDivision\Import\Configuration\ConfigurationInterface $configuration The actual configuration instance |
||
72 | * @param \TechDivision\Import\Handlers\GenericFileHandlerInterface $genericFileHandler The actual file handler instance |
||
73 | */ |
||
74 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * Return's the system configuration. |
||
84 | * |
||
85 | * @return \TechDivision\Import\Configuration\ConfigurationInterface The system configuration |
||
86 | */ |
||
87 | protected function getConfiguration() |
||
91 | |||
92 | /** |
||
93 | * Return's the generic file handler instance. |
||
94 | * |
||
95 | * @return \TechDivision\Import\Handlers\GenericFileHandlerInterface The generic file handler instance |
||
96 | */ |
||
97 | protected function getGenericFileHandler() |
||
101 | |||
102 | /** |
||
103 | * Return's the PID filename to use. |
||
104 | * |
||
105 | * @return string The PID filename |
||
106 | */ |
||
107 | protected function getPidFilename() |
||
111 | |||
112 | /** |
||
113 | * Return's the unique serial for this import process. |
||
114 | * |
||
115 | * @return string The unique serial |
||
116 | */ |
||
117 | protected function getSerial() |
||
121 | |||
122 | /** |
||
123 | * Remove's the passed line from the file with the passed name. |
||
124 | * |
||
125 | * @param string $line The line to be removed |
||
126 | * @param resource $fh The file handle of the file the line has to be removed |
||
127 | * |
||
128 | * @return void |
||
129 | * @throws \Exception Is thrown, if the file doesn't exists, the line is not found or can not be removed |
||
130 | */ |
||
131 | protected function removeLineFromFile($line, $fh) |
||
135 | |||
136 | /** |
||
137 | * Persist the UUID of the actual import process to the PID file. |
||
138 | * |
||
139 | * @return void |
||
140 | * @throws \Exception Is thrown, if the PID can not be locked or the PID can not be added |
||
141 | * @throws \TechDivision\Import\Exceptions\ImportAlreadyRunningException Is thrown, if a import process is already running |
||
142 | */ |
||
143 | public function lock() |
||
167 | |||
168 | /** |
||
169 | * Remove's the UUID of the actual import process from the PID file. |
||
170 | * |
||
171 | * @return void |
||
172 | * @throws \Exception Is thrown, if the PID can not be removed |
||
173 | */ |
||
174 | public function unlock() |
||
199 | } |
||
200 |
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..