| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 2 | public function addCommitLinks() |
|
| 40 | { |
||
| 41 | 2 | $history = $this->getHistory(); |
|
| 42 | 2 | foreach ($history->getHashes() as $hash) { |
|
| 43 | 2 | if (!$history->hasLink($hash)) { |
|
| 44 | 1 | $history->addLink($hash, $this->generateHashHref($hash)); |
|
| 45 | 1 | } |
|
| 46 | 2 | } |
|
| 47 | 2 | } |
|
| 48 | |||
| 49 | 1 | public function generateHashHref($hash) |
|
| 50 | { |
||
| 51 | 1 | return 'https://github.com/hiqdev/chkipper/commit/' . $hash; |
|
| 52 | } |
||
| 53 | } |
||
| 54 |
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: