ci.yml, what does "...is missing a return type" mean?

ci.yml, what does "...is missing a return type" mean?

Howard Miller發表於
Number of replies: 7
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

I updated my ci.yml scripts to the latest version and some odd stuff is now going on. One thing  I've not been able to resolve...

"Test method test_blah_blah() is missing a return type"

In unit tests. Obviously, unit test methods don't have a return type. Does anybody know what it is asking me to change?

評比平均分數: -
In reply to Howard Miller

Re: ci.yml, what does "...is missing a return type" mean?

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Ok - answering my own question - the test function now seems to require an explicit return type of void. That is...

function test_something(): void {}

The script also insists that the class is qualified as 'final'. None of this is reflected in the PHPUnit documentation (that I can find) 傷心
In reply to Howard Miller

Re: ci.yml, what does "...is missing a return type" mean?

Andrew Lyons發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
This is in preparation for PHPUnit 10.

Whilst some of these things are not specifically required for PHPUnit 10, they do actively prevent issues and promote better code.

These are mostly auto-fixable using phpcs/phpcbf.
評比平均分數:Useful (1)
In reply to Andrew Lyons

Re: ci.yml, what does "...is missing a return type" mean?

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Thanks Andrew,

"These are mostly auto-fixable using phpcs/phpcbf"

I have no clue what this is. Any links/hints?
In reply to Howard Miller

Re: ci.yml, what does "...is missing a return type" mean?

Renaat Debleu發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片
The only thing you have to do to get those errors fixed, is running phpcbf in the root directory of your Moodle installation:
 
php moodle-plugin-ci.phar phpcbf path/to/your/plugin
 
 
In reply to Renaat Debleu

Re: ci.yml, what does "...is missing a return type" mean?

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Renaat

I'm possibly being stupid but there's no file called moodle-plugin-ci.phar in my installation. Where does that come from?
 
I think you're all probably thinking that I know about something that I clearly don't 大笑
In reply to Howard Miller

Re: ci.yml, what does "...is missing a return type" mean?

Renaat Debleu發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片
Have a look at https://moodlehq.github.io/moodle-plugin-ci/ to use moodle-plugin-ci locally.
評比平均分數:Useful (1)