Skip to content

Commit

Permalink
Ran PHP-CS-FIXER
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Custiel committed Apr 27, 2016
1 parent b042b66 commit f64bade
Show file tree
Hide file tree
Showing 18 changed files with 4,508 additions and 74 deletions.
12 changes: 5 additions & 7 deletions bin/phiremock
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
}

use Doctrine\Common\Annotations\AnnotationRegistry;
use Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer;
use Mcustiel\Phiremock\Server\Config\Dependencies;
use Mcustiel\DependencyInjection\DependencyInjectionService;

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
$options = CommandLine::parseArgs($argv);
Expand All @@ -29,8 +27,8 @@ $di = Dependencies::init();
$logger = $di->get('logger');
$logger->info('Starting Phiremock...');

$expectationsDir = isset($options['e'])
? realpath($options['e'])
$expectationsDir = isset($options['e'])
? realpath($options['e'])
: $di->get('homePathService')->getHomePath() . DIRECTORY_SEPARATOR . '.phiremock/expectations';

$logger->debug("Phiremock's expectation dir: $expectationsDir");
Expand All @@ -43,16 +41,16 @@ $server = $di->get('server');
$server->setRequestHandler($di->get('application'));

$handleTermination = function ($signal = 0) use ($server, $logger) {
$logger->info('Stopping Phiremock...');
$logger->info('Stopping Phiremock...');
$server->shutdown();
$logger->info('Bye bye');
};

register_shutdown_function($handleTermination);

if (function_exists('pcntl_signal')) {
pcntl_signal(SIGTERM, $handleTermination);
pcntl_signal(SIGABRT, $handleTermination);
pcntl_signal(SIGTERM, $handleTermination);
pcntl_signal(SIGABRT, $handleTermination);
}

$server->listen($port, $interface);
Loading

0 comments on commit f64bade

Please sign in to comment.