Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Bread-Board CPAN distribution.

Report information
The Basics
Id: 83962
Status: resolved
Priority: 0/
Queue: Bread-Board

People
Owner: Nobody in particular
Requestors: wolfgang [...] kinkeldei.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ->resolve() does not transport parameters to constructor
Hi, Maybe I am using things not as intended, but I do not see my parameters get transported into the ConstructorInjection. This is what I do somewhere inside my code: return $container->resolve( service => $service_name, parameters => { @_ }, # @_ really contains something (!) ); Bread::Board::Container, line 161 reads: return $service->get( %parameters ); so, my parameters got collected before and are transported into the *Injection's get() method. However, the get() method does not use any arguments beyond $self... If I patch Bread::Board::ConstructorInjection line 37 from: $self->class->$constructor( %{ $self->params } ); to: $self->class->$constructor( %{ $self->params }, @_ ); I see my parameters appear in the constructor of my class instantiated. All other injection-Classes also seem to ignore the parameters if I see things right. Should I have done something differently or did I find a bug? Best, Wolfgang
Subject: Re: [rt.cpan.org #83962] ->resolve() does not transport parameters to constructor
Date: Wed, 20 Mar 2013 08:31:59 -0400
To: bug-Bread-Board [...] rt.cpan.org
From: Stevan Little <stevan.little [...] iinteractive.com>
Wolfgang, The parameters are actually handled in the Bread::Board::Service::WithParameters role in a "begin 'get'" method. I suspect that you are not defining the parameters in your service since that would seem to be the only way through the code that would not either 1) error out or 2) pass your parameters along. Perhaps you could provide a larger runnable example? Thanks, - Stevan On Mar 15, 2013, at 5:30 AM, Wolfgang Kinkeldei via RT <bug-Bread-Board@rt.cpan.org> wrote: Show quoted text
> Fri Mar 15 05:30:54 2013: Request 83962 was acted upon. > Transaction: Ticket created by WKI > Queue: Bread-Board > Subject: ->resolve() does not transport parameters to constructor > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: wolfgang@kinkeldei.de > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83962 > > > > Hi, > > Maybe I am using things not as intended, but I do not see my parameters get transported into the > ConstructorInjection. > > This is what I do somewhere inside my code: > return $container->resolve( > service => $service_name, > parameters => { @_ }, # @_ really contains something (!) > ); > > Bread::Board::Container, line 161 reads: > return $service->get( %parameters ); > > so, my parameters got collected before and are transported into the *Injection's get() method. > However, the get() method does not use any arguments beyond $self... > > If I patch Bread::Board::ConstructorInjection line 37 from: > $self->class->$constructor( %{ $self->params } ); > > to: > $self->class->$constructor( %{ $self->params }, @_ ); > > I see my parameters appear in the constructor of my class instantiated. All other injection-Classes > also seem to ignore the parameters if I see things right. > > Should I have done something differently or did I find a bug? > > Best, > Wolfgang
Am Mi 20. Mär 2013, 08:32:16, STEVAN schrieb: Show quoted text
> Wolfgang, > > The parameters are actually handled in the > Bread::Board::Service::WithParameters role in a "begin 'get'" > method. > > I suspect that you are not defining the parameters in your service > since that would seem to be the only way through the code that > would not either 1) error out or 2) pass your parameters along. > Perhaps you could provide a larger runnable example?
you are right. I did not realize this detail, sorry for writing a ticket. I defined the parameters like in the examples provided and everything works. Great and Thanks a lot!
Subject: Re: [rt.cpan.org #83962] ->resolve() does not transport parameters to constructor
Date: Wed, 20 Mar 2013 08:57:38 -0400
To: bug-Bread-Board [...] rt.cpan.org
From: Stevan Little <stevan.little [...] iinteractive.com>
Wolfgang, Excellent, glad to hear it. I will have to take a look over the docs and see if I can make this clearer so others don't run into this issue. THanks, - Stevan On Mar 20, 2013, at 8:53 AM, "Wolfgang Kinkeldei via RT" <bug-Bread-Board@rt.cpan.org> wrote: Show quoted text
> Queue: Bread-Board > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83962 > > > Am Mi 20. Mär 2013, 08:32:16, STEVAN schrieb:
>> Wolfgang, >> >> The parameters are actually handled in the >> Bread::Board::Service::WithParameters role in a "begin 'get'" >> method. >> >> I suspect that you are not defining the parameters in your service >> since that would seem to be the only way through the code that >> would not either 1) error out or 2) pass your parameters along. >> Perhaps you could provide a larger runnable example?
> > you are right. I did not realize this detail, sorry for writing a ticket. I defined the parameters like in the examples provided and everything works. > > Great and Thanks a lot! >