protected function normalizeDirectory($directory)
    {
        $last = $directory[strlen($directory) - 1];
        if (in_array($last, array('/', '\\'))) {
            $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR;
            return $directory;
        }
        $directory .= DIRECTORY_SEPARATOR;
        return $directory;
    }
protected function normalizeDirectory($directory)
    {
        $last = $directory[strlen($directory) - 1];
        if (in_array($last, array('/', '\\'))) {
            $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR;
            return $directory;
        }
        $directory .= DIRECTORY_SEPARATOR;
        return $directory;
    }
protected function normalizeDirectory ( $ directory ) { $ last = $ directory [ strlen ( $ directory ) - 1 ] ; if ( in_array ( $ last , array ( '/' , '\\' ) ) ) { $ directory [ strlen ( $ directory ) - 1 ] = DIRECTORY_SEPARATOR ; return $ directory ; } $ directory .= DIRECTORY_SEPARATOR ; return $ directory ; }
Normalize the directory to include a trailing directory separator

@param  string $directory
@return string
Normalize the directory to include a trailing directory separator