-
Notifications
You must be signed in to change notification settings - Fork 2
/
troxo_merge_candidate.php
59 lines (43 loc) · 1.51 KB
/
troxo_merge_candidate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @author Troxo Junior
* @copyright Troxo d.o.o.
*
* This file contains function for adding a new member to the Troxo team.
* Idea is for this function to evolve into a more complex module through iterative development process.
*
* This file is still under development
*
*/
/**
* If apropriate conditions are met, these function will add a new member to the $troxoTeam array and will return true.
* Othervise it will return false.
*
* @param array $troxoTeam, Candidate $you
* @return boolean
*/
merge(array $troxoTeam, Candidate $you) {
$backendSkills = array (‘php’,’.net’);
// @TODO skills could be a separate parent class while specific skills could be classes that inherit it
// checkSkill method could be implemented and inherited
$frontendSkills = array (‘html’, ‘css’); //array instancing backward compatible
$fullStackSkills = array (‘javascript’);
$personalSkills = array (‘english language’,’hungry for knowledge’);
If (in_array(‘php’, $you.skills) or in_array(‘.net’ $you.skills)) {
$conditionOne = true;
}
If (array_intersect($frontendSkills, $you.skills) == $frontendSkills)) {
$conditionTwo = true;
}
//code duplication! These could be a separate function
If (array_intersect($fullStackSkills, $you.skills) == $frontendSkills)) {
$conditionThree = true;
}
/* IT seems there is a more efficient way to go through these conditions */
If ($conditionOne && $coditionTwo && $conditionThree) {
$troxoTeam[] = $you;
return true;
} else {
return false;
}
?>