Skip to content

Commit

Permalink
Schema 32 (#33)
Browse files Browse the repository at this point in the history
* * Added mess detector
* * Upped composer to 7.3
* * Bumped PHPUnit to version 8
* * Bumped Phan to version 2.5
* * Simplified travis
* * Coverage
  • Loading branch information
oligus authored Feb 23, 2020
1 parent 4ec72be commit f4d0c4f
Show file tree
Hide file tree
Showing 67 changed files with 1,659 additions and 2,027 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
composer.phar
/vendor/
/tests/coverage

.phpunit.result.cache
49 changes: 31 additions & 18 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,16 @@
// here to inhibit them from being reported
'suppress_issue_types' => [
'PhanUnreferencedClosure', // False positives seen with closures in arrays, TODO: move closure checks closer to what is done by unused variable plugin
'PhanPossiblyFalseTypeArgument',
'PhanPossiblyFalseTypeArgumentInternal',
'PhanPossiblyNullTypeArgument',
'PhanPossiblyNullTypeArgumentInternal',
'PhanPluginDescriptionlessCommentOnPrivateProperty',
'PhanPluginDescriptionlessCommentOnProtectedProperty',
'PhanUnreferencedUseNormal',
'PhanPluginDescriptionlessCommentOnPrivateMethod',
'PhanPluginDescriptionlessCommentOnPublicMethod'
'PhanPluginDescriptionlessCommentOnProtectedMethod',
'PhanPluginDescriptionlessCommentOnPublicMethod',
'PhanPluginDescriptionlessCommentOnPublicProperty',
'PhanPluginDescriptionlessCommentOnPrivateProperty',
'PhanPluginDescriptionlessCommentOnProtectedProperty',
'PhanPluginNoCommentOnPrivateMethod',
'PhanPluginNoCommentOnPublicMethod',
'PhanPluginNoCommentOnProtectedMethod'
],

// If empty, no filter against issues types will be applied.
Expand Down Expand Up @@ -367,27 +368,39 @@
// or relative/absolute paths to the plugin (Relative to the project root).
'plugins' => [
'AlwaysReturnPlugin',
'DemoPlugin',
'DollarDollarPlugin',
'UnreachableCodePlugin',
'DuplicateArrayKeyPlugin',
'PregRegexCheckerPlugin',
'PrintfCheckerPlugin',
// 'PHPUnitAssertionPlugin', // analyze assertSame/assertInstanceof/assertTrue/assertFalse
'UseReturnValuePlugin',

// UnknownElementTypePlugin warns about unknown types in element signatures.
'UnknownElementTypePlugin',
'DuplicateExpressionPlugin',
'NoAssertPlugin',
'HasPHPDocPlugin',
// 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
////////////////////////////////////////////////////////////////////////

// 'SleepCheckerPlugin' is useful for projects which heavily use the __sleep() method. Phan doesn't use __sleep().
// InvokePHPNativeSyntaxCheckPlugin invokes 'php --no-php-ini --syntax-check ${abs_path_to_analyzed_file}.php' and reports any error messages.
// Using this can cause phan's overall analysis time to more than double.
// 'InvokePHPNativeSyntaxCheckPlugin',
// Warns about the usage of assert() for Phan's self-analysis. See https://github.com/phan/phan/issues/288
'NoAssertPlugin',
// 'PossiblyStaticMethodPlugin',
'HasPHPDocPlugin',
'PHPDocToRealTypesPlugin', // suggests replacing (at)return void with `: void` in the declaration, etc.
'PHPDocRedundantPlugin',
'PreferNamespaceUsePlugin',
'EmptyStatementListPlugin',

// 'PHPUnitNotDeadCodePlugin', // Marks PHPUnit test case subclasses and test cases as referenced code. This is only useful for runs when dead code detection is enabled.
// Report empty (not overridden or overriding) methods and functions
'EmptyMethodAndFunctionPlugin',

// NOTE: This plugin only produces correct results when
// Phan is run on a single core (-j1).
// 'UnusedSuppressionPlugin',
// Warn about assigning the value the variable already had to that variable.
'RedundantAssignmentPlugin',
],
];
23 changes: 6 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
language: php
php:
- '7.2'

dist: xenial
sudo: required

cache:
directories:
- $HOME/.composer/cache
- '7.3'

install:
- composer install

before_script:
- sudo apt-get update -y
- sudo apt-get install -y libzip4
- mkdir -p build/logs
- .travis/setup.sh
- composer validate
- pecl install ast

script:
- vendor/bin/phpunit --coverage-clover=coverage.xml
- vendor/bin/phpcs --standard=ruleset.xml ./src
- composer test-coverage
- composer lint
- composer md
- composer analyze-noop

after_success:
- bash <(curl -s https://codecov.io/bash)
40 changes: 0 additions & 40 deletions .travis/setup.sh

This file was deleted.

8 changes: 0 additions & 8 deletions TODO.md

This file was deleted.

28 changes: 16 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@
}
],
"scripts": {
"test": "vendor/bin/phpunit --verbose",
"watch": "vendor/bin/phpunit-watcher watch",
"lint": "vendor/bin/phpcs --standard=ruleset.xml ./src",
"lint-fix": "vendor/bin/phpcbf --standard=ruleset.xml ./src",
"analyze": "vendor/bin/phan --color"
"test": "phpunit",
"test-coverage": "phpunit --coverage-clover=coverage.xml",
"test-coverage-html": "phpunit --coverage-html tests/coverage",
"lint": "phpcs src",
"lint-fix": "phpcbf src",
"md": "phpmd src text phpmd.xml",
"md-xml": "phpmd src xml phpmd.xml",
"analyze": "phan --color --progress-bar",
"analyze-noop": "phan --no-progress-bar"
},
"require": {
"php": ">=7.2",
"php": ">=7.3",
"doctrine/collections": "^1.5",
"phan/phan": "^1.1",
"myclabs/php-enum": "^1.7"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"spatie/phpunit-watcher": "^1.6",
"spatie/phpunit-snapshot-assertions": "^1.3",
"squizlabs/php_codesniffer": "^3.3",
"symfony/var-dumper": "^5.0"
"phpunit/phpunit": "^8.0",
"spatie/phpunit-snapshot-assertions": "3.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/var-dumper": "^5.0",
"phan/phan": "^2.4",
"phpmd/phpmd": "^2.8"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit f4d0c4f

Please sign in to comment.