nextcloud / nextcloud-theme

Website wordpress theme for Nextcloud
GNU Affero General Public License v3.0
12 stars 4 forks source link

Add psalm configuration #7

Closed come-nc closed 2 years ago

come-nc commented 2 years ago

Signed-off-by: Côme Chilliet come.chilliet@nextcloud.com

come-nc commented 2 years ago
ERROR: UndefinedGlobalVariable - search.php:26:58 - Cannot find referenced variable $the_post in global scope (see https://psalm.dev/127)
                                                $img = wp_get_attachment_url(get_post_thumbnail_id($the_post->ID));
ERROR: UndefinedGlobalVariable - search.php:29:29 - Cannot find referenced variable $the_post in global scope (see https://psalm.dev/127)
                                                $link = get_permalink($the_post->ID);
ERROR: UndefinedGlobalVariable - single.php:12:27 - Cannot find referenced variable $the_post in global scope (see https://psalm.dev/127)
                $cat = get_the_category($the_post);

I think those $the_post variables are never defined and it works because the called wordpress functions actually take care of fetching the current post when null is passed. So once we have a testing setup we should check if removing those $the_post variables actually works and if yes remove them.