-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Pipeline support class and Pipeline facade
- Loading branch information
Showing
15 changed files
with
779 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace SlimFacades\Contracts; | ||
|
||
use Closure; | ||
|
||
interface Pipeline | ||
{ | ||
/** | ||
* Set the traveler object being sent on the pipeline. | ||
* | ||
* @param mixed $traveler | ||
* @return $this | ||
*/ | ||
public function send($traveler); | ||
|
||
/** | ||
* Set the stops of the pipeline. | ||
* | ||
* @param dynamic|array $stops | ||
* @return $this | ||
*/ | ||
public function through($stops); | ||
|
||
/** | ||
* Set the method to call on the stops. | ||
* | ||
* @param string $method | ||
* @return $this | ||
*/ | ||
public function via($method); | ||
|
||
/** | ||
* Run the pipeline with a final destination callback. | ||
* | ||
* @param \Closure $destination | ||
* @return mixed | ||
*/ | ||
public function then(Closure $destination); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace SlimFacades\Facades; | ||
|
||
use SlimFacades\Support\Facade; | ||
use SlimFacades\Support\Pipeline as PipelineBase; | ||
|
||
class Pipeline extends Facade | ||
{ | ||
public static function getFacadeRoot() | ||
{ | ||
return new PipelineBase(static::$app->getContainer()); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pipeline'; | ||
} | ||
} |
Oops, something went wrong.