php < 5.5 compatible

This commit is contained in:
Arthur Schiwon 2015-12-09 16:25:31 +01:00
parent 8e298f51f8
commit 6af6febad0
1 changed files with 5 additions and 5 deletions

View File

@ -194,7 +194,7 @@ class Comment implements IComment {
* @since 9.0.0 * @since 9.0.0
*/ */
public function setVerb($verb) { public function setVerb($verb) {
if(!is_string($verb) || empty(trim($verb))) { if(!is_string($verb) || !trim($verb)) {
throw new \InvalidArgumentException('Non-empty String expected.'); throw new \InvalidArgumentException('Non-empty String expected.');
} }
$this->data['verb'] = trim($verb); $this->data['verb'] = trim($verb);
@ -231,8 +231,8 @@ class Comment implements IComment {
*/ */
public function setActor($actorType, $actorId) { public function setActor($actorType, $actorId) {
if( if(
!is_string($actorType) || empty(trim($actorType)) !is_string($actorType) || !trim($actorType)
|| !is_string($actorId) || empty(trim($actorId)) || !is_string($actorId) || !trim($actorId)
) { ) {
throw new \InvalidArgumentException('String expected.'); throw new \InvalidArgumentException('String expected.');
} }
@ -317,8 +317,8 @@ class Comment implements IComment {
*/ */
public function setObject($objectType, $objectId) { public function setObject($objectType, $objectId) {
if( if(
!is_string($objectType) || empty(trim($objectType)) !is_string($objectType) || !trim($objectType)
|| !is_string($objectId) || empty(trim($objectId)) || !is_string($objectId) || !trim($objectId)
) { ) {
throw new \InvalidArgumentException('String expected.'); throw new \InvalidArgumentException('String expected.');
} }