owncloud / announcementcenter

:loudspeaker: Announcement Center for ownCloud
GNU Affero General Public License v3.0
13 stars 7 forks source link

Investigate phan error report #113

Open phil-davis opened 5 years ago

phil-davis commented 5 years ago

After PR #112 implements phan it is reporting:

make test-php-phan
php -d zend.enable_gc=0 vendor-bin/phan/vendor/bin/phan --config-file .phan/config.php --require-config-exists
[info] Disabling xdebug: Phan is around five times as slow when xdebug is enabled (xdebug only makes sense when debugging Phan itself)
[info] To run Phan with xdebug, set the environment variable PHAN_ALLOW_XDEBUG to 1.
[info] To disable this warning, set the environment variable PHAN_DISABLE_XDEBUG_WARN to 1.
[info] To include function signatures of xdebug, see .phan/internal_stubs/xdebug.phan_php
[debug] Checking PHAN_ALLOW_XDEBUG
[debug] The xdebug extension is loaded (2.6.1)
[debug] Process restarting (PHAN_ALLOW_XDEBUG=internal|2.6.1|1|*|*)
[debug] Running '/usr/bin/php7.1' '-n' '-c' '/tmp/VH72lx' 'vendor-bin/phan/vendor/bin/phan' '--config-file' '.phan/config.php' '--require-config-exists'
lib/Activity/Extension.php:100 PhanTypeMismatchArgument Argument 1 (id) is string but \OCA\AnnouncementCenter\Manager::getAnnouncement() takes int defined at lib/Manager.php:110
lib/Notification/Notifier.php:77 PhanTypeMismatchArgument Argument 1 (id) is string but \OCA\AnnouncementCenter\Manager::getAnnouncement() takes int defined at lib/Manager.php:110
[debug] Restarted process exited 1
Makefile:133: recipe for target 'test-php-phan' failed
make: *** [test-php-phan] Error 1

announcementcenter seems to be expecting the "announcement id" to always be int. But notifications classes/methods allow string.

Investigate and sort out.

phil-davis commented 5 years ago

@PVince81 how/who deals with this sort of thing?

Note: phan is not running in CI (because it would fail), but all the infrastructure is there so a developed can locally make test-php-phan and see the result.