Description
Let's use a sample similar to the doc:
services:
_instanceof:
App\Handler:
tags:
- { name: 'app.handler', priority: 20 }
App\HandlerCollection:
arguments: [!tagged app.handler]
All instances of App\Handler will have the same priority.
I would like to define a different priority for each handler.
Example
This might not be the cleanest solution but you get the point.
services:
_instanceof:
App\Handler:
tags:
- { name: 'app.handler', priority: 'getPriority' }
namespace App;
class MyHandler implements Handler {
public static function getPriority(): int {
return 10;
}
}