@@ -111,7 +111,7 @@ class Application extends Container
111111 /**
112112 * Service providers
113113 *
114- * @var array<string,
114+ * @var array<string, ServiceProvider>
115115 *
116116 * @since 1.0.0
117117 */
@@ -156,7 +156,7 @@ class Application extends Container
156156 /**
157157 * Cached namespaces resolved from composer PSR-4 paths.
158158 *
159- * @var array<string,
159+ * @var array<string, string>
160160 *
161161 * @since 1.0.0
162162 */
@@ -199,8 +199,8 @@ public function __construct(?string $base_path = null)
199199 $ this ->register_base_service_providers ();
200200 $ this ->register_base_aliases ();
201201
202- $ this ->register_app_defined_providers ();
203- $ this ->register_app_defined_aliases ();
202+ // $this->register_app_defined_providers();
203+ // $this->register_app_defined_aliases();
204204 }
205205
206206 /**
@@ -437,7 +437,12 @@ public function is_booted()
437437 */
438438 public static function configure (string $ base_path )
439439 {
440- return static ::get_instance ($ base_path );
440+ $ instance = static ::get_instance ($ base_path );
441+
442+ $ instance ->register_app_defined_providers ()
443+ ->register_app_defined_aliases ();
444+
445+ return $ instance ;
441446 }
442447
443448 /**
@@ -801,7 +806,7 @@ protected function fire_app_callbacks(array $callbacks)
801806 /**
802807 * Register other on demand provided providers.
803808 *
804- * @return void
809+ * @return $this
805810 *
806811 * @throws \InvalidArgumentException
807812 *
@@ -812,13 +817,13 @@ protected function register_app_defined_providers()
812817 $ path = $ this ->bootstrap_service_provider_path ();
813818
814819 if (!file_exists ($ path )) {
815- return ;
820+ return $ this ;
816821 }
817822
818823 $ providers = require $ path ;
819824
820825 if (empty ($ providers )) {
821- return ;
826+ return $ this ;
822827 }
823828
824829 foreach ($ providers as $ provider ) {
@@ -834,13 +839,15 @@ protected function register_app_defined_providers()
834839
835840 $ this ->register (new $ provider ($ this ));
836841 }
842+
843+ return $ this ;
837844 }
838845
839846 /**
840847 * Register tha aliases defined at the application level.
841848 * Generally it will come from the bootstrap/aliases.php file.
842849 *
843- * @return void
850+ * @return $this
844851 *
845852 * @since 1.0.0
846853 */
@@ -849,20 +856,22 @@ protected function register_app_defined_aliases()
849856 $ aliases_path = $ this ->bootstrap_path ('aliases.php ' );
850857
851858 if (!file_exists ($ aliases_path )) {
852- return ;
859+ return $ this ;
853860 }
854861
855862 $ aliases = require $ aliases_path ;
856863
857864 if (empty ($ aliases )) {
858- return ;
865+ return $ this ;
859866 }
860867
861868 foreach ($ aliases as $ alias => $ abstracts ) {
862869 foreach ($ abstracts as $ abstract ) {
863870 $ this ->alias ($ alias , $ abstract );
864871 }
865872 }
873+
874+ return $ this ;
866875 }
867876
868877 /**
0 commit comments