Welcome Guest, Not a member yet? Register   Sign In
Using view layouts echoes void return type.
#1

(This post was last modified: 07-11-2021, 02:21 PM by aschmitz.)

Hi,

while playing around with PHPStan I noticed that the current CI4 analysis level will complain about some basic handling of view layouts.
In the Docs it is stated that views can extend view layouts by writing:

PHP Code:
<?= $this->extend('default'?>

While this in principle is working fine and without any warning, PHPStan complains that we try to output the return value of a method that has a void return type.

Now I know we specifically exclude the 'views' folder in static analysis, however, I feel that PHPStan is correct here.

The correct implementation would be:

PHP Code:
<?php $this->extend('default'?>

I personally feel, that sparing the two characters is not really worth the inconsistency here.

How do others feel about that?
Reply


Messages In This Thread
Using view layouts echoes void return type. - by aschmitz - 07-11-2021, 02:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB