File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 44
55namespace WyriHaximus \React \ChildProcess \Messenger \Messages ;
66
7+ use Doctrine \Inflector \Inflector ;
78use Doctrine \Inflector \InflectorFactory ;
89use Exception ;
910use Throwable ;
1213
1314final class Factory
1415{
16+ private static ?Inflector $ inflector = null ;
17+
1518 /**
1619 * @param array<mixed> $lineOptions
1720 */
1821 public static function fromLine (string $ line , array $ lineOptions ): ActionableMessageInterface
1922 {
2023 $ line = json_decode ($ line , true );
21- $ method = InflectorFactory::create ()->build ()->camelize ($ line ['type ' ]);
24+ self ::$ inflector ??= InflectorFactory::create ()->build ();
25+ $ method = self ::$ inflector ->camelize ($ line ['type ' ]);
2226 if ($ method === 'secure ' ) {
2327 return static ::secureFromLine ($ line , $ lineOptions );
2428 }
You can’t perform that action at this time.
0 commit comments