Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
- require php >=7.4
- require phpstan ^1.11
  - deal with deprecated TypeUtils::*
  • Loading branch information
ebln committed Jun 2, 2024
1 parent 8690f7a commit cdaf26d
Show file tree
Hide file tree
Showing 7 changed files with 1,540 additions and 842 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-20.04 ]
php: [ '7.3', '7.4', '8.0' ]
operating-system: [ ubuntu-latest ]
php: [ '7.4', '8.0' ]
name: Build and test on ${{ matrix.php }}
steps:
- name: Checkout repository
Expand Down
67 changes: 40 additions & 27 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,50 @@
->in(__DIR__);

$rules = [
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit75Migration:risky' => true,
'@PHP71Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'phpdoc_summary' => false,
'cast_spaces' => ['space' => 'none'],
'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal']],
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']],
'phpdoc_to_comment' => false,
'native_constant_invocation' => false,
'fully_qualified_strict_types' => false,
'@PER-CS' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PHPUnit100Migration:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP82Migration' => true,
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => ['comment_types' => [ /* 'hash' */],],
'phpdoc_summary' => false,
'cast_spaces' => ['space' => 'none'],
'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal_by_scope']],
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']],
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'nullable_type_declaration_for_default_null_value' => true,
'phpdoc_line_span' => ['const' => 'single', 'method' => 'single', 'property' => 'single'],
'simplified_null_return' => true,
'statement_indentation' => true,
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'require', 'require_once', 'return', 'switch']],
'simplified_if_return' => true,
'use_arrow_functions' => false,
'fully_qualified_strict_types' => false,
'phpdoc_to_comment' => false,
];
if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
$rules['@PHP73Migration'] = true;
}

$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)
->setRules($rules)
->setFinder($finder);
->setFinder($finder)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());

if (false) {
$resolver = new \PhpCsFixer\Console\ConfigurationResolver($config, [], '', new \PhpCsFixer\ToolInfo());
echo "\n\n# DUMPING EFFECTIVE RULES #################\n";
var_export($resolver->getRules());
echo "\n\n###########################################\n";

die();
}

return $config;
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

10 changes: 2 additions & 8 deletions .provision/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,15 @@ RUN apt-get update \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /tmp/pear/* \
&& groupadd --gid 1000 app \
&& useradd --uid 1000 --gid app --shell /bin/bash --create-home app \
&& touch /var/log/xdebug.log && chgrp 1000 /var/log/xdebug.log && chmod g+w /var/log/xdebug.log \
&& sed -i -e '/alias l\|export\|eval/s/#//' /root/.bashrc \
&& mkdir --parents /var/www/src /var/www/tests \
&& chown 1000:1000 /var/www/src /var/www/tests \
&& true
COPY 30-xdebug-config.ini /usr/local/etc/php/conf.d/

USER app

ENV PATH "$PATH:/home/app/.composer/vendor/bin"
ENV PATH "$PATH:/root/.composer/vendor/bin"

RUN composer global require friendsofphp/php-cs-fixer \
&& sed -i -e '/alias l\|export\|eval/s/#//' /home/app/.bashrc
&& sed -i -e '/alias l\|export\|eval/s/#//' /root/.bashrc

# WORKDIR /home/app/ # TODO app dir or var/www !?
WORKDIR /var/www/
31 changes: 17 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "ebln/phpstan-factory-rule",
"type": "phpstan-extension",
"description": "PHPStan rule to enforce instanciation by factories",
"license": "MIT",
"type": "phpstan-extension",
"authors": [
{
"name": "ebln",
"email": "[email protected]"
}
],
"require": {
"php": "7.3 - 8.2",
"ebln/phpstan-factory-mark": "^1.0",
"phpstan/phpstan": "^0.12 || ^1"
"php": "7.4 - 8.2",
"ebln/phpstan-factory-mark": "^1.1",
"phpstan/phpstan": "^1.11"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.15",
Expand All @@ -21,16 +21,6 @@
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "^4.12"
},
"config": {
"sort-packages": true
},
"extra": {
"phpstan": {
"includes": [
"rules.neon"
]
}
},
"autoload": {
"psr-4": {
"Ebln\\PHPStan\\EnforceFactory\\": "src/"
Expand All @@ -41,6 +31,19 @@
"Test\\Ebln\\PHPStan\\EnforceFactory\\": "tests/"
}
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
},
"sort-packages": true
},
"extra": {
"phpstan": {
"includes": [
"rules.neon"
]
}
},
"scripts": {
"coverage": "XDEBUG_MODE=coverage phpunit --coverage-html coverage --coverage-text --colors=auto && chown -R 1000:1000 coverage",
"quality": [
Expand Down
Loading

0 comments on commit cdaf26d

Please sign in to comment.