Skip to content

Commit

Permalink
fix/deployhook-function-should-not-be-static
Browse files Browse the repository at this point in the history
  • Loading branch information
moreamazingnick committed Aug 24, 2023
1 parent 5ca2d36 commit b6e48d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library/Director/Core/CoreApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public function dumpConfig(IcingaConfig $config, Db $db, $packageName = null)
$hooks = Hook::all('director/Deployment');
foreach ($hooks as $hook) {
$hook->beforeDeploy($deployment);
$hook::beforeDump($files);
$files = $hook->beforeDump($files);
}

$this->assertPackageExists($packageName);
Expand Down
12 changes: 7 additions & 5 deletions library/Director/Hook/DeploymentHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ public function beforeDeploy(DirectorDeploymentLog $deployment)
{
}


/**
* Please override this method if you want to change the deployed files
* in any way
*
* @param array $files
* Please override this method if you want to change the deployed files before writing them to disk
*
* @param $files
* @return array with $files
*/
public static function beforeDump($files){

public function beforeDump($files){
return $files;
}

/**
Expand Down

0 comments on commit b6e48d5

Please sign in to comment.