LoginSignup
0
0

More than 5 years have passed since last update.

Scrutinizerのphpunitが失敗するようになった

Posted at

設定は特に変えていないのにあれれ?

PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' 
in /home/scrutinizer/.composer/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php on line 63

Scrutinizerの現状の設定はこちら

checks:
    php: true
filter:
    excluded_paths:
        - Resources/*
        - Tests/*
coding_style:
    php:
        spaces:
            around_operators:
                concatenation: false
build:
    tests:
        override:
            -
                command: 'phpunit --coverage-clover=coverage.clover'
                idle_timeout: 600
                coverage:
                    file: 'coverage.clover'
                    format: 'php-clover'

エラーの該当箇所を見てみると
https://github.com/phpDocumentor/ReflectionDocBlock/blob/3.1.0/src/DocBlock.php#L63

ということでphpunitを実行しているphpのバージョンが古かったのが原因。
特に何も指定しないと5.4.41で実行される。
5.5以上になるように設定を追加する。

build:
    environment:
        php: '5.5.25'

これでphpunitが動くようになった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0