XF 2.0 getting error while extending the member class dev doc

lovnesh

Member
ErrorException: [E_WARNING] Declaration of Demo\XF\Pub\Controller\Member::actionIndex() should be compatible with XF\Pub\Controller\Member::actionIndex(XF\Mvc\ParameterBag $params) in src\addons\Demo\XF\Pub\Controller\Member.php at line 13
  1. XF::handlePhpError() in src\vendor\composer\ClassLoader.php at line 444
  2. include() in src\vendor\composer\ClassLoader.php at line 444
  3. Composer\Autoload\includeFile() in src\vendor\composer\ClassLoader.php at line 322
  4. Composer\Autoload\ClassLoader->loadClass()
  5. spl_autoload_call()
  6. class_exists() in src\XF\Extension.php at line 172
  7. XF\Extension->extendClass() in src\XF\App.php at line 2406
  8. XF\App->extendClass() in src\XF\App.php at line 1275
  9. XF\App->XF\{closure}() in src\XF\Container.php at line 228
  10. XF\Container->create() in src\XF\App.php at line 2361
  11. XF\App->controller() in src\XF\Mvc\Dispatcher.php at line 211
  12. XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 88
  13. XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 41
  14. XF\Mvc\Dispatcher->run() in src\XF\App.php at line 1931
  15. XF\App->run() in src\XF.php at line 328
  16. XF::runApp() in index.php at line 13
 
I heavily recommend switching your IDE. A good IDE will point you out this problem and offer a solution for it in addition in a heartbeat.

Generally you have to make sure that your extending function uses the same signature (argument types) and the same privacy as the parent.
 
Back
Top Bottom