Given a class name containing underscores, like this:
$foo = new Base_Controller
With the cursor at the end, trigger expansion with :call PhpExpandClass() and observe that the resulting line looks like this:
$foo = new Base_AB\Module\Controllers\Base_Controller
The actual namespace is \AB\Module\Controllers\Base_Controller. It should be prefixed with a backslash (since it is at the root of the namespace) and obviously shouldn't duplicate the portion of the class name up to the underscore.
Given a class name containing underscores, like this:
With the cursor at the end, trigger expansion with
:call PhpExpandClass()
and observe that the resulting line looks like this:The actual namespace is
\AB\Module\Controllers\Base_Controller
. It should be prefixed with a backslash (since it is at the root of the namespace) and obviously shouldn't duplicate the portion of the class name up to the underscore.