Skip to content

Commit

Permalink
Merge branch 'pull/14'
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Mar 31, 2018
2 parents b85e768 + b1b9643 commit ae3b72f
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 167 deletions.
40 changes: 15 additions & 25 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
<?php

$fileHeaderComment = <<<COMMENT
This file is part of the EasyDeploy project.
(c) Javier Eguiluz <javier.eguiluz@gmail.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->ignoreDotFiles(true)
->ignoreVCS(true)
->exclude(array('doc', 'vendor'))
->files()
->name('*.php')
;

return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'mb_str_functions' => true,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'binary_operator_spaces' => array(
'align_double_arrow' => false,
),
'combine_consecutive_unsets' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'pow_to_exponentiation' => true,
'random_api_migration' => true,
'return_type_declaration' => ['space_before' => 'one'],
'semicolon_after_instruction' => true,
'phpdoc_summary' => false,
'strict_comparison' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
])
->setCacheFile(__DIR__.'/.php_cs.cache')
;
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: php

sudo: false

git:
depth: 1

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true
include:
- php: nightly
env:
- SYMFONY_VERSION="dev-master"
- CHECK_PHP_SYNTAX="no"
- php: 7.1
env:
- SYMFONY_VERSION="3.2.*"
- CHECK_PHP_SYNTAX="yes"
allow_failures:
- php: nightly

before_install:
- stty cols 120
- INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo memory_limit = -1 >> $INI_FILE
- echo session.gc_probability = 0 >> $INI_FILE
- echo opcache.enable_cli = 1 >> $INI_FILE
- rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- composer self-update
- if [[ "$SYMFONY_VERSION" != "" ]]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;

install:
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then composer require --dev --no-update friendsofphp/php-cs-fixer; fi;
- composer update --prefer-dist --no-interaction --no-suggest --no-progress --ansi

script:
- vendor/bin/phpunit
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then php vendor/bin/php-cs-fixer --no-interaction --dry-run --diff -v fix; fi;
2 changes: 1 addition & 1 deletion src/Command/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$deployer->doDeploy();
}

private function createDefaultConfigFile(InputInterface $input, OutputInterface $output, string $defaultConfigPath, string $stageName) : void
private function createDefaultConfigFile(InputInterface $input, OutputInterface $output, string $defaultConfigPath, string $stageName): void
{
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion(sprintf("\n<bg=yellow> WARNING </> There is no config file to deploy '%s' stage.\nDo you want to create a minimal config file for it? [Y/n] ", $stageName), true);
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/AbstractConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ public function useSshAgentForwarding(bool $useIt)
$this->useSshAgentForwarding = $useIt;
}

abstract protected function getReservedServerProperties() : array;
abstract protected function getReservedServerProperties(): array;
}
4 changes: 2 additions & 2 deletions src/Configuration/ConfigurationAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(AbstractConfiguration $config)
$this->config = $config;
}

public function __toString() : string
public function __toString(): string
{
return Str::formatAsTable($this->getOptions()->all());
}
Expand All @@ -44,7 +44,7 @@ public function get(string $optionName)
return $this->getOptions()->get($optionName);
}

private function getOptions() : ParameterBag
private function getOptions(): ParameterBag
{
if (null !== $this->options) {
return $this->options;
Expand Down
6 changes: 3 additions & 3 deletions src/Configuration/CustomConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CustomConfiguration extends AbstractConfiguration
{
// this proxy method is needed because the autocompletion breaks
// if the parent method is used directly
public function server(string $sshDsn, array $roles = [Server::ROLE_APP], array $properties = []) : self
public function server(string $sshDsn, array $roles = [Server::ROLE_APP], array $properties = []): self
{
parent::server($sshDsn, $roles, $properties);

Expand All @@ -30,14 +30,14 @@ public function server(string $sshDsn, array $roles = [Server::ROLE_APP], array

// this proxy method is needed because the autocompletion breaks
// if the parent method is used directly
public function useSshAgentForwarding(bool $useIt) : self
public function useSshAgentForwarding(bool $useIt): self
{
parent::useSshAgentForwarding($useIt);

return $this;
}

protected function getReservedServerProperties() : array
protected function getReservedServerProperties(): array
{
return [];
}
Expand Down
Loading

0 comments on commit ae3b72f

Please sign in to comment.