Skip to content

Commit 78871dd

Browse files
Add example configuration to class PHPDoc
1 parent 54422a7 commit 78871dd

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

src/Hook/Branch/Action/BlockFixupAndSquashCommits.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
* This action blocks pushes that contain fixup! or squash! commits.
2828
* Just as a security layer, so you are not pushing stuff you wanted to autosquash.
2929
*
30-
* Configure like this:
31-
*
30+
* Example configuration:
31+
* <code>
3232
* {
33-
* "action": "\\CaptainHook\\App\\Hook\\Branch\\Action\\BlockFixupAndSquashCommits",
34-
* "options": {
35-
* "blockSquashCommits": true,
36-
* "blockFixupCommits": true,
37-
* "protectedBranches": ["main", "master", "integration"]
38-
* },
39-
* "conditions": []
40-
* }
33+
* "action": "CaptainHook.Branch.PreventPushOfFixupAndSquashCommits",
34+
* "options": {
35+
* "blockSquashCommits": true,
36+
* "blockFixupCommits": true,
37+
* "protectedBranches": ["main", "master", "integration"]
38+
* }
39+
* }
40+
* </code>
4141
*
4242
* @package CaptainHook
4343
* @author Sebastian Feldmann <sf@sebastian-feldmann.info>

src/Hook/Branch/Action/EnsureNaming.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
/**
2323
* Class EnsureNaming
2424
*
25+
* This Action makes sure you are on a branch that follows your naming conventions.
26+
*
27+
* Example configuration:
28+
* <code>
29+
* {
30+
* "action": "CaptainHook.Branch.EnsureNaming",
31+
* "options": {
32+
* "regex": "#feature/issue[0-9]+-.*#i",
33+
* "error": "Arr matey! Ye be on the wrong branch!",
34+
* "success": "All clear, Captain! Full speed ahead!",
35+
* }
36+
* }
37+
* </code>
38+
*
2539
* @package CaptainHook
2640
* @author Felix Edelmann <fxedel@gmail.com>
2741
* @link https://github.com/captainhook-git/captainhook

src/Hook/Debug/Failure.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@
1818
use SebastianFeldmann\Git\Repository;
1919

2020
/**
21-
* Debug hook to test hook triggering that fails the hook execution
21+
* Debug Failure
22+
*
23+
* Debug hook to test hook triggering, arguments, stdIn ect.
24+
* Fails the hook execution and stops current the git operation.
25+
*
26+
* Example configuration:
27+
* <code>
28+
* {
29+
* "action": "CaptainHook.Debug.Fail"
30+
* }
31+
* </code>
2232
*
2333
* @package CaptainHook
2434
* @author Sebastian Feldmann <sf@sebastian-feldmann.info>

src/Hook/Debug/Success.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@
1717
use SebastianFeldmann\Git\Repository;
1818

1919
/**
20-
* Debug hook to test hook triggering that allows the hook to pass
20+
* Debug Success
21+
*
22+
* Debug hook action to test hook triggering, arguments, stdIn etc.
23+
* Does not crash the hook execution. The git operation will succeed.
24+
*
25+
* Example configuration:
26+
* <code>
27+
* {
28+
* "action": "CaptainHook.Debug.Ok"
29+
* }
30+
* </code>
2131
*
2232
* @package CaptainHook
2333
* @author Sebastian Feldmann <sf@sebastian-feldmann.info>

0 commit comments

Comments
 (0)