Skip to content

Commit

Permalink
Merge pull request #4 from blesta/rename-namespace
Browse files Browse the repository at this point in the history
Renamed namespace with capital 'B'.
  • Loading branch information
clphillips committed Feb 26, 2016
2 parents 33369c3 + 51d41c2 commit f61b469
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 72 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ composer require blesta/reseller-api:~1.0
Initialize your connection. You'll need to inject this connection into any command type you wish to initialize.

```php
use blesta\ResellerApi\Connection;
use Blesta\ResellerApi\Connection;

$connection = new Connection();
$connection->setBasicAuth($username, $password);
Expand All @@ -30,7 +30,7 @@ $connection->setBasicAuth($username, $password);
Allows fetching available credit on your account.

```php
use blesta\ResellerApi\Command\Credits;
use Blesta\ResellerApi\Command\Credits;

$credits = new Credits($connection);
```
Expand All @@ -47,7 +47,7 @@ echo $result->response();
Allows fetching information on available packages.

```php
use blesta\ResellerApi\Command\Packages;
use Blesta\ResellerApi\Command\Packages;

$packages = new Packages($connection);
```
Expand All @@ -70,7 +70,7 @@ print_r($result->response());
Allows you to add, update, suspend, unsuspend, and cancel a license.

```php
use blesta\ResellerApi\Command\Licenses;
use Blesta\ResellerApi\Command\Licenses;

$licenses = new Licenses($connection);
```
Expand Down Expand Up @@ -131,7 +131,7 @@ $licenses->unsuspend($data);
Search for a particular license. Searches over license key, domain, IP address and installation path.

```php
use blesta\ResellerApi\Command\Search;
use Blesta\ResellerApi\Command\Search;

$search = new Search($connection);
$result = $search->data('search string')
Expand All @@ -145,7 +145,7 @@ print_r($result->response());
The examples shown in the Basic Usage section demonstrate direct usage of command objects. You may find the built-in command factory more user friendly.

```php
$commandFactory = new \blesta\ResellerApi\Command\CommandFactory();
$commandFactory = new \Blesta\ResellerApi\Command\CommandFactory();
$credits = $commandFactory->create('Credits', $connection);
$packages = $commandFactory->create('Packages', $connection);
$licenses = $commandFactory->create('Licenses', $connection);
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.2",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "~1.0"
},
"autoload": {
"psr-4": {
"blesta\\ResellerApi\\": "src"
"Blesta\\ResellerApi\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"blesta\\ResellerApi\\Tests\\": "tests"
"Blesta\\ResellerApi\\Tests\\": "tests"
}
}
}
6 changes: 3 additions & 3 deletions src/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

use blesta\ResellerApi\ConnectionInterface;
use Blesta\ResellerApi\ConnectionInterface;

/**
* Abstract Command
*/
abstract class AbstractCommand implements CommandInterface
{
/**
* @var \blesta\ResellerApi\ConnectionInterface
* @var \Blesta\ResellerApi\ConnectionInterface
*/
protected $connection;

Expand Down
8 changes: 4 additions & 4 deletions src/Command/CommandFactory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

use blesta\ResellerApi\ConnectionInterface;
use Blesta\ResellerApi\ConnectionInterface;

/**
* Command Factory
Expand All @@ -12,8 +12,8 @@ class CommandFactory
* Creates an instance of the command
*
* @param string $command The command to initialize
* @param \blesta\ResellerApi\ConnectionInterface $connection The connection
* @return \blesta\ResellerApi\Command\CommandInterface
* @param \Blesta\ResellerApi\ConnectionInterface $connection The connection
* @return \Blesta\ResellerApi\Command\CommandInterface
*/
public function create($command, ConnectionInterface $connection)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Command/CommandInterface.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

use blesta\ResellerApi\ConnectionInterface;
use Blesta\ResellerApi\ConnectionInterface;

/**
* Command Interface
*/
interface CommandInterface
{
/**
* @param \blesta\ResellerApi\ConnectionInterface $connection The connection
* @param \Blesta\ResellerApi\ConnectionInterface $connection The connection
*/
public function __construct(ConnectionInterface $connection);
}
4 changes: 2 additions & 2 deletions src/Command/Credits.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

/**
* Credits
Expand All @@ -9,7 +9,7 @@ class Credits extends AbstractCommand
/**
* Fetch the amount of credit available under your account
*
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function get()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Command/Licenses.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

/**
* Licenses
Expand All @@ -12,7 +12,7 @@ class Licenses extends AbstractCommand
* @param array $data An array of key/value pairs:
* - pricing_id The pricing ID
* - test_mode "true" to enable test mode
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function add(array $data)
{
Expand All @@ -30,7 +30,7 @@ public function add(array $data)
* - license The license key
* - reissue_status "reissue" to enable reissue
* - test_mode "true" to enable test mode
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function update(array $data)
{
Expand All @@ -47,7 +47,7 @@ public function update(array $data)
* @param array $data An array of key/value pairs:
* - license The license key
* - test_mode "true" to enable test mode
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function cancel(array $data)
{
Expand All @@ -64,7 +64,7 @@ public function cancel(array $data)
* @param array $data An array of key/value pairs:
* - license The license key
* - test_mode "true" to enable test mode
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function suspend(array $data)
{
Expand All @@ -81,7 +81,7 @@ public function suspend(array $data)
* @param array $data An array of key/value pairs:
* - license The license key
* - test_mode "true" to enable test mode
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function unsuspend(array $data)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Command/Packages.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

/**
* Packages
Expand All @@ -9,7 +9,7 @@ class Packages extends AbstractCommand
/**
* Fetch all available reseller packages
*
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function get()
{
Expand All @@ -20,7 +20,7 @@ public function get()
* Fetch pricing for a specific package
*
* @param int $package_id The ID of the package
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function getPricing($package_id)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Search.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi\Command;
namespace Blesta\ResellerApi\Command;

/**
* Search
Expand Down Expand Up @@ -45,7 +45,7 @@ public function page($page)
* license key, domain, IP, and install path. Only non-canceled licenses
* are returned. Up to 25 results are returned for each response.
*
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function get()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi;
namespace Blesta\ResellerApi;

/**
* Connection
Expand Down
4 changes: 2 additions & 2 deletions src/ConnectionInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi;
namespace Blesta\ResellerApi;

/**
* Connection Interface
Expand All @@ -20,7 +20,7 @@ public function setBasicAuth($username, $password);
* @param string $method get, post, put, delete, etc.
* @param string $uri The URI relative to the base URL
* @param array $data
* @return \blesta\ResellerApi\ResponseInterface
* @return \Blesta\ResellerApi\ResponseInterface
*/
public function send($method, $uri = '', array $data = array());
}
2 changes: 1 addition & 1 deletion src/Response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi;
namespace Blesta\ResellerApi;

/**
* Response
Expand Down
2 changes: 1 addition & 1 deletion src/ResponseInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace blesta\ResellerApi;
namespace Blesta\ResellerApi;

/**
* Response Interface
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/Command/BaseCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace blesta\ResellerApi\Tests\Command;
namespace Blesta\ResellerApi\Tests\Command;

use blesta\ResellerApi\ConnectionInterface;
use blesta\ResellerApi\ResponseInterface;
use Blesta\ResellerApi\ConnectionInterface;
use Blesta\ResellerApi\ResponseInterface;
use PHPUnit_Framework_TestCase;

/**
Expand All @@ -11,21 +11,21 @@
abstract class BaseCommand extends PHPUnit_Framework_TestCase
{
/**
* @return \blesta\ResellerApi\Response
* @return \Blesta\ResellerApi\Response
*/
public function getResponseMock()
{
return $this->getMockBuilder('\blesta\ResellerApi\Response')
return $this->getMockBuilder('\Blesta\ResellerApi\Response')
->disableOriginalConstructor()
->getMock();
}

/**
* @return \blesta\ResellerApi\ConnectionInterface
* @return \Blesta\ResellerApi\ConnectionInterface
*/
public function getConnectionMock()
{
return $this->getMock('\blesta\ResellerApi\ConnectionInterface');
return $this->getMock('\Blesta\ResellerApi\ConnectionInterface');
}

/**
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Command/CommandFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
namespace blesta\ResellerApi\Tests\Command;
namespace Blesta\ResellerApi\Tests\Command;

use blesta\ResellerApi\Command\CommandFactory;
use Blesta\ResellerApi\Command\CommandFactory;
use PHPUnit_Framework_TestCase;

/**
* @coversDefaultClass \blesta\ResellerApi\Command\CommandFactory
* @coversDefaultClass \Blesta\ResellerApi\Command\CommandFactory
*/
class CommandFactoryTest extends PHPUnit_Framework_TestCase
{
/**
* @covers ::create
* @uses \blesta\ResellerApi\Command\AbstractCommand::__construct
* @uses \Blesta\ResellerApi\Command\AbstractCommand::__construct
*/
public function testCreate()
{
$factory = new CommandFactory();

$connection = $this->getMock('\blesta\ResellerApi\ConnectionInterface');
$connection = $this->getMock('\Blesta\ResellerApi\ConnectionInterface');

$this->assertInstanceOf(
'\blesta\ResellerApi\Command\Credits',
'\Blesta\ResellerApi\Command\Credits',
$factory->create('Credits', $connection)
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Command/CreditsTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace blesta\ResellerApi\Tests\Command;
namespace Blesta\ResellerApi\Tests\Command;

use blesta\ResellerApi\Command\Credits;
use Blesta\ResellerApi\Command\Credits;

/**
* @coversDefaultClass \blesta\ResellerApi\Command\Credits
* @coversDefaultClass \Blesta\ResellerApi\Command\Credits
*/
class CreditsTest extends BaseCommand
{
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/Command/LicensesTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
namespace blesta\ResellerApi\Tests\Command;
namespace Blesta\ResellerApi\Tests\Command;

use blesta\ResellerApi\Command\Licenses;
use blesta\ResellerApi\Command\CommandInterface;
use Blesta\ResellerApi\Command\Licenses;

/**
* @coversDefaultClass \blesta\ResellerApi\Command\Licenses
* @coversDefaultClass \Blesta\ResellerApi\Command\Licenses
*/
class LicensesTest extends BaseCommand
{
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Command/PackagesTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace blesta\ResellerApi\Tests\Command;
namespace Blesta\ResellerApi\Tests\Command;

use blesta\ResellerApi\Command\Packages;
use Blesta\ResellerApi\Command\Packages;

/**
* @coversDefaultClass \blesta\ResellerApi\Command\Packages
* @coversDefaultClass \Blesta\ResellerApi\Command\Packages
*/
class PackagesTest extends BaseCommand
{
Expand Down
Loading

0 comments on commit f61b469

Please sign in to comment.