Code check error: "Static method of private class must not be called"

Hi,
i’ve been trying for a long time to fix this stubborn error.

How to replace following code to make our App fully compliant to “occ app:check-code”?

<?php
namespace OCA\TuxedoRegister\AppInfo;

\OC_App::registerLogIn(
	[
		'style' => 'primary', // as of NC18
		'name' => 'Registrieren',
		'href' => \OC::$server->getURLGenerator()
			->linkToRoute('tuxedoregister.page.register')
	]
);

\OCP\Util::addStyle('tuxedoregister', 'style');

The code adds a link on the login page to our register form.

I get following error:

sudo -u apache php occ app:check-code tuxedoregister
Analysing /var/www/html/nextcloud/apps/tuxedoregister/appinfo/app.php
 1 errors
    line    4: OC_App - Static method of private class must not be called
App is not compliant

The App works fine and doesn’t create any nextcloud error logs.

There is currently no other way, but it’s okay to ignore this for the time being

1 Like

Thank you. :+1: