Skip to content

Commit

Permalink
Modernization
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Oct 9, 2018
1 parent 1edfaca commit e08dd7a
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 62 deletions.
99 changes: 76 additions & 23 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,80 @@
<?php

return Symfony\CS\Config\Config::create()
->fixers(
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'-concat_without_spaces',
'-empty_return',
'-phpdoc_no_empty_return',
'-phpdoc_params',
'-phpdoc_to_comment',
'-single_array_no_trailing_comma',
'concat_with_spaces',
'ereg_to_preg',
'multiline_spaces_before_semicolon',
'ordered_use',
'short_array_syntax',
'strict',
'strict_param',
'-psr0', // Bugged XmlDSigTest to lowercase change
]
'@PHP71Migration' => true,
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => true,
'concat_space' => [
'spacing' => 'one',
],
'declare_strict_types' => true,
'dir_constant' => true,
'ereg_to_preg' => true,
'general_phpdoc_annotation_remove' => [
'expectedException',
'expectedExceptionMessage',
'expectedExceptionMessageRegExp',
],
'hash_to_slash_comment' => true,
'heredoc_to_nowdoc' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'method_separation' => true,
'modernize_types_casting' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_short_bool_cast' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_construct' => true,
'php_unit_dedicate_assert' => true,
'php_unit_fqcn_annotation' => true,
'php_unit_strict' => false,
'phpdoc_indent' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'pre_increment' => true,
'psr4' => true,
'self_accessor' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'strict_comparison' => true,
'strict_param' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder(PhpCsFixer\Finder::create()
->in('src')
->in('test')
)
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->in('src')
->in('test')
)
;
;
30 changes: 17 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,36 @@ language: php
cache:
directories:
- $HOME/.composer/cache
- vendor

matrix:
fast_finish: true
include:
- php: 5.4
- php: 5.5
- php: 7.0
env:
- EXECUTE_CS_CHECK=true
- php: 5.6
- COMPOSER_ARGUMENTS=--prefer-lowest
- php: 7.0
env:
- EXECUTE_TEST_COVERALLS=true
- php: 7
- php: hhvm
- php: 7.2
env:
- EXECUTE_CS_CHECK=true

before_install:
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0; fi
- travis_retry composer self-update
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:dev-master; fi

install:
- travis_retry composer install --no-interaction
- travis_retry composer update --no-interaction $COMPOSER_ARGUMENTS
- composer info -i

script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml tests; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then vendor/bin/phpunit tests; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then vendor/bin/php-cs-fixer fix -v --dry-run; fi

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls; fi
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar;
chmod +x coveralls.phar;
php coveralls.phar -v;
fi
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012, Maks3w
Copyright (c) 2018, Maks3w
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
22 changes: 10 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
{
"name": "fr3d/xmldsig",
"description": "Tool for easy management of XML Signatures (http://www.w3.org/TR/xmldsig-core/)",
"license": "BSD-2-Clause",
"keywords": [
"xml",
"xmldsig",
"signature",
"security",
"soap"
],
"authors": [
{
"name": "Maks3w",
"email": "[email protected]"
}
],
"license": "BSD-2-Clause",
"homepage": "https://github.com/Maks3w/xmldsig/",
"require": {
"robrichards/xmlseclibs": "^2.0"
"php": ">= 7.0",
"ext-dom": "*",
"ext-soap": "*",
"robrichards/xmlseclibs": "^3.0"
},
"require-dev": {
"fabpot/php-cs-fixer": "1.10.*",
"phpunit/phpunit": "^4.0"
"friendsofphp/php-cs-fixer": "^2.0",
"phpunit/phpunit": "^6.0",
"sensiolabs/security-checker": "^5.0"
},
"autoload": {
"psr-4": {
"FR3D\\XmlDSig\\": ["src"]
"FR3D\\XmlDSig\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"FR3D\\XmlDSigTest\\": ["test"]
"FR3D\\XmlDSig\\": "test"
}
}
}
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<phpunit bootstrap="vendor/autoload.php"
colors="true"
forceCoversAnnotation="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd">
<testsuites>
<testsuite name="library">
<directory suffix="Test.php">./test</directory>
Expand Down
2 changes: 2 additions & 0 deletions src/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace FR3D\XmlDSig\Adapter;

use DOMDocument;
Expand Down
2 changes: 2 additions & 0 deletions src/Adapter/XmlseclibsAdapter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace FR3D\XmlDSig\Adapter;

use DOMDocument;
Expand Down
2 changes: 2 additions & 0 deletions src/Soap/SoapClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace FR3D\XmlDSig\Soap;

use DOMDocument;
Expand Down
7 changes: 4 additions & 3 deletions test/Adapter/AdapterInterfaceTestTrait.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace FR3D\XmlDSigTest\Adapter;
declare(strict_types=1);

namespace FR3D\XmlDSig\Adapter;

use DOMDocument;
use DOMXPath;
use FR3D\XmlDSig\Adapter\AdapterInterface;
use PHPUnit_Framework_Assert as Assert;
use PHPUnit\Framework\Assert;
use RuntimeException;

/**
Expand Down
7 changes: 4 additions & 3 deletions test/Adapter/XmlseclibsAdapterTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace FR3D\XmlDSigTest\Adapter;
declare(strict_types=1);

use FR3D\XmlDSig\Adapter\XmlseclibsAdapter;
use PHPUnit_Framework_TestCase as TestCase;
namespace FR3D\XmlDSig\Adapter;

use PHPUnit\Framework\TestCase;

/**
* Test suite for Xmlseclibs adapter.
Expand Down
7 changes: 4 additions & 3 deletions test/Soap/SoapClientTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace FR3D\XmlDSigTest\Soap;
declare(strict_types=1);

namespace FR3D\XmlDSig\Soap;

use DOMDocument;
use FR3D\XmlDSig\Adapter\XmlseclibsAdapter;
use FR3D\XmlDSig\Soap\SoapClient;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

/**
* Test suite for SoapClient.
Expand Down

0 comments on commit e08dd7a

Please sign in to comment.