Skip to content

Commit

Permalink
Align tools and settings with main project release 9.1 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Oct 2, 2023
1 parent d1e8011 commit 062386c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1']
php-version: ['8.0', '8.1', '8.2']
include:
- php-version: 7.4
phing_tasks: "phpunitfast"
- php-version: 8.0
phing_tasks: "phpunitfast"
- php-version: 8.1
phing_tasks: "phpunitfast"
- php-version: 8.2
phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console"

steps:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse

### Changed

- The minimum PHP version requirement has been raised to 7.4.1.
- The minimum PHP version requirement has been raised to 8.0.

### Deprecated

Expand Down
12 changes: 0 additions & 12 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
<phingcall target="phpcs"/>
<phingcall target="phpunit"/>
<phingcall target="phpdoc"/>
<phingcall target="phpcpd"/>
<phingcall target="phpmd"/>
<phingcall target="pdepend"/>
<phingcall target="phploc"/>
<phingcall target="phpstan-checkstyle"/>
</target>

Expand All @@ -45,21 +43,11 @@
<exec command="${srcdir}/vendor/bin/phpmd ${srcdir}/src xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/tests --reportfile ${builddir}/reports/phpmd.xml" />
</target>

<!-- Measure project with phploc -->
<target name="phploc">
<exec command="${srcdir}/vendor/bin/phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/src" />
</target>

<!-- PHP_Depend code analysis -->
<target name="pdepend">
<exec command="${srcdir}/vendor/bin/pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/src" />
</target>

<!-- PHP copy-and-paste detection -->
<target name="phpcpd">
<exec command="${srcdir}/vendor/bin/phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/src" />
</target>

<!-- PHP CodeSniffer -->
<target name="phpcbf">
<exec command="${srcdir}/vendor/bin/phpcbf --standard=${srcdir}/tests/phpcs.xml" escape="false" passthru="true" checkreturn="true" />
Expand Down
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,19 @@
},
"config": {
"platform": {
"php": "7.4.1"
"php": "8.0"
}
},
"require": {
"php": ">=7.4.1"
"php": ">=8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.14.4",
"friendsofphp/php-cs-fixer": "3.26.1",
"pear/http_request2": "2.5.1",
"phploc/phploc": "7.0.2",
"phpmd/phpmd": "2.13.0",
"phpstan/phpstan": "1.10.3",
"phpunit/phpunit": "9.6.4",
"phpstan/phpstan": "1.10.34",
"phpunit/phpunit": "9.6.12",
"phing/phing": "2.17.4",
"sebastian/phpcpd": "6.0.3",
"squizlabs/php_codesniffer": "3.7.2"
}
}
3 changes: 3 additions & 0 deletions src/VuFindCode/EAN.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

namespace VuFindCode;

use function intval;
use function strlen;

/**
* EAN Class
*
Expand Down
3 changes: 3 additions & 0 deletions src/VuFindCode/ISBN.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

namespace VuFindCode;

use function intval;
use function strlen;

/**
* ISBN Class
*
Expand Down
2 changes: 2 additions & 0 deletions src/VuFindCode/ISMN.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace VuFindCode;

use function strlen;

/**
* ISMN Class
*
Expand Down
24 changes: 21 additions & 3 deletions tests/vufind.php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
->in(__DIR__ . '/../src');

$rules = [
'@PHP74Migration' => true,
'@PHP80Migration' => true,
'@PHPUnit84Migration:risky' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
Expand All @@ -17,12 +17,22 @@
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']],
'concat_space' => ['spacing' => 'one'],
'ereg_to_preg' => true,
'function_typehint_space' => true,
'get_class_to_class_keyword' => true,
'global_namespace_import' => [
'import_functions' => true,
'import_classes' => null,
],
'is_null' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'magic_constant_casing' => true,
'modernize_strpos' => true,
'native_function_casing' => true,
'native_function_invocation' => [
'strict' => true,
'scope' => 'namespaced',
],
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
Expand All @@ -31,21 +41,29 @@
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_php4_constructor' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'ordered_imports' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'phpdoc_no_access' => true,
'php_unit_method_casing' => true,
'pow_to_exponentiation' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'type_declaration_spaces' => true,
];

$cacheDir = __DIR__ . '/../.php_cs_cache';
Expand Down

0 comments on commit 062386c

Please sign in to comment.