Skip to content

Commit

Permalink
Minor code (style) and typo's fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Oct 11, 2015
1 parent 3dfdca4 commit ce2ff7b
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 38 deletions.
8 changes: 4 additions & 4 deletions src/Config/LaravelConfig.php
Expand Up @@ -18,7 +18,7 @@
|
| A restful API consists of many data object, also known as resources or
| models. To allow a single model to be accessible through the API you
| have to "whitelist" it with a certain name. The name will be the link to
| have to "white list" it with a certain name. The name will be the link to
| the URL's and the model. All listed models will be registered
| to the provided resource manager.
|
Expand All @@ -44,17 +44,17 @@
| Routes
|--------------------------------------------------------------------------
|
| An API contains routes that defines the actions a resource can recieve.
| An API contains routes that defines the actions a resource can receive.
| For example; some people wants to `create` projects, others would love to
| `update` the project name. So basically, all those simple actions are
| executed by a controller. Here you can define the controller it SHOULD
| use. As you might have noticed, this is only one controller. Think of it as
| an `one size fits all` controller. It's quite repeatative to define all
| an `one size fits all` controller. It's quite repetitive to define all
| actions, for every resource model again. Therefore the models are being
| injected using the resource manager.
|
| And last, but not least, you can specify all settings you would like to
| pass to the route's group. Like the middlewares it SHOULD use, and/or a
| pass to the route's group. Like the middleware it SHOULD use, and/or a
| security it SHOULD add. Customize it, to fit your project.
|
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Config/LumenConfig.php
Expand Up @@ -18,7 +18,7 @@
|
| A restful API consists of many data object, also known as resources or
| models. To allow a single model to be accessible through the API you
| have to "whitelist" it with a certain name. The name will be the link to
| have to "white list" it with a certain name. The name will be the link to
| the URL's and the model. All listed models will be registered
| to the provided resource manager.
|
Expand All @@ -44,17 +44,17 @@
| Routes
|--------------------------------------------------------------------------
|
| An API contains routes that defines the actions a resource can recieve.
| An API contains routes that defines the actions a resource can receive.
| For example; some people wants to `create` projects, others would love to
| `update` the project name. So basically, all those simple actions are
| executed by a controller. Here you can define the controller it SHOULD
| use. As you might have noticed, this is only one controller. Think of it as
| an `one size fits all` controller. It's quite repeatative to define all
| an `one size fits all` controller. It's quite repetitive to define all
| actions, for every resource model again. Therefore the models are being
| injected using the resource manager.
|
| And last, but not least, you can specify all settings you would like to
| pass to the route's group. Like the middlewares it SHOULD use, and/or a
| pass to the route's group. Like the middleware it SHOULD use, and/or a
| security it SHOULD add. Customize it, to fit your project.
|
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/Manager.php
Expand Up @@ -25,7 +25,7 @@ class Manager implements \ByCedric\Allay\Contracts\Exceptions\Manager
/**
* Try to fetch the registered handler for the given exception.
*
* @param string|\Exception $error
* @param \Exception $error
* @return \ByCedric\Allay\Contracts\Exceptions\Handler
*/
protected function getHandler($error)
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/ResourceException.php
Expand Up @@ -26,7 +26,7 @@ class ResourceException extends \RuntimeException
* @param string $resource
* @param string $message (default: '')
* @param integer $code (default: 0)
* @oaram \Exception $previous (default: null)
* @param \Exception $previous (default: null)
* @return void
*/
public function __construct($resource, $message = '', $code = 0, \Exception $previous = null)
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Middleware/UpdateStatusCodeByRequestMethod.php
Expand Up @@ -69,7 +69,8 @@ protected function updateStatus($request, Response $response)
/**
* Determine if we should update the status code, by request method.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response $response
* @return bool
*/
protected function shouldUpdateStatus($request, Response $response)
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/AgnosticServiceProvider.php
Expand Up @@ -67,7 +67,7 @@ public function register()
*/
protected function registerExceptionManager()
{
$this->app->singleton(ExceptionManager::class, function ($app) {
$this->app->singleton(ExceptionManager::class, function () {
return new ExceptionManager();
});
}
Expand Down Expand Up @@ -125,7 +125,7 @@ protected function bindExceptionManager()
}

/**
* Bind the resource manager implmentation to the abstract contract.
* Bind the resource manager implementation to the abstract contract.
* Make it optional so the abstraction can be easily modified.
*
* @return void
Expand All @@ -136,7 +136,7 @@ protected function bindResourceManager()
}

/**
* Bind the resource resolver implementation to the abstrct contract.
* Bind the resource resolver implementation to the abstract contract.
* Make it optional so the abstraction can be easily modified.
*
* @return void
Expand Down
10 changes: 5 additions & 5 deletions tests/ConfigTestCase.php
Expand Up @@ -37,8 +37,8 @@ protected function getConfig($item = null)
$config = include $this->getConfigPath();

if (!empty($item)) {
foreach (explode('.', $item) as $subitem) {
$config = $config[$subitem];
foreach (explode('.', $item) as $child) {
$config = $config[$child];
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ public function testResourceModelsIsAnEmptyArray()

public function testRouteControllerIsDefined()
{
$this->assertClassExists($this->getConfig('routes.controller'), 'Defined controller class doesn\'t exists.');
$this->assertClassExists($this->getConfig('routes.controller'), 'Defined controller class does not exists.');
}

public function testRouteSettingsIsAnArray()
Expand All @@ -102,7 +102,7 @@ public function testTransformerIsDefinedAndImplementsContract()
$this->assertSubclassOf(
TransformerContract::class,
$this->getConfig('transformer'),
'Defined transformer is not copatible.'
'Defined transformer is not compatible.'
);
}

Expand All @@ -111,7 +111,7 @@ public function testExceptionManagerIsDefinedAndImplementsContract()
$this->assertSubclassOf(
ExceptionManagerContract::class,
$this->getConfig('exceptions.manager'),
'Defined exeption manager is not compatible.'
'Defined exception manager is not compatible.'
);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/ExceptionHandlerTestCase.php
Expand Up @@ -19,7 +19,7 @@ abstract class ExceptionHandlerTestCase extends TestCase
/**
* Assert if the provided handler is capable in handling the provided exception.
*
* @param \ByCedric\Allay\Contracts\Excpetions\Handler $handler
* @param \ByCedric\Allay\Contracts\Exceptions\Handler $handler
* @param \Exception $error
* @param string $message (default: '')
* @return void
Expand All @@ -32,7 +32,7 @@ public function assertIsCapable(Handler $handler, \Exception $error, $message =
/**
* Assert if the provided handler is not capable in handling the provided exception.
*
* @param \ByCedric\Allay\Contracts\Excpetions\Handler $handler
* @param \ByCedric\Allay\Contracts\Exceptions\Handler $handler
* @param \Exception $error
* @param string $message (default: '')
* @return void
Expand All @@ -45,7 +45,7 @@ public function assertIsNotCapable(Handler $handler, \Exception $error, $message
/**
* Assert if the handler returns a response for the exception, with the provided status code.
*
* @param \ByCedric\Allay\Contracts\Excpetions\Handler $handler
* @param \ByCedric\Allay\Contracts\Exceptions\Handler $handler
* @param \Exception $error
* @param int $status
* @param string $message (default: '')
Expand Down
1 change: 0 additions & 1 deletion tests/Exceptions/ManagerTestCase.php
Expand Up @@ -13,7 +13,6 @@

use ByCedric\Allay\Contracts\Exceptions\Handler;
use ByCedric\Allay\Exceptions\Manager;
use Illuminate\Http\Response;
use Mockery;

class ManagerTestCase extends \ByCedric\Allay\Tests\TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/Http/Controllers/Traits/StoreActionTestCase.php
Expand Up @@ -19,7 +19,6 @@
use ByCedric\Allay\Tests\Stubs\Resource\Resource;
use Illuminate\Contracts\Validation\ValidationException;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Database\Query\Builder;
use Illuminate\Http\Request;
use Mockery;

Expand Down
16 changes: 8 additions & 8 deletions tests/Resource/Resolvers/AgnosticResolverTestCase.php
Expand Up @@ -29,7 +29,7 @@ public function testGetResourceParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getResourceParameter(),
'Resolver didn\'t return a valid resource parameter.'
'Resolver did not return a valid resource parameter.'
);
}

Expand All @@ -38,15 +38,15 @@ public function testGetResourceUsesParameterToFetchAndReturnRouteValue()
$this->assertSame(
'resource',
$this->getInstance()->getResource(),
'Resolver didn\'t return resource value correctly.'
'Resolver did not return resource value correctly.'
);
}

public function testGetIdParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getIdParameter(),
'Resolver didn\'t return a valid id parameter.'
'Resolver did not return a valid id parameter.'
);
}

Expand All @@ -55,15 +55,15 @@ public function testGetIdUsesParameterToFetchAndReturnRouteValue()
$this->assertSame(
'id',
$this->getInstance()->getId(),
'Resolver didn\'t return id value correctly.'
'Resolver did not return id value correctly.'
);
}

public function testGetRelationParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getRelationParameter(),
'Resolver didn\'t return a valid relation parameter.'
'Resolver did not return a valid relation parameter.'
);
}

Expand All @@ -72,23 +72,23 @@ public function testGetRelationUsesParameterToFetchAndReturnRouteValue()
$this->assertSame(
'relation',
$this->getInstance()->getRelation(),
'Resolver didn\'t return relation value correctly.'
'Resolver did not return relation value correctly.'
);
}

public function testGetSubIdParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getSubIdParameter(),
'Resolver didn\'t return a valid subid parameter.'
'Resolver did not return a valid sub-id parameter.'
);
}

public function testGetSubIdUsesParameterToFetchAndReturnRouteValue()
{
$this->assertSame('subid',
$this->getInstance()->getSubId(),
'Resolver didn\'t return subid value correctly.'
'Resolver did not return sub-id value correctly.'
);
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Resource/Resolvers/LaravelResolverTestCase.php
Expand Up @@ -11,7 +11,6 @@

namespace ByCedric\Allay\Resource\Resolvers;

use ByCedric\Allay\Resource\Resolvers\LaravelResolver;
use Illuminate\Routing\Route;
use Mockery;

Expand Down Expand Up @@ -45,7 +44,7 @@ public function testGetRouteParameterReturnsParameterValueFromRoute()
$this->assertSame(
'test',
$this->callProtectedMethod($resolver, 'getRouteParameter', ['resource']),
'Resolver didn\'t return the correct route parameter value.'
'Resolver did not return the correct route parameter value.'
);
}
}
5 changes: 2 additions & 3 deletions tests/Resource/Resolvers/LumenResolverTestCase.php
Expand Up @@ -11,7 +11,6 @@

namespace ByCedric\Allay\Resource\Resolvers;

use ByCedric\Allay\Resource\Resolvers\LumenResolver;
use Illuminate\Http\Request;
use Mockery;

Expand Down Expand Up @@ -48,7 +47,7 @@ function () { /* closure */ },
$this->assertSame(
'test',
$this->callProtectedMethod($resolver, 'getRouteParameter', ['resource']),
'Resolver didn\'t return the correct route parameter value.'
'Resolver did not return the correct route parameter value.'
);
}

Expand All @@ -67,7 +66,7 @@ function () { /* closure */ },

$this->assertEmpty(
$this->callProtectedMethod($resolver, 'getRouteParameter', ['abc']),
'Resolver didn\'t return empty value for unknown route parameter.'
'Resolver did not return empty value for unknown route parameter.'
);
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Expand Up @@ -64,7 +64,7 @@ public function assertSubclassOf($expected, $classType, $message = '')
}

/**
* Assert if the proviided class type exists.
* Assert if the provided class type exists.
*
* @param string $classType
* @param string $message (default: '')
Expand Down

0 comments on commit ce2ff7b

Please sign in to comment.