-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Vitexus/create_group
Create new group with the Example and Test
- Loading branch information
Showing
7 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Pushover package. | ||
* | ||
* (c) Serhiy Lunak <https://github.com/slunak> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Serhiy\Pushover\Client\Response; | ||
|
||
use Serhiy\Pushover\Client\Response\Base\Response; | ||
|
||
/** | ||
* @author Serhiy Lunak | ||
*/ | ||
class CreateGroupResponse extends Response | ||
{ | ||
/** | ||
* @var string Obtained Group Key | ||
*/ | ||
private $groupKey; | ||
|
||
/** | ||
* @param mixed $curlResponse | ||
*/ | ||
public function __construct($curlResponse) | ||
{ | ||
$this->processCurlResponse($curlResponse); | ||
} | ||
|
||
/** | ||
* @param mixed $curlResponse | ||
*/ | ||
private function processCurlResponse($curlResponse): void | ||
{ | ||
$decodedCurlResponse = $this->processInitialCurlResponse($curlResponse); | ||
$this->groupKey = property_exists($decodedCurlResponse,'group') ? $decodedCurlResponse->group : null; | ||
} | ||
|
||
/** | ||
* @return string Group key obtained | ||
*/ | ||
public function getGroupKey(): string | ||
{ | ||
return $this->groupKey; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters