Cleanup in src/, adding namespaces, removing php closing tag and general code cleanup

This commit is contained in:
Alexander Liljengård
2016-05-24 14:10:39 +02:00
parent 9f97eb1653
commit 5694a2fb30
64 changed files with 891 additions and 1328 deletions

View File

@ -1,9 +1,4 @@
<?php
namespace Moserware\Skills;
require_once(dirname(__FILE__) . "/Guard.php");
require_once(dirname(__FILE__) . "/ISupportPartialPlay.php");
require_once(dirname(__FILE__) . "/ISupportPartialUpdate.php");
<?php namespace Moserware\Skills;
/**
* Represents a player who has a Rating.
@ -19,7 +14,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
/**
* Constructs a player.
*
*
* @param mixed $id The identifier for the player, such as a name.
* @param number $partialPlayPercentage The weight percentage to give this player when calculating a new rank.
* @param number $partialUpdatePercentage Indicated how much of a skill update a player should receive where 0 represents no update and 1.0 represents 100% of the update.
@ -44,7 +39,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
$id = &$this->_Id;
return $this->_Id;
}
/**
* Indicates the percent of the time the player should be weighted where 0.0 indicates the player didn't play and 1.0 indicates the player played 100% of the time.
*/
@ -52,7 +47,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
{
return $this->_PartialPlayPercentage;
}
/**
* Indicated how much of a skill update a player should receive where 0.0 represents no update and 1.0 represents 100% of the update.
*/
@ -60,15 +55,13 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
{
return $this->_PartialUpdatePercentage;
}
public function __toString()
{
if ($this->_Id != null)
{
if ($this->_Id != null) {
return (string)$this->_Id;
}
return parent::__toString();
}
}
?>
}