Skip to content

Commit

Permalink
GitHub #82 - Add length check on device type
Browse files Browse the repository at this point in the history
  • Loading branch information
sqmk committed Mar 5, 2014
1 parent 3f0ec67 commit 3da929f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/Phue/Command/CreateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public function setUsername($username)
*/
public function setDeviceType($deviceType)
{
if (strlen($deviceType) > 40) {
throw new \InvalidArgumentException(
"Device type must not have a length have more than 40 characters"
);
}

$this->deviceType = (string) $deviceType;

return $this;
Expand Down

0 comments on commit 3da929f

Please sign in to comment.