Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
account for more booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Feb 4, 2014
1 parent 39c20a3 commit 3b7ead6
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/Wrapper/CakePHP/EmailDsn.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function getMessageId()
return;
}

if (strlen($return) > 1) {
return $return;
}

return (bool) $return;
}

Expand Down
49 changes: 47 additions & 2 deletions src/Wrapper/CakePHP/LogDsn.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,34 @@ public static function parse($url, $options = [])
return $inst->toArray();
}

public function getTypes()
public function getGroups()
{
$return = $this->dsn->groups;

if ($return === null) {
return;
}
return explode(',', $return);
}

public function getLock()
{
return explode(',', $this->dsn->types);
$return = $this->dsn->lock;

if ($return === null) {
return;
}
return (int) $return;
}

public function getProbability()
{
$return = $this->dsn->probability;

if ($return === null) {
return;
}
return (int) $return;
}

public function getScheme()
Expand All @@ -42,4 +67,24 @@ public function setScheme($value)
{
$this->dsn->scheme = lcfirst($value);
}

public function getSerialize()
{
$return = $this->dsn->serialize;

if ($return === null) {
return;
}
return (int) $return;
}

public function getTypes()
{
$return = $this->dsn->types;

if ($return === null) {
return;
}
return explode(',', $return);
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/Wrapper/CakePHP/EmailDsnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function defaultsProvider()
]
],
[
'smtp://user:secret@localhost:25/?from=you@localhost&messageId=true&template=0&layout=0&timeout=30',
'smtp://user:secret@localhost:25/?from=you@localhost&messageId=1&template=0&layout=0&timeout=30',
[
'transport' => 'Smtp',
'host' => 'localhost',
Expand Down

0 comments on commit 3b7ead6

Please sign in to comment.