-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathGenericFileHandlerInterface.php
52 lines (47 loc) · 1.86 KB
/
GenericFileHandlerInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* TechDivision\Import\Handlers\GenericFileHandlerInterface
*
* PHP version 7
*
* @author Tim Wagner <t.wagner@techdivision.com>
* @copyright 2020 TechDivision GmbH <info@techdivision.com>
* @license https://opensource.org/licenses/MIT
* @link https://github.com/techdivision/import
* @link http://www.techdivision.com
*/
namespace TechDivision\Import\Handlers;
/**
* A generic interface for file handler implementations implementations.
*
* @author Tim Wagner <t.wagner@techdivision.com>
* @copyright 2020 TechDivision GmbH <info@techdivision.com>
* @license https://opensource.org/licenses/MIT
* @link https://github.com/techdivision/import
* @link http://www.techdivision.com
*/
interface GenericFileHandlerInterface extends HandlerInterface
{
/**
* Remove's the passed line from the file with the passed name.
*
* @param string $line The line to be removed
* @param string $filename The name of the file the line has to be removed from
*
* @return void
* @throws \TechDivision\Import\Exceptions\LineNotFoundException Is thrown, if the requested line can not be found in the file
* @throws \Exception Is thrown, if the file can not be written, after the line has been removed
* @see \TechDivision\Import\Handlers\GenericFileHandlerInterface::removeLineFromFile()
*/
public function removeLineFromFilename(string $line, string $filename) : void;
/**
* Remove's the passed line from the file with the passed name.
*
* @param string $line The line to be removed
* @param resource $fh The file handle of the file the line has to be removed
*
* @return void
* @throws \Exception Is thrown, if the file doesn't exists, the line is not found or can not be removed
*/
public function removeLineFromFile(string $line, $fh) : void;
}