Skip to content

Commit 51334c0

Browse files
committed
:octocat: +phan
1 parent 496cce2 commit 51334c0

File tree

3 files changed

+65
-8
lines changed

3 files changed

+65
-8
lines changed

.phan/config.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* This configuration will be read and overlaid on top of the
4+
* default configuration. Command-line arguments will be applied
5+
* after this file is read.
6+
*/
7+
return [
8+
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`,
9+
// `'7.4'`, `null`.
10+
// If this is set to `null`,
11+
// then Phan assumes the PHP version which is closest to the minor version
12+
// of the php executable used to execute Phan.
13+
//
14+
// Note that the **only** effect of choosing `'5.6'` is to infer
15+
// that functions removed in php 7.0 exist.
16+
// (See `backward_compatibility_checks` for additional options)
17+
'target_php_version' => '7.4',
18+
19+
// A list of directories that should be parsed for class and
20+
// method information. After excluding the directories
21+
// defined in exclude_analysis_directory_list, the remaining
22+
// files will be statically analyzed for errors.
23+
//
24+
// Thus, both first-party and third-party code being used by
25+
// your application should be included in this list.
26+
'directory_list' => [
27+
'examples',
28+
'src',
29+
'tests',
30+
'vendor',
31+
],
32+
33+
// A regex used to match every file name that you want to
34+
// exclude from parsing. Actual value will exclude every
35+
// "test", "tests", "Test" and "Tests" folders found in
36+
// "vendor/" directory.
37+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
38+
39+
// A directory list that defines files that will be excluded
40+
// from static analysis, but whose class and method
41+
// information should be included.
42+
//
43+
// Generally, you'll want to include the directories for
44+
// third-party code (such as "vendor/") in this list.
45+
//
46+
// n.b.: If you'd like to parse but not analyze 3rd
47+
// party code, directories containing that code
48+
// should be added to both the `directory_list`
49+
// and `exclude_analysis_directory_list` arrays.
50+
'exclude_analysis_directory_list' => [
51+
'tests',
52+
'vendor',
53+
],
54+
];

.travis.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ language: php
22

33
matrix:
44
include:
5-
- php: 7.2
6-
- php: 7.3
7-
- php: 7.4
8-
- php: nightly
9-
allow_failures:
10-
- php: nightly
5+
- php: 7.4
116

7+
before_install:
8+
- pecl channel-update pecl.php.net
9+
- pecl install ast
1210

13-
before_script: travis_retry composer install --no-interaction --prefer-source
11+
install:
12+
- composer install --no-interaction --prefer-source
13+
- composer validate
1414

15-
script: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
15+
script:
16+
- vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
17+
- vendor/bin/phan
1618

1719
after_script: bash <(curl -s https://codecov.io/bash)

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"ext-json": "*"
2525
},
2626
"require-dev": {
27+
"phan/phan": "^2.6",
2728
"phpunit/phpunit": "^9.1"
2829
},
2930
"autoload": {

0 commit comments

Comments
 (0)