1 | <?php |
||
13 | class Git_Shell_Command { |
||
14 | /** |
||
15 | * Constructor! |
||
16 | * |
||
17 | * @param String $name repository name. |
||
18 | */ |
||
19 | public function __construct( $name ) { |
||
24 | |||
25 | /** |
||
26 | * Returns the latest repo tag |
||
27 | */ |
||
28 | public function get_latest_tag() { |
||
34 | |||
35 | /** |
||
36 | * Returns a `shortstat` diff between two tags |
||
37 | * |
||
38 | * @param String $source git tag or branch. |
||
39 | * @param String $target git tag or branch. |
||
40 | */ |
||
41 | public function get_diff_between( $source, $target ) { |
||
47 | |||
48 | /** |
||
49 | * Clones a repository |
||
50 | * |
||
51 | * @param String $type URL type to use. |
||
52 | */ |
||
53 | public function clone_repository( $type = 'ssh' ) { |
||
67 | |||
68 | /** |
||
69 | * Checkout to a new branch |
||
70 | * |
||
71 | * @param String $branch branch name. |
||
72 | */ |
||
73 | public function checkout_new_branch( $branch ) { |
||
79 | } |
||
80 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: