-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from gyselroth/dev
v3.2.0
- Loading branch information
Showing
17 changed files
with
459 additions
and
64 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
./vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v |
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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
## 3.2.0 | ||
**Maintainer**: Raffael Sahli <[email protected]>\ | ||
**Date**: Mon Mar 25 16:14:33 CET 2018 | ||
|
||
* [FEATURE] Add event bindings in the Process handler #26 | ||
* [FEATURE] Add event callback bindings to wait(), waitFor() #28 | ||
* [FEATURE] Progress support #29 | ||
|
||
|
||
## 3.1.0 | ||
**Maintainer**: Raffael Sahli <[email protected]>\ | ||
**Date**: Mon Mar 25 16:14:33 CET 2018 | ||
|
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
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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace TaskScheduler; | ||
|
||
use Closure; | ||
use League\Event\Emitter; | ||
|
||
trait EventsTrait | ||
{ | ||
/** | ||
* Emitter | ||
* | ||
* @var Emitter | ||
*/ | ||
protected $emitter; | ||
|
||
/** | ||
* Bind event listener | ||
*/ | ||
public function on(string $event, Closure $handler) | ||
{ | ||
if(!in_array($event, Scheduler::VALID_EVENTS) || $event === '*') { | ||
$event = 'taskscheduler.on'.ucfirst($event); | ||
} | ||
|
||
$this->emitter->addListener($event, $handler); | ||
return $this; | ||
} | ||
|
||
/** | ||
* Emit process event | ||
*/ | ||
protected function emit(Process $process): bool | ||
{ | ||
$this->emitter->emit(Scheduler::VALID_EVENTS[$process->getStatus()], $process); | ||
return true; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace TaskScheduler\Exception; | ||
|
||
class LogicException extends \LogicException | ||
{ | ||
} |
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
Oops, something went wrong.