Skip to content

fixed typos and trailing slashes #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Behavioral/ChainOfResponsibilities/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/**
* Handler is a generic handler in the chain of responsibilities
*
* Yes you could have a lighter CoR with simpler handler but if you want your CoR to
* be extendable and decoupled, it's a better idea to do things like that in real
*
* Yes you could have a lighter CoR with a simpler handler but if you want your CoR
* to be extendable and decoupled, it's a better idea to do things like that in real
* situations. Usually, a CoR is meant to be changed everytime and evolves, that's
* why we slice the workflow in little bits of code.
*/
Expand All @@ -19,13 +19,13 @@ abstract class Handler

/**
* Append a responsibility to the end of chain
*
*
* A prepend method could be done with the same spirit
*
* You could also send the successor in the constructor but in PHP it is a
*
* You could also send the successor in the constructor but in PHP that is a
* bad idea because you have to remove the type-hint of the parameter because
* the last handler has a null successor.
*
*
* And if you override the constructor, that Handler can no longer have a
* successor. One solution is to provide a NullObject (see pattern).
* It is more preferable to keep the constructor "free" to inject services
Expand All @@ -43,10 +43,10 @@ final public function append(Handler $handler)
}

/**
* Handle the request.
*
* This approach by using a template method pattern ensures you that
* each subclass will not forget to call the successor. Beside, the returned
* Handle the request.
*
* This approach by using a template method pattern ensures you that
* each subclass will not forget to call the successor. Besides, the returned
* boolean value indicates you if the request have been processed or not.
*
* @param Request $req
Expand Down
10 changes: 5 additions & 5 deletions Behavioral/ChainOfResponsibilities/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

/**
* Request is a request which goes through the chain of responsibilities.
*
* About the request : Sometimes, you don't need an object, just an integer or
* an array. But in this case of a full example, I've made a class to illustrate
* this important idea in the CoR (Chain of Responsibilities). In real world,
*
* About the request: Sometimes, you don't need an object, just an integer or
* an array. But in this case of a full example, I've made a class to illustrate
* this important idea in the CoR (Chain of Responsibilities). In the real world,
* I recommend to always use a class, even a \stdClass if you want, it proves
* to be more adaptive because a single handler doesn't know much about the
* outside world and it is more difficult if, one day, you want to add some
* criterion in a decision process.
* criterion in a decision process.
*/
class Request
{
Expand Down
10 changes: 5 additions & 5 deletions Behavioral/ChainOfResponsibilities/Responsible/SlowStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

/**
* This is mostly the same code as FastStorage but in fact, it may greatly differs
*
* One important fact about CoR : each item in the chain MUST NOT assume its position
*
* One important fact about CoR: each item in the chain MUST NOT assume its position
* in the chain. A CoR is not responsible if the request is not handled UNLESS
* you make an "ExceptionHandler" which throws execption if the request goes there.
*
* To be really extendable, each handler doesn't know if there is something after him.
*
*
* To be really extendable, each handler doesn't know if there is something after it.
*
*/
class SlowStorage extends Handler
{
Expand Down
1 change: 1 addition & 0 deletions Behavioral/ChainOfResponsibilities/Tests/ChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function makeRequest()
{
$request = new Request();
$request->verb = 'get';

return array(
array($request)
);
Expand Down
2 changes: 1 addition & 1 deletion Behavioral/TemplateMethod/Journey.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function buyGift()
}

/**
* this method will be unknown by subclasses (better)
* This method will be unknown by subclasses (better)
*/
private function buyAFlight()
{
Expand Down
1 change: 0 additions & 1 deletion Creational/Pool/Tests/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class TestWorker
{

public $id = 1;
}

Expand Down