Skip to content

Commit

Permalink
Merge pull request #619 from nicolasmure/fix/apply-cs-fix-on-1.x
Browse files Browse the repository at this point in the history
merge master on 1.x and apply cs fix on 1.x
  • Loading branch information
nicolasmure authored Jul 1, 2019
2 parents 15d250c + 776b261 commit a18a6f7
Show file tree
Hide file tree
Showing 53 changed files with 606 additions and 568 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
20 changes: 10 additions & 10 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ AWS_KEY=
AWS_SECRET=
AWS_BUCKET=

AZURE_ACCOUNT=
AZURE_KEY=
AZURE_CONTAINER=

FTP_HOST=ftp
FTP_PORT=21
FTP_USER=gaufrette
FTP_PASSWORD=gaufrette
FTP_BASE_DIR=/gaufrette

# see /doc/adapters/google-cloud-storage.md
GCS_PROJECT_ID=
GCS_BUCKET_NAME=
Expand All @@ -28,13 +38,3 @@ SFTP_PORT=22
SFTP_USER=gaufrette
SFTP_PASSWORD=gaufrette
SFTP_BASE_DIR=gaufrette

FTP_HOST=ftp
FTP_PORT=21
FTP_USER=gaufrette
FTP_PASSWORD=gaufrette
FTP_BASE_DIR=/gaufrette

AZURE_ACCOUNT=
AZURE_KEY=
AZURE_CONTAINER=
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
bin/*
!bin/tests
!bin/tests-all
composer.lock
doc/.couscous
tests/adapters/*
!tests/adapters/*.dist
vendor/
.env
composer.lock
.php_cs.cache
phpunit.xml
secrets/
tests/adapters/*
!tests/adapters/*.dist
vendor/
41 changes: 41 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

return PhpCsFixer\Config::create()
->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
)
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'binary_operator_spaces' => [ 'align_equals' => false, 'align_double_arrow' => false ],
'blank_line_before_statement' => true,
'cast_spaces' => true,
'combine_consecutive_unsets' => true,
'concat_space' => [ 'spacing' => 'one' ],
'linebreak_after_opening_tag' => true,
'method_argument_space' => ['ensure_fully_multiline' => false],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_break_comment' => false,
'no_extra_consecutive_blank_lines' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'PedroTroller/phpspec' => true,
'phpdoc_indent' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'single_quote' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
])
->registerCustomFixers(new PedroTroller\CS\Fixer\Fixers())
;
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ install:
- composer update --prefer-dist --no-progress --no-suggest --ansi

script:
- php vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none --verbose
- php vendor/bin/phpspec run -fpretty --verbose
- find tests/ -name "*Test.php" | vendor/bin/fastest -vvv "vendor/bin/phpunit --verbose {};"
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ tests:
.PHONY: clear-deps
clear-deps:
rm -rf vendor/ composer.lock

.PHONY: php-cs-compare
php-cs-compare:
docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix \
--diff \
--dry-run \
--show-progress=none \
--verbose

.PHONY: php-cs-fix
php-cs-fix:
docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ $ make clear-deps
$ PHP_VERSION=<the_version_you_want_to_use> make build install-deps
```

5) Apply Coding Standards

You should check for CS violations by using
```bash
$ make php-cs-compare
```
and fix them with
```bash
$ make php-cs-fix
```

### Note

This project does not have any stable release yet but we do not want to break BC now.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"akeneo/phpspec-skip-example-extension": "^4.0",
"liuggio/fastest": "^1.6",
"google/cloud-storage": "~1.0",
"php-opencloud/openstack": "~3.0.0"
"php-opencloud/openstack": "~3.0.0",
"pedrotroller/php-cs-custom-fixer": "^2.17"
},
"suggest": {
"knplabs/knp-gaufrette-bundle": "to use with Symfony",
Expand Down
29 changes: 1 addition & 28 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,7 @@
stopOnFailure="false"
bootstrap="vendor/autoload.php"
>

<php>
<!-- Parameters for GridFS adapter -->
<!--<env name="MONGO_URI" value="mongodb://localhost:27017" />
<env name="MONGO_DBNAME" value="gridfs_test" />-->

<!-- Configuration for AwsS3 adapter -->
<!--<env name="AWS_KEY" value="" />
<env name="AWS_SECRET" value="" />
<env name="AWS_BUCKET" value="" />-->

<!-- Configuration for PhpseclibSftp adapter -->
<!--<env name="SFTP_HOST" value="" />
<env name="SFTP_PORT" value="" />
<env name="SFTP_USER" value="" />
<env name="SFTP_PASSWORD" value="" />-->

<!-- Configuration for Ftp adapter -->
<!--<env name="FTP_HOST" value="" />
<env name="FTP_USER" value="" />
<env name="FTP_PASSWORD" value="" />
<env name="FTP_BASE_DIR" value="" />-->

<!-- Configuration for Azure adapter -->
<!--<env name="AZURE_ACCOUNT" value="" />
<env name="AZURE_KEY" value="" />
<env name="AZURE_CONTAINER" value="" />-->
</php>
<!-- The env vars are defined in the .env file -->

<testsuites>
<testsuite name="Gaufrette Test Suite">
Expand Down
6 changes: 3 additions & 3 deletions spec/Gaufrette/Adapter/AzureBlobStorage/BlobProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

namespace spec\Gaufrette\Adapter\AzureBlobStorage;

use PHPSpec2\ObjectBehavior;
use PhpSpec\ObjectBehavior;

class BlobProxyFactory extends ObjectBehavior
{
/**
* @param string $connectionString
*/
public function let($connectionString)
function let($connectionString)
{
$this->beConstructedWith($connectionString);
}

public function it_should_be_initializable()
function it_should_be_initializable()
{
$this->shouldHaveType('Gaufrette\Adapter\AzureBlobStorage\BlobProxyFactory');
$this->shouldHaveType('Gaufrette\Adapter\AzureBlobStorage\BlobProxyFactoryInterface');
Expand Down
Loading

0 comments on commit a18a6f7

Please sign in to comment.