-
Notifications
You must be signed in to change notification settings - Fork 18
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 #80 from shopwareLabs/add-defered-commands
add defered commands to psh
- Loading branch information
Showing
19 changed files
with
705 additions
and
190 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
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,6 +1,9 @@ | ||
#!/usr/bin/env bash | ||
# DESCRIPTION: Execute unit tests | ||
|
||
bin/php-cs-fixer fix | ||
bin/phpunit --debug --verbose --coverage-clover=./build/coverage.xml --coverage-html=./build/html-coverage | ||
D: bin/php-cs-fixer fix | ||
D: phpdbg -qrr bin/phpunit --debug --verbose --coverage-clover=./build/coverage.xml --coverage-html=./build/html-coverage | ||
|
||
WAIT: | ||
|
||
./humbug.phar --no-interaction |
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,80 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Shopware\Psh\ScriptRuntime; | ||
|
||
use Symfony\Component\Process\Process; | ||
|
||
class DeferredProcess | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $parsedCommand; | ||
|
||
/** | ||
* @var ProcessCommand | ||
*/ | ||
private $command; | ||
|
||
/** | ||
* @var Process | ||
*/ | ||
private $process; | ||
|
||
/** | ||
* @var LogMessage[] | ||
*/ | ||
private $log = []; | ||
|
||
/** | ||
* @param string $parsedCommand | ||
* @param ProcessCommand $command | ||
* @param Process $process | ||
*/ | ||
public function __construct(string $parsedCommand, ProcessCommand $command, Process $process) | ||
{ | ||
$this->command = $command; | ||
$this->process = $process; | ||
$this->parsedCommand = $parsedCommand; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getParsedCommand(): string | ||
{ | ||
return $this->parsedCommand; | ||
} | ||
|
||
/** | ||
* @return ProcessCommand | ||
*/ | ||
public function getCommand(): ProcessCommand | ||
{ | ||
return $this->command; | ||
} | ||
|
||
/** | ||
* @return Process | ||
*/ | ||
public function getProcess(): Process | ||
{ | ||
return $this->process; | ||
} | ||
|
||
/** | ||
* @param LogMessage $logMessage | ||
*/ | ||
public function log(LogMessage $logMessage) | ||
{ | ||
$this->log[] = $logMessage; | ||
} | ||
|
||
/** | ||
* @return LogMessage[] | ||
*/ | ||
public function getLog(): array | ||
{ | ||
return $this->log; | ||
} | ||
} |
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,42 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Shopware\Psh\ScriptRuntime; | ||
|
||
class LogMessage | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $message; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
private $error; | ||
|
||
/** | ||
* @param string $message | ||
* @param bool $error | ||
*/ | ||
public function __construct(string $message, bool $error) | ||
{ | ||
$this->message = $message; | ||
$this->error = $error; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMessage(): string | ||
{ | ||
return $this->message; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isError(): bool | ||
{ | ||
return $this->error; | ||
} | ||
} |
Oops, something went wrong.