1 | <?php |
||
10 | class WebTranslateItFileService implements FileServiceInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var TranslationRepositoryInterface |
||
14 | */ |
||
15 | private $translationRepository; |
||
16 | |||
17 | /** |
||
18 | * WebTranslateItFileService constructor. |
||
19 | * |
||
20 | * @param TranslationRepositoryInterface $translationRepository |
||
21 | */ |
||
22 | public function __construct(TranslationRepositoryInterface $translationRepository) |
||
26 | |||
27 | /** |
||
28 | * Check if file content should be pulled. |
||
29 | * |
||
30 | * If local file does not exist |
||
31 | * OR local file last update datetime is before the remote file update datetime |
||
32 | * OR local file hash is different from the remote file hash |
||
33 | * |
||
34 | * @param string $realFilePath |
||
35 | * @param ProjectFileDTO $projectFile |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | public function shouldBeUpdated($realFilePath, ProjectFileDTO $projectFile) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function update($filePath, ProjectFileDTO $projectFile) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function prepare($directory) |
||
65 | } |
||
66 |