Category : interface

How to inject in a Symfony service the Logger component in lazy mode using DI. My intention is to log information in some methods. The logger instance must be created at the first time is used. Something like this: namespace AppServices; use PsrLogLoggerInterface; class XxxService{ private $logger; public function some_method(){ echo "method without logging" return ..

Read more

What I want: I try to deserialize the response from consuming an API Call in PHP. For my endpoints I like to have a Model, that way the Serializer can do it’s magic. The response: { "count": 123, "next": "string", "previous": "string", "limit": 123, "offset": 123, "results": [ {…}, {…} ] } Now, every response ..

Read more

I am working on a symfony 3.3 app, the app had a single bundle and I wanted to add another bundle containing our new api client generated with the OpenAPI generator with the following command : openapi-generator generate -i swagger.json -g php-symfony -o MyOpenAPIBundle –additional-properties=composerProjectName=my-project,composerVendorName=root,invokerPackage=MyOpenAPIBundle,bundleName=MyOpenAPI,bundleAlias=my_open_api I followed the readme produced by the generator, configured autoload, ..

Read more

I am working on a symfony 3.3 app, the app had a single bundle and I wanted to add another bundle containing our new api client generated with the OpenAPI generator with the following command : openapi-generator generate -i swagger.json -g php-symfony -o MyOpenAPIBundle –additional-properties=composerProjectName=my-project,composerVendorName=root,invokerPackage=MyOpenAPIBundle,bundleName=MyOpenAPI,bundleAlias=my_open_api I followed the readme produced by the generator, configured autoload, ..

Read more