sebastianbergmann/phploc — Issue #22: Uninitialized string offset: 1 in PHPLOC/Analyser.php on line 602
Author: FMaz008
Created: 2011-11-28 21:12:30+00:00
State: open

When I run phploc against the vendor/ folder of symfony ( in wich I do have bundle that are not in the standard edition ), I get about 10 PHP notice:

Uninitialized string offset: 1 in PHPLOC/Analyser.php on line 602

I've edited the PHPLOC/Analyser.php file to help debug the issue:

protected function getClassName($namespace, array $tokens, $i)
{
$i += 2;
$namespaced = FALSE;
if(!isset($tokens[$i][1])){
var_dump($namespace, $i, $tokens[$i]);
}
$className = $tokens[$i][1];

And the output is:
bool(false)
int(51)
string(1) "{"

I've also done a debug_print_backtrace:
#0 PHPLOC_Analyser->getClassName()
#1 PHPLOC_Analyser->countFile() called at [/usr/local/Cellar/php/5.3.8/lib/php/PHPLOC/Analyser.php:170]
#2 PHPLOC_Analyser->countFiles() called at [/usr/local/Cellar/php/5.3.8/lib/php/PHPLOC/TextUI/Command.php:220]
#3 PHPLOC_TextUI_Command::main() called at [/usr/local/Cellar/php/5.3.8/bin/phploc:51]