My phpstorm reports that the following is deprecated:
$app = Factory::getApplication();
$sitename = $app->getCfg('sitename');
What is the new correct way to go for this in Joomla 4 ?
We can fix this using 2 methods,
Method 1:
use Joomla\CMS\Factory;
$app = Factory::getApplication();
$sitename = $app->getCfg('sitename');
Method 2:
$app = JFactory::getApplication();
$sitename = $app->getCfg('sitename');