Skip to content

Commit

Permalink
Change namespace from Napp to Napp\AeroGearPush
Browse files Browse the repository at this point in the history
  • Loading branch information
ramlev committed Mar 17, 2016
1 parent c893501 commit 912bd35
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 73 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Example on how to use this library.
```php
<?php

use Napp\Request;
use Napp\Exception;
use Napp\AeroGearPush\Request;
use Napp\AeroGearPush\Exception;

$request = new senderPushRequest();
$request
Expand Down Expand Up @@ -96,7 +96,7 @@ json
```setBearer() # oAuth token```
```setCertificate() # fopen file resource```
```setPassphrase() # string```
```setProduction() # boolean```
```setProduction() # string ('true' or 'false')'```

##### Optional methods
```setName() # string```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"autoload": {
"psr-4": {
"Napp\\": "src/"
"Napp\\AeroGearPush\\": "src/"
}
},
"require": {
Expand Down
93 changes: 54 additions & 39 deletions src/AeroGearPush.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
* file that was distributed with this source code.
*/

namespace Napp;

use Napp\Client\curlClient;
use Napp\Exception\AeroGearPushException;
use Napp\Request\createAndroidVariantRequest;
use Napp\Request\createIosVariantRequest;
use Napp\Request\createSimplePushVariantRequest;
use Napp\Request\deleteApplicationRequest;
use Napp\Request\getApplicationInstallationRequest;
use Napp\Request\getApplicationRequest;
use Napp\Request\getMetricsDashboardRequest;
use Napp\Request\getMetricsMessagesRequest;
use Napp\Request\getSysInfoHealthRequest;
use Napp\Request\senderPushRequest;
namespace Napp\AeroGearPush;

use Napp\AeroGearPush\Client\curlClient;
use Napp\AeroGearPush\Exception\AeroGearPushException;
use Napp\AeroGearPush\Request\createAndroidVariantRequest;
use Napp\AeroGearPush\Request\createIosVariantRequest;
use Napp\AeroGearPush\Request\createSimplePushVariantRequest;
use Napp\AeroGearPush\Request\deleteApplicationRequest;
use Napp\AeroGearPush\Request\getApplicationInstallationRequest;
use Napp\AeroGearPush\Request\getApplicationRequest;
use Napp\AeroGearPush\Request\getMetricsDashboardRequest;
use Napp\AeroGearPush\Request\getMetricsMessagesRequest;
use Napp\AeroGearPush\Request\getSysInfoHealthRequest;
use Napp\AeroGearPush\Request\senderPushRequest;

/**
* Class AeroGearPush
Expand All @@ -47,7 +47,7 @@ class AeroGearPush
private $serverUrl;

/**
* @var \Napp\Client\curlClient
* @var \Napp\AeroGearPush\Client\curlClient
*/
private $curlClient;

Expand Down Expand Up @@ -83,7 +83,7 @@ public function __get($name)
}

/**
* @return \Napp\AeroGearPush
* @return \Napp\AeroGearPush\AeroGearPush
*/
public static function create()
{
Expand Down Expand Up @@ -139,10 +139,11 @@ public function setMasterSecret($masterSecret)
}

/**
* @param \Napp\Request\getSysInfoHealthRequest $request
* @param \Napp\AeroGearPush\Request\getSysInfoHealthRequest $request
*
* @return string
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function sysInfoHealth(getSysInfoHealthRequest $request)
{
Expand All @@ -169,10 +170,11 @@ public function sysInfoHealth(getSysInfoHealthRequest $request)
/**
* GET dashboard data.
*
* @param \Napp\Request\getMetricsDashboardRequest $request
* @param \Napp\AeroGearPush\Request\getMetricsDashboardRequest $request
*
* @return mixed
* @throws \Napp\Exception\AeroGearPushException
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function metricsDashboard(getMetricsDashboardRequest $request)
{
Expand All @@ -199,11 +201,11 @@ public function metricsDashboard(getMetricsDashboardRequest $request)
/**
* GET info about submitted push messages for the given Push Application
*
* @param \Napp\Request\getMetricsMessagesRequest $request
* @param \Napp\AeroGearPush\Request\getMetricsMessagesRequest $request
*
* @return mixed
* @throws \Exception
* @throws \Napp\Exception\AeroGearPushException
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function metricsMessages(getMetricsMessagesRequest $request)
{
Expand Down Expand Up @@ -231,10 +233,11 @@ public function metricsMessages(getMetricsMessagesRequest $request)
}

/**
* @param \Napp\Request\createSimplePushVariantRequest $request
* @param \Napp\AeroGearPush\Request\createSimplePushVariantRequest $request
*
* @return mixed
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function createSimplePushVariant(
createSimplePushVariantRequest $request
Expand All @@ -261,10 +264,11 @@ public function createSimplePushVariant(
}

/**
* @param \Napp\Request\createIosVariantRequest $request
* @param \Napp\AeroGearPush\Request\createIosVariantRequest $request
*
* @return mixed
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function createIosVariant(createIosVariantRequest $request)
{
Expand All @@ -290,10 +294,11 @@ public function createIosVariant(createIosVariantRequest $request)
}

/**
* @param \Napp\Request\createAndroidVariantRequest $request
* @param \Napp\AeroGearPush\Request\createAndroidVariantRequest $request
*
* @return mixed
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function createAndroidVariant(createAndroidVariantRequest $request)
{
Expand Down Expand Up @@ -326,7 +331,8 @@ public function createAndroidVariant(createAndroidVariantRequest $request)
* @param $request
*
* @return mixed
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function createApplication($request)
{
Expand Down Expand Up @@ -357,6 +363,12 @@ public function createApplication($request)
return json_decode($response->getBody()->getContents());
}

/**
* @param \Napp\AeroGearPush\Request\getApplicationInstallationRequest $request
*
* @return mixed
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function getApplicationInstallation(
getApplicationInstallationRequest $request
) {
Expand Down Expand Up @@ -396,10 +408,11 @@ public function getApplicationInstallation(


/**
* @param \Napp\Request\getApplicationRequest $request
* @param \Napp\AeroGearPush\Request\getApplicationRequest $request
*
* @return mixed
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public
function getApplication(
Expand Down Expand Up @@ -429,12 +442,14 @@ function getApplication(
}

/**
* @param \Napp\Request\deleteApplicationRequest $request
* @param \Napp\AeroGearPush\Request\deleteApplicationRequest $request
*
* @return array
* @throws \Napp\Exception\AeroGearPushException
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function deleteApplication(deleteApplicationRequest $request) {
public function deleteApplication(deleteApplicationRequest $request)
{
if (!empty($request->headers)) {
$request->data['headers'] = $request->headers;
}
Expand All @@ -456,15 +471,15 @@ public function deleteApplication(deleteApplicationRequest $request) {
}

/**
* @param \Napp\Request\senderPushRequest $request
* @param \Napp\AeroGearPush\Request\senderPushRequest $request
*
* @return mixed|\Psr\Http\Message\ResponseInterface
* @throws \Exception
*
* @throws \Napp\AeroGearPush\Exception\AeroGearPushException
*/
public function senderPush(senderPushRequest $request)
{
if (empty($request->message) || empty($request->criteria))
{
if (empty($request->message) || empty($request->criteria)) {
throw new AeroGearPushException("Required fields 'message' and 'critera' have to be present.");
}

Expand Down
4 changes: 2 additions & 2 deletions src/Client/curlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/

namespace Napp\Client;
namespace Napp\AeroGearPush\Client;

use GuzzleHttp\Client;
use Symfony\Component\HttpFoundation\JsonResponse;

/**
* Class curlClient
*
* @package Napp\Client
* @package Napp\AeroGearPush\Client
* @author Hasse Ramlev Hansen <[email protected]>]
*/
class curlClient
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/AeroGearPushException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Napp\Exception;
namespace Napp\AeroGearPush\Exception;

/**
* Class AeroGearPushException
*
* @package Napp\Exception
* @package Napp\AeroGearPush\Exception
* @author Hasse Ramlev Hansen <[email protected]>
*/
class AeroGearPushException extends \Exception
Expand Down
4 changes: 2 additions & 2 deletions src/Request/abstractApplicationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class abstractApplicationRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/createAndroidVariantRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class createAndroidVariantRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class createAndroidVariantRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/createApplicationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class createApplicationRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class createApplicationRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/createIosVariantRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class createIosVariantRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class createIosVariantRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/createSimplePushVariantRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class createSimplePushVariantRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class createSimplePushVariantRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/deleteApplicationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class deleteApplicationRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class deleteApplicationRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/getApplicationInstallationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class getApplicationInstallationRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class getApplicationInstallationRequest extends abstractApplicationRequest
Expand Down
4 changes: 2 additions & 2 deletions src/Request/getApplicationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Napp\Request;
namespace Napp\AeroGearPush\Request;

/**
* Class getApplicationRequest
*
* @package Napp\Request
* @package Napp\AeroGearPush\Request
* @author Hasse Ramlev Hansen <[email protected]>
*/
class getApplicationRequest extends abstractApplicationRequest
Expand Down
Loading

0 comments on commit 912bd35

Please sign in to comment.