GitSHA::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
class GitSHA extends Varchar {
4
5
	/**
6
	 * @param string|null $name
7
	 * @param array $options
8
	 */
9
	public function __construct($name = null, $options = array()) {
10
		// Size should probably be 40, but to avoid schema change leave for now
11
		parent::__construct($name, 255, $options);
12
	}
13
14
	/**
15
	 * @return string
16
	 */
17
	public function FullHash() {
18
		return $this->value;
19
	}
20
21
	/**
22
	 * @return string
23
	 */
24
	public function ShortHash() {
25
		return substr($this->value, 0, 7);
26
	}
27
}
28