Skip to content

Commit

Permalink
Merge pull request #2 from activecollab/v2.0
Browse files Browse the repository at this point in the history
V2.0
  • Loading branch information
ilijastuden committed Jun 23, 2019
2 parents ef91d5b + e8075e5 commit a382499
Show file tree
Hide file tree
Showing 15 changed files with 1,538 additions and 840 deletions.
1 change: 1 addition & 0 deletions .php_cs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"7.1.23","version":"2.14.0","rules":{"header_comment":{"header":"This file is part of the ActiveCollab DatabaseMigration project.\n\n(c) A51 doo <info@activecollab.com>. All rights reserved.","location":"after_open"},"no_whitespace_before_comma_in_array":true,"whitespace_after_comma_in_array":true,"no_multiline_whitespace_around_double_arrow":true,"hash_to_slash_comment":true,"include":true,"trailing_comma_in_multiline_array":true,"no_leading_namespace_whitespace":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"phpdoc_scalar":true,"phpdoc_summary":true,"no_trailing_comma_in_singleline_array":true,"single_blank_line_before_namespace":true,"space_after_semicolon":true,"no_singleline_whitespace_before_semicolons":true,"cast_spaces":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trim_array_spaces":true,"no_unused_imports":true,"no_whitespace_in_blank_line":true,"ordered_imports":true,"array_syntax":{"syntax":"short"},"phpdoc_align":true,"return_type_declaration":true,"single_blank_line_at_eof":true,"single_line_after_imports":true,"single_quote":true,"blank_line_before_return":true,"class_attributes_separation":{"elements":[]},"linebreak_after_opening_tag":true,"native_function_casing":true,"no_closing_tag":true,"no_empty_comment":true,"no_empty_statement":true,"no_leading_import_slash":true,"lowercase_constants":true,"lowercase_cast":true,"lowercase_keywords":true},"hashes":{".php_cs.php":1866346194,"src\/Command\/All.php":3412155456,"src\/Command\/Base.php":1174630478,"src\/Command\/Create.php":1907230891,"src\/Command\/Up.php":1014870886,"src\/Finder\/FinderInterface.php":3110689779,"src\/Finder\/MigrationsInChangesetsFinder.php":1951028985,"src\/Migration\/Migration.php":1392706328,"src\/Migration\/MigrationInterface.php":3395347429,"src\/Migrations.php":2957768737,"src\/MigrationsInterface.php":3033229703}}
103 changes: 64 additions & 39 deletions .php_cs.php
Original file line number Diff line number Diff line change
@@ -1,50 +1,75 @@
<?php

/*
* This file is part of the Active Collab DatabaseMigrations project.
* This file is part of the ActiveCollab DatabaseMigration project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/

$header = <<<EOF
This file is part of the Active Collab DatabaseMigrations project.
$header = <<<'EOF'
This file is part of the ActiveCollab DatabaseMigration project.
(c) A51 doo <info@activecollab.com>. All rights reserved.
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

return (new Symfony\CS\Config\Config('psr2'))->fixers([
'header_comment',
'array_element_no_space_before_comma',
'array_element_white_space_after_comma',
'double_arrow_multiline_whitespaces',
'hash_to_slash_comment',
'include',
'multiline_array_trailing_comma',
'namespace_no_leading_whitespace',
'no_blank_lines_after_class_opening ',
'no_empty_lines_after_phpdocs',
'phpdoc_scalar',
'phpdoc_short_description',
'self_accessor',
'single_array_no_trailing_comma',
'single_blank_line_before_namespace',
'spaces_after_semicolon',
'spaces_before_semicolon',
'spaces_cast',
'standardize_not_equal',
'ternary_spaces',
'trim_array_spaces',
'unused_use',
'whitespacy_lines',
'ordered_use',
'short_array_syntax',
'phpdoc_params',
'-phpdoc_separation',
'-phpdoc_no_package',
'-print_to_echo',
'-concat_without_spaces',
'-empty_return',
'-join_function',
])->finder((new Symfony\CS\Finder\DefaultFinder())->in([__DIR__ . '/src', __DIR__ . '/test']));
return (new PhpCsFixer\Config('psr2'))->setRules(
[
'header_comment' => [
'header' => $header,
'location' => 'after_open',
],
'no_whitespace_before_comma_in_array' => true,
'whitespace_after_comma_in_array' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'hash_to_slash_comment' => true,
'include' => true,
'no_alias_functions' => false,
'trailing_comma_in_multiline_array' => true,
'no_leading_namespace_whitespace' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_summary' => true,
'self_accessor' => false,
'no_trailing_comma_in_singleline_array' => true,
'single_blank_line_before_namespace' => true,
'space_after_semicolon' => true,
'no_singleline_whitespace_before_semicolons' => true,
'cast_spaces' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trim_array_spaces' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'array_syntax' => ['syntax' => 'short'],
'phpdoc_align' => true,
'return_type_declaration' => true,
'single_blank_line_at_eof' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'phpdoc_separation' => false,
'phpdoc_no_package' => false,
'no_mixed_echo_print' => false,
'concat_space' => false,
'simplified_null_return' => false,
'blank_line_before_return' => true,
'class_attributes_separation' => [
'elements' => [],
],
'linebreak_after_opening_tag' => true,
'native_function_casing' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'lowercase_constants' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
]
)->setFinder((new PhpCsFixer\Finder())->in(
[
__DIR__ . '/src',
__DIR__ . '/test',
]
));
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
language: php
php:
- 5.6
- 7.0
mysql:
database: activecollab_database_migrations_test
username: root
encoding: utf8mb4
install:
- composer install --dev
- phpunit --version
- 7.1
services:
- mysql
before_install:
- composer self-update
install: composer install --dev
before_script:
- mysql -e 'create database activecollab_database_migrations_test'
script: phpunit
- mysql -u root -e 'create database activecollab_database_migrations_test'
script: php vendor/bin/phpunit
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@
}
],
"require": {
"php": ">=5.6.0",
"activecollab/databasestructure": "^0.10",
"php": ">=7.1",
"activecollab/databaseconnection": "^3.0",
"activecollab/filesystem": "^0.10",
"doctrine/inflector": "~1.0",
"psr/log": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.0",
"friendsofphp/php-cs-fixer": "^2.0",
"monolog/monolog": "^1.0",
"phpunit/phpunit": "^5.0",
"symfony/console": "^2.7"
"symfony/console": "^4.0"
},
"suggest": {
"symfony/console": "Quickly implement commands that work with migrations via CLI"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"ActiveCollab\\DatabaseMigrations\\": "src"
Expand Down
Loading

0 comments on commit a382499

Please sign in to comment.