Skip to content

Commit

Permalink
Fixed a small possible bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Garethp committed Sep 28, 2015
1 parent 0909944 commit 52a0b60
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
21 changes: 17 additions & 4 deletions src/API/Type/ArrayOfFoldersType.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,35 @@ public function getAllFolders()
{
$folders = array();
if ($this->folder !== null) {
$folders = array_merge($folders, $this->folder);
$folders = array_merge($folders, (is_array($this->folder) ? $this->folder : array($this->folder)));
}

if ($this->calendarFolder !== null) {
$folders = array_merge($folders, $this->calendarFolder);
$folders = array_merge(
$folders,
(is_array($this->calendarFolder) ? $this->calendarFolder : array($this->calendarFolder))
);
}

if ($this->contactsFolder !== null) {
$folders = array_merge($folders, $this->contactsFolder);
$folders = array_merge(
$folders,
(is_array($this->contactsFolder) ? $this->contactsFolder : array($this->contactsFolder))
);
}

if ($this->searchFolder !== null) {
$folders = array_merge($folders, $this->searchFolder);
$folders = array_merge(
$folders,
(is_array($this->searchFolder) ? $this->searchFolder : array($this->searchFolder))
);
}

if ($this->tasksFolder !== null) {
$folders = array_merge(
$folders,
(is_array($this->tasksFolder) ? $this->tasksFolder : array($this->tasksFolder))
);
$folders = array_merge($folders, $this->tasksFolder);
}

Expand Down
8 changes: 7 additions & 1 deletion src/API/Type/FolderIdType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
class FolderIdType extends BaseFolderIdType
{

/**
* @var string
*/
Expand All @@ -26,6 +25,13 @@ class FolderIdType extends BaseFolderIdType
*/
protected $changeKey = null;

public function __construct($id, $changeKey)
{
$this->id = $id;
$this->changeKey = $changeKey;
}


public function toArray()
{
return [ 'Id' => $this->id, 'ChangeKey' => $this->changeKey ];
Expand Down
8 changes: 6 additions & 2 deletions tests/src/API/NTLMSoapClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ public function testValidateCertificate()
$prop = $reflection->getProperty('validate');
$prop->setAccessible(true);

$client = new NTLMSoapClient('location', 'user', 'password',
__DIR__ . '/../../../Resources/wsdl/services.wsdl');
$client = new NTLMSoapClient(
'location',
'user',
'password',
__DIR__ . '/../../../Resources/wsdl/services.wsdl'
);

$this->assertFalse($prop->getValue($client));

Expand Down

0 comments on commit 52a0b60

Please sign in to comment.