language: php
sudo: false

cache:
  directories:
    - $HOME/.composer/cache/files

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - 7.2

matrix:
  include:
    - php: 5.3
      dist: precise
    - php: 7.1
      env: PHPSTAN=1

before_script:
  - travis_retry composer install --prefer-source --quiet --no-interaction
  - if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.9; fi

script:
  - composer lint
  - if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -c phpstan.neon -l 4 getid3; fi
