Skip to content

Commit 0ee6694

Browse files
committed
Merge branch 'develop'
2 parents a3f5ba5 + 127983a commit 0ee6694

26 files changed

+3112
-303
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
- TEST_COMMAND=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f 2) # Get command name to be tested
99

1010
before_script:
11+
- 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
1112
- |
1213
# Remove Xdebug for a huge performance increase:
1314
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
@@ -33,3 +34,8 @@ notifications:
3334
email:
3435
on_success: never
3536
on_failure: change
37+
38+
addons:
39+
apt:
40+
packages:
41+
- docker-ce
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Acme PHP project.
5+
*
6+
* (c) Titouan Galopin <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace AcmePhp\Cli\Exception;
13+
14+
/**
15+
* @author Titouan Galopin <[email protected]>
16+
*/
17+
class AcmeCliActionException extends AcmeCliException
18+
{
19+
public function __construct($actionName, \Exception $previous = null)
20+
{
21+
parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous);
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Acme PHP project.
5+
*
6+
* (c) Titouan Galopin <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace AcmePhp\Cli\Exception;
13+
14+
/**
15+
* @author Titouan Galopin <[email protected]>
16+
*/
17+
class AcmeCliException extends \RuntimeException
18+
{
19+
public function __construct($message, \Exception $previous = null)
20+
{
21+
parent::__construct($message, 0, $previous);
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Acme PHP project.
5+
*
6+
* (c) Titouan Galopin <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace AcmePhp\Cli\Exception;
13+
14+
/**
15+
* @author Jérémy Derussé <[email protected]>
16+
*/
17+
class AcmeDnsResolutionException extends AcmeCliException
18+
{
19+
public function __construct($message, \Exception $previous = null)
20+
{
21+
parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous);
22+
}
23+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Acme PHP project.
5+
*
6+
* (c) Titouan Galopin <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace AcmePhp\Cli\Exception;
13+
14+
/**
15+
* @author Jérémy Derussé <[email protected]>
16+
*/
17+
class CommandFlowException extends AcmeCliException
18+
{
19+
/**
20+
* @var string
21+
*/
22+
private $missing;
23+
/**
24+
* @var string
25+
*/
26+
private $command;
27+
/**
28+
* @var array
29+
*/
30+
private $arguments;
31+
32+
/**
33+
* @param string $missing Missing requirement to fix the flow
34+
* @param string $command Name of the command to run in order to fix the flow
35+
* @param array $arguments Optional list of missing arguments
36+
* @param \Exception|null $previous
37+
*/
38+
public function __construct($missing, $command, array $arguments = [], \Exception $previous = null)
39+
{
40+
$this->missing = $missing;
41+
$this->command = $command;
42+
$this->arguments = $arguments;
43+
44+
$message = trim(sprintf(
45+
'You have to %s first. Run the command%sphp %s %s %s',
46+
$missing,
47+
PHP_EOL.PHP_EOL,
48+
$_SERVER['PHP_SELF'],
49+
$command,
50+
implode(' ', $arguments)
51+
));
52+
53+
parent::__construct($message, $previous);
54+
}
55+
}

0 commit comments

Comments
 (0)