Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@

// A list of files to include in analysis
'file_list' => [
// 'vendor/phpunit/phpunit/src/Framework/TestCase.php',
],

// A file list that defines files that will be excluded
Expand All @@ -216,7 +215,6 @@
// your application should be included in this list.
'directory_list' => [
'src',
'vendor',
],

// List of case-insensitive file extensions supported by Phan.
Expand All @@ -235,9 +233,52 @@
// should be added to the `directory_list` as
// to `exclude_analysis_directory_list`.
"exclude_analysis_directory_list" => [
'vendor',
],

// A list of plugin files to execute
'plugins' => [ ],
'plugins' => [
'AlwaysReturnPlugin',
'DollarDollarPlugin',
'UnreachableCodePlugin',
'DuplicateArrayKeyPlugin',
'PregRegexCheckerPlugin',
'PrintfCheckerPlugin',
'UseReturnValuePlugin',

// UnknownElementTypePlugin warns about unknown types in element signatures.
'UnknownElementTypePlugin',
'DuplicateExpressionPlugin',
// warns about carriage returns("\r"), trailing whitespace, and tabs in PHP files.
'WhitespacePlugin',
// Warn about inline HTML anywhere in the files.
'InlineHTMLPlugin',
////////////////////////////////////////////////////////////////////////
// Plugins for Phan's self-analysis
////////////////////////////////////////////////////////////////////////

'NoAssertPlugin',
'PossiblyStaticMethodPlugin',

// 'HasPHPDocPlugin',
'PHPDocToRealTypesPlugin', // suggests replacing (at)return void with `: void` in the declaration, etc.
'PHPDocRedundantPlugin',
'PreferNamespaceUsePlugin',
'EmptyStatementListPlugin',

// Report empty (not overridden or overriding) methods and functions
// 'EmptyMethodAndFunctionPlugin',

// This should only be enabled if the code being analyzed contains Phan plugins.
'PhanSelfCheckPlugin',
// Warn about using the same loop variable name as a loop variable of an outer loop.
'LoopVariableReusePlugin',
// Warn about assigning the value the variable already had to that variable.
'RedundantAssignmentPlugin',
// These are specific to Phan's coding style
'StrictComparisonPlugin',
// Warn about `$var == SOME_INT_OR_STRING_CONST` due to unintuitive behavior such as `0 == 'a'`
'StrictLiteralComparisonPlugin',
'ShortArrayPlugin',
'SimplifyExpressionPlugin',
],
];
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
language: php
php:
- 7.1
- 7.0
- 7.4
- 7.3
- 7.2

before_script:
- ci/install_runkit_for_php_version.sh
- composer install

script:
- php vendor/bin/phpunit tests
- vendor/bin/phan
- php -d opcache.enable=0 vendor/bin/phpunit tests
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ This requires [runkit7 (fork of the runkit PECL)](https://github.com/runkit7/run
Logging for parameters, return types, backtraces, and exceptions is enabled by default.
Code using this utility can disable or replace the default implementation to log those details.

**NOTE: When using this in recent php versions, disable opcache or opcache optimizations before running php.**

## Authors

Tyson Andre

## Requirements

- PHP version 7.0 or greater
- [runkit7 (fork of runkit)](https://github.com/runkit7/runkit7) must be installed and enabled.
- runkit must be enabled in your php.ini settings (`extension=runkit.so`)
- PHP version 7.2 or greater
- [runkit7](https://github.com/runkit7/runkit7) 3.1.0a1 or greater must be installed and enabled.
- runkit7 must be enabled in your php.ini settings (`extension=runkit7.so`)

## License

Expand Down Expand Up @@ -107,7 +109,7 @@ To attempt this, `runkit.internal_override=On` must be temporarily added to php.

-----

README.md: Copyright 2017 Ifwe Inc.
README.md: Copyright 2020 Ifwe Inc.

README.md is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"keywords": ["mocks", "debugging", "traceon", "runkit", "runkit7"],
"type": "library",
"require": {
"php": ">= 7.0",
"ext-runkit": ">=1.0.5a5"
"php": ">= 7.2",
"ext-runkit7": ">=3.1.0a1"
},
"require-dev": {
"phpunit/phpunit": "~6.2"
"phpunit/phpunit": "^7.0",
"phan/phan": "^3.1.1"
},
"autoload": {
"psr-4": {"TraceOn\\": "src/TraceOn"}
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
Expand Down
Loading