| 1 | <?php |
||
| 13 | class GitIgnoreListener |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var GitIgnore |
||
| 18 | */ |
||
| 19 | protected $gitIgnore; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param GitIgnore $gitIgnore |
||
| 23 | */ |
||
| 24 | 3 | public function __construct(GitIgnore $gitIgnore) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Add any files which were installed to the .gitignore |
||
| 31 | * |
||
| 32 | * @param PackageDeployEvent $packageDeployEvent |
||
| 33 | */ |
||
| 34 | 1 | public function addNewInstalledFiles(PackageDeployEvent $packageDeployEvent) |
|
| 35 | { |
||
| 36 | 1 | $this->gitIgnore->addMultipleEntries( |
|
| 37 | 1 | $packageDeployEvent->getDeployEntry()->getDeployStrategy()->getDeployedFiles() |
|
| 38 | ); |
||
| 39 | 1 | $this->gitIgnore->write(); |
|
| 40 | 1 | } |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Remove any files which were removed to the .gitignore |
||
| 44 | * |
||
| 45 | * @param PackageUnInstallEvent $e |
||
| 46 | */ |
||
| 47 | 1 | public function removeUnInstalledFiles(PackageUnInstallEvent $e) |
|
| 52 | } |
||
| 53 |