Removed references to BlockInjection, and created validation for parameters in accept...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / IOC / Container.pm
index 6c9b3e5..4409816 100644 (file)
@@ -8,7 +8,6 @@ use Devel::InnerPackage ();
 use Hash::Util qw/lock_hash/;
 use MooseX::Types::LoadableClass qw/ LoadableClass /;
 use Moose::Util;
-use Catalyst::IOC::BlockInjection;
 use Catalyst::IOC::ConstructorInjection;
 use Module::Pluggable::Object ();
 use namespace::autoclean;
@@ -396,10 +395,7 @@ sub build_locate_components_service {
                 %$config
             );
 
-            # XXX think about ditching this sort entirely
-            my @comps = sort { length $a <=> length $b } $locator->plugins;
-
-            return \@comps;
+            return [ $locator->plugins ];
         },
         dependencies => [ depends_on('application_name'), depends_on('config') ],
     );
@@ -621,7 +617,6 @@ sub add_component {
 
     $self->get_sub_container($type)->add_service(
         Catalyst::IOC::ConstructorInjection->new(
-            lifecycle => 'Singleton', # FIXME?
             name      => $name,
             class     => $component,
             dependencies => [
@@ -633,6 +628,10 @@ sub add_component {
                     isa => 'Str',
                     default => Catalyst::Utils::class2classsuffix( $component ),
                 },
+                accept_context_args => {
+                    isa => 'ArrayRef',
+                    default => sub { [] },
+                },
             },
         )
     );
@@ -776,8 +775,6 @@ Searches for components in all containers. If $component is the full class name,
 
 Finds components that match a given regexp. Used internally, by find_component.
 
-=head2 setup_component
-
 =head2 _fix_syntax
 
 =head2 _config_substitutions
@@ -822,7 +819,7 @@ setup for the application.  By default, it will use L<Module::Pluggable>.
 Specify a C<setup_components> config option to pass additional options directly
 to L<Module::Pluggable>.
 
-=head2 build_setup_components_service
+=head2 setup_components
 
 =head1 AUTHORS