``$package`` is an object here, not a string. You should use ``getPrettyString``