mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-10 08:54:03 +02:00
fixed typos and trailing slashes
This commit is contained in:
@@ -4,9 +4,9 @@ namespace DesignPatterns\Behavioral\ChainOfResponsibilities;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@@ -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
|
||||
@@ -43,10 +43,10 @@ abstract class 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
|
||||
|
Reference in New Issue
Block a user