Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtamuli committed Sep 6, 2018
2 parents a3f5ba5 + 127983a commit 0ee6694
Show file tree
Hide file tree
Showing 26 changed files with 3,112 additions and 303 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
- TEST_COMMAND=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f 2) # Get command name to be tested

before_script:
- sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
- |
# Remove Xdebug for a huge performance increase:
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
Expand All @@ -33,3 +34,8 @@ notifications:
email:
on_success: never
on_failure: change

addons:
apt:
packages:
- docker-ce
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeCliActionException.php
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 <[email protected]>
*
* 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 <[email protected]>
*/
class AcmeCliActionException extends AcmeCliException
{
public function __construct($actionName, \Exception $previous = null)
{
parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous);
}
}
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeCliException.php
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 <[email protected]>
*
* 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 <[email protected]>
*/
class AcmeCliException extends \RuntimeException
{
public function __construct($message, \Exception $previous = null)
{
parent::__construct($message, 0, $previous);
}
}
23 changes: 23 additions & 0 deletions AcmePhp/Cli/Exception/AcmeDnsResolutionException.php
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 <[email protected]>
*
* 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é <[email protected]>
*/
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);
}
}
55 changes: 55 additions & 0 deletions AcmePhp/Cli/Exception/CommandFlowException.php
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 <[email protected]>
*
* 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é <[email protected]>
*/
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);
}
}
Loading

0 comments on commit 0ee6694

Please sign in to comment.