Skip to content

Bump phan to 1.3.5 and enable on PHP 7.2 7.3#35817

Closed
phil-davis wants to merge 3 commits intomasterfrom
php-phan-20190711
Closed

Bump phan to 1.3.5 and enable on PHP 7.2 7.3#35817
phil-davis wants to merge 3 commits intomasterfrom
php-phan-20190711

Conversation

@phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jul 12, 2019

Description

  • bump phan to 1.3.5 (the latest version 1 release)
  • fix the list of PhanUndeclaredMethod that it now reports
  • enable phan again on PHP 7.2 and 7.3 (because 1.3.5 works!)

Some references:
https://github.com/phan/phan/wiki/Annotating-Your-Source-Code
https://www.mediawiki.org/wiki/Continuous_integration/Phan - see "Known Problems" section at end
wikimedia/mediawiki-libs-Zest@a702451#diff-5fc3458bed5c0e0a0872b333c9564a1eR302 - some examples

phan 1.3.5 reported lots of PhanUndeclaredMethod
For many of these, it just does not understand the @var in-line docblock, so it does not know accurately what is the class of the object. Because phan parses the AST it needs information that gets to the AST. For that, I use @phan-var to tell it the object class. Often it was very easy, because there was already a doc-block style declaration to copy from - e.g. https://github.com/owncloud/core/pull/35817/files#diff-b1ad5b2a5860ff4172069616cfc3df01R63

For others, I had to sort out what particular class is in place at the time.

In some places the code looks dodgy, so I put a "ToDo" or "FixMe" comment and @phan-suppress-next-line PhanUndeclaredMethod so we can get this passing and a developer can come back to those and see what needs to be done.

Related Issue

#35697

Motivation and Context

Get phan working again on PHP 7.2 and 7.3
Have a later version of phan to catch more stuff more reliably.

How Has This Been Tested?

Local make test-php-phan

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@phil-davis
Copy link
Contributor Author

Backport stable10 #35818

@phil-davis
Copy link
Contributor Author

@patrickjahns @DeepDiver1975 or somebody, please review.

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #35817 into master will decrease coverage by <.01%.
The diff coverage is 48.93%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35817      +/-   ##
============================================
- Coverage      65.8%    65.8%   -0.01%     
- Complexity    18760    18819      +59     
============================================
  Files          1229     1228       -1     
  Lines         70856    71010     +154     
  Branches       1289     1289              
============================================
+ Hits          46626    46726     +100     
- Misses        23852    23906      +54     
  Partials        378      378
Flag Coverage Δ Complexity Δ
#javascript 53.7% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 67.18% <48.93%> (-0.01%) 18819 <0> (+59)
Impacted Files Coverage Δ Complexity Δ
lib/public/AppFramework/OCSController.php 95.45% <ø> (ø) 14 <0> (ø) ⬇️
core/Command/Maintenance/Mimetype/UpdateDB.php 100% <ø> (ø) 9 <0> (ø) ⬇️
apps/dav/lib/Upload/ChunkingPluginZsync.php 100% <ø> (ø) 16 <0> (ø) ⬇️
lib/private/Group/Manager.php 90.16% <ø> (ø) 77 <0> (ø) ⬇️
apps/dav/lib/CardDAV/ImageExportPlugin.php 98.18% <ø> (ø) 20 <0> (ø) ⬇️
lib/private/legacy/helper.php 74.18% <ø> (ø) 117 <0> (ø) ⬇️
lib/private/Files/Filesystem.php 67.36% <ø> (ø) 127 <0> (ø) ⬇️
lib/private/Console/Application.php 0% <ø> (ø) 23 <0> (ø) ⬇️
lib/private/legacy/defaults.php 59.25% <ø> (ø) 45 <0> (ø) ⬇️
lib/private/legacy/files.php 0% <ø> (ø) 68 <0> (ø) ⬇️
... and 96 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a44cc13...eed6a97. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #35817 into master will decrease coverage by 1.4%.
The diff coverage is 47.82%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35817      +/-   ##
============================================
- Coverage     67.18%   65.78%   -1.41%     
- Complexity    18760    18765       +5     
============================================
  Files          1168     1229      +61     
  Lines         63575    70888    +7313     
  Branches          0     1289    +1289     
============================================
+ Hits          42716    46633    +3917     
- Misses        20859    23877    +3018     
- Partials          0      378     +378
Flag Coverage Δ Complexity Δ
#javascript 53.7% <ø> (?) 0 <ø> (?)
#phpunit 67.16% <47.82%> (-0.03%) 18765 <0> (+5)
Impacted Files Coverage Δ Complexity Δ
lib/public/AppFramework/OCSController.php 95.45% <ø> (ø) 14 <0> (ø) ⬇️
core/Command/Maintenance/Mimetype/UpdateDB.php 100% <ø> (ø) 9 <0> (ø) ⬇️
apps/dav/lib/Upload/ChunkingPluginZsync.php 100% <ø> (ø) 16 <0> (ø) ⬇️
lib/private/Group/Manager.php 90.16% <ø> (ø) 77 <0> (ø) ⬇️
apps/dav/lib/CardDAV/ImageExportPlugin.php 98.18% <ø> (ø) 20 <0> (ø) ⬇️
lib/private/legacy/helper.php 74.18% <ø> (ø) 117 <0> (ø) ⬇️
lib/private/Files/Filesystem.php 67.36% <ø> (ø) 127 <0> (ø) ⬇️
lib/private/Console/Application.php 0% <ø> (ø) 23 <0> (ø) ⬇️
lib/private/legacy/defaults.php 59.25% <ø> (ø) 45 <0> (ø) ⬇️
lib/private/legacy/files.php 0% <ø> (ø) 68 <0> (ø) ⬇️
... and 138 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ec7365...bbb73f2. Read the comment docs.

@phil-davis
Copy link
Contributor Author

phil-davis commented Jul 30, 2019

This got stupid javascript error in the first drone job. Most webUI tests also fail - seems to be some JavaScript missing (not loading properly)

There seems to be something wrong with the core master dependency cache again?

@phil-davis
Copy link
Contributor Author

Closing this. The stable10 -> master branch switching can happen. Then probably the "backport" PR #35818 will be the best one to use to get this happening again.

@phil-davis phil-davis closed this Jul 30, 2019
@phil-davis phil-davis deleted the php-phan-20190711 branch June 18, 2020 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant