G
G
grabbee2019-06-25 22:11:12
symfony
grabbee, 2019-06-25 22:11:12

Make a service from a third party library?

Composer loaded the library and is available PSR-4 by namespace. There you need to pass one parameter to the constructor, I try to define it as a service, but it does not find this class - it says that it does not exist, but everyone, including the IDE, sees it. If you try to add by use ... new ... it is, but as a service, it does not want to.

services:

  Some\Other\Libs:
    public: true
    arguments:
      $projectDir: '%kernel.project_dir%'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grabbee, 2019-06-26
@grabbee

Everything is correct. The old version of the library package with an error in the paths was simply preserved. Reinstalled from scratch and it worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question