-
Notifications
You must be signed in to change notification settings - Fork 28
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 #104 from mrrobot47/refactor-for-type
Refactor for --type support of ee site command
- Loading branch information
Showing
20 changed files
with
2,953 additions
and
313 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,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <galopintitouan@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Titouan Galopin <galopintitouan@gmail.com> | ||
*/ | ||
class AcmeCliActionException extends AcmeCliException | ||
{ | ||
public function __construct($actionName, \Exception $previous = null) | ||
{ | ||
parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <galopintitouan@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Titouan Galopin <galopintitouan@gmail.com> | ||
*/ | ||
class AcmeCliException extends \RuntimeException | ||
{ | ||
public function __construct($message, \Exception $previous = null) | ||
{ | ||
parent::__construct($message, 0, $previous); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <galopintitouan@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Jérémy Derussé <jeremy@derusse.com> | ||
*/ | ||
class AcmeDnsResolutionException extends AcmeCliException | ||
{ | ||
public function __construct($message, \Exception $previous = null) | ||
{ | ||
parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous); | ||
} | ||
} |
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,55 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <galopintitouan@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Jérémy Derussé <jeremy@derusse.com> | ||
*/ | ||
class CommandFlowException extends AcmeCliException | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $missing; | ||
/** | ||
* @var string | ||
*/ | ||
private $command; | ||
/** | ||
* @var array | ||
*/ | ||
private $arguments; | ||
|
||
/** | ||
* @param string $missing Missing requirement to fix the flow | ||
* @param string $command Name of the command to run in order to fix the flow | ||
* @param array $arguments Optional list of missing arguments | ||
* @param \Exception|null $previous | ||
*/ | ||
public function __construct($missing, $command, array $arguments = [], \Exception $previous = null) | ||
{ | ||
$this->missing = $missing; | ||
$this->command = $command; | ||
$this->arguments = $arguments; | ||
|
||
$message = trim(sprintf( | ||
'You have to %s first. Run the command%sphp %s %s %s', | ||
$missing, | ||
PHP_EOL.PHP_EOL, | ||
$_SERVER['PHP_SELF'], | ||
$command, | ||
implode(' ', $arguments) | ||
)); | ||
|
||
parent::__construct($message, $previous); | ||
} | ||
} |
Oops, something went wrong.