| Conditions | 6 |
| Paths | 24 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 15 | public static function getCrestHash($killID) |
||
| 16 | { |
||
| 17 | $killmail = json_decode(Killmail::get($killID), true); |
||
|
|
|||
| 18 | |||
| 19 | $victim = $killmail["victim"]; |
||
| 20 | $victimID = $victim["characterID"] == 0 ? "None" : $victim["characterID"]; |
||
| 21 | |||
| 22 | $attackers = $killmail["attackers"]; |
||
| 23 | $attacker = null; |
||
| 24 | foreach($attackers as $att) |
||
| 25 | { |
||
| 26 | if ($att["finalBlow"] != 0) $attacker = $att; |
||
| 27 | } |
||
| 28 | if ($attacker == null) $attacker = $attackers[0]; |
||
| 29 | $attackerID = $attacker["characterID"] == 0 ? "None" : $attacker["characterID"]; |
||
| 30 | |||
| 31 | $shipTypeID = $victim["shipTypeID"]; |
||
| 32 | |||
| 33 | $dttm = (strtotime($killmail["killTime"]) * 10000000) + 116444736000000000; |
||
| 34 | |||
| 35 | $string = "$victimID$attackerID$shipTypeID$dttm"; |
||
| 36 | |||
| 37 | $sha = sha1($string); |
||
| 38 | return $sha; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
This check looks for accesses to local static members using the fully qualified name instead of
self::.While this is perfectly valid, the fully qualified name of
Certificate::TRIPLEDES_CBCcould just as well be replaced byself::TRIPLEDES_CBC. Referencing local members withself::assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.