preaction / Beam-Wire

A simple configuration and dependency injection container
Other
11 stars 10 forks source link

inconsistent quoting of service names #77

Open XSven opened 1 year ago

XSven commented 1 year ago

When I try to get() a missing service "baz" from a container.yml file, this is written to the console

Get service: baz Service "baz" does not exist. Creating. Service 'baz' not found in file 'container.yml'

The first two lines are DEBUG lines (BEAM_WIRE_DEBUG == 1). In the first line the service name is not quoted. In the second line double quotes are used and in the stringified NotFound exception single quotes are used. By the way I do not understand what "Creating." means.

I have detected this slight inaccuracy when I have searched for a way to check if a service with a given name exists or not, without provoking a NotFound exception.

Could you please tell me if there exists a method with a boolean return value that tells me whether a service is defined ore not?