In addition to the arguments and calls, you can also set public fields on the service class directly. The properties metadata is a hash of attributes and references to other services. For instance, if you had a service class like:
class MyService {
public $database;
}
You could define the metadata like:
test.my_service:
properties:
value: '@database'
There are some fairly significant disadvantages to doing this, however. The first is that the Service Container will set the value on instantiation; there is no other control on when that value could be set. It could be changed at any point in the object's lifetime and there is no way to track this. The other is, there is no way to hint the class property. In other ways of injecting dependencies, the class or interface can be explicitly defined in the signature, which prevents invalid assignment. With public attributes, there is no such safety.
The most common use case for this behavior is when using a third-party library that expects dependencies to be added using public properties.