Page MenuHomePhabricator

Fix errors found by PHPStan
ClosedPublic

Authored by vrana on Feb 16 2017, 12:17 PM.
Tags
None
Referenced Files
F13097088: D17364.id41755.diff
Thu, Apr 25, 8:58 PM
Unknown Object (File)
Thu, Apr 25, 2:30 AM
Unknown Object (File)
Thu, Apr 25, 12:18 AM
Unknown Object (File)
Tue, Apr 23, 9:17 PM
Unknown Object (File)
Tue, Apr 23, 9:17 PM
Unknown Object (File)
Tue, Apr 23, 9:16 PM
Unknown Object (File)
Tue, Apr 23, 9:16 PM
Unknown Object (File)
Fri, Apr 19, 6:14 PM
Subscribers

Details

Test Plan

Ran phpstan analyze --autoload-file=src/__phutil_library_init__.php -c phpstan.neon -l 1 src/ with phpstan.neon containing:

parameters:
    excludes_analyse:
        - */__tests__/*

Diff Detail

Repository
rPHU libphutil
Branch
master
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/cache/PhutilAPCKeyValueCache.php:29XHP45PHP Compatibility
Errorsrc/cache/PhutilAPCKeyValueCache.php:52XHP45PHP Compatibility
Errorsrc/cache/PhutilAPCKeyValueCache.php:69XHP45PHP Compatibility
Errorsrc/cache/PhutilAPCKeyValueCache.php:85XHP45PHP Compatibility
Unit
Test Failures
Build Status
Buildable 15651
Build 20664: Run Core Tests
Build 20663: arc lint + arc unit

Unit TestsFailed

TimeTest
34 msPhutilRemarkupEngineTestCase::Unknown Unit Message ("")
Assertion failed, expected values to be equal (at PhutilRemarkupEngineTestCase.php:63): Failed to markup HTML in file 'percent-block-oneline.txt'. Expected vs Actual Output Diff --- Old Value
2 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAbstractDirectedGraphTestCase::Unknown Unit Message ("")
1 assertion passed.
View Full Test Results (1 Failed · 409 Passed · 4 Skipped)

Event Timeline

Are you on PHP7? I think the test failure might be PHP7 specific since we don't see it on the server-side tests (which run on PHP5).

The root issue behind that test failure is T10929.

src/cache/PhutilKeyValueCacheStack.php
70–73

I believe this has zero use cases, but probably fine to keep.

src/internationalization/PhutilNumber.php
8–11

This doesn't seem like a static analysis error?

This revision is now accepted and ready to land.Feb 16 2017, 12:22 PM

(I think you still have commit access, but let me know if you hit issues.)

Yes, I'm on PHP 7, PHPStan requires it.

src/internationalization/PhutilNumber.php
8–11

It's called like this from src/daemon/PhutilDaemonHandle.php and src/daemon/PhutilDaemon.php.

This revision was automatically updated to reflect the committed changes.