If you're testing `$factory` against an interface, you can remove `is_object()`, and you don't need to check if `null !== $this->creationOptions` because `is_array()` will return false if it is *null*.