Code Duplication    Length = 13-13 lines in 2 locations

app/Handler.php 2 locations

@@ 48-60 (lines=13) @@
45
	}
46
47
48
	public function handlePush(array $event)
49
	{
50
		$projectName = $event['project']['path_with_namespace'];
51
		$ref = $event['ref'];
52
		if (isset($this->scripts[$projectName]['push'][$ref])) {
53
			$this->executeCommand($this->scripts[$projectName]['push'][$ref], [
54
				'HOOK_PROJECT_PATH' => $projectName,
55
				'HOOK_REF' => $ref,
56
				'HOOK_BRANCH'=> $this->extractBranchName($ref),
57
				'HOOK_BUILD_REF' => $event['after']
58
			]);
59
		}
60
	}
61
62
63
	public function handleTag(array $event)
@@ 63-75 (lines=13) @@
60
	}
61
62
63
	public function handleTag(array $event)
64
	{
65
		$projectName = $event['project']['path_with_namespace'];
66
		$ref = $event['ref'];
67
		if (isset($this->scripts[$projectName]['tag'])) {
68
			$this->executeCommand($this->scripts[$projectName]['tag'], [
69
				'HOOK_PROJECT_PATH' => $projectName,
70
				'HOOK_REF' => $ref,
71
				'HOOK_TAG'=> $this->extractTagName($ref),
72
				'HOOK_BUILD_REF' => $event['after']
73
			]);
74
		}
75
	}
76
77
78
	private function extractBranchName($ref)