Added return types to closures.

This commit is contained in:
Andrey Savchenko committed 2018-11-30 15:05:54 +02:00
1 parent 204c1df755
commit 4013046e4f
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ class Plugin extends Container {
$laps = $this; $laps = $this;
$laps['mustache'] = function () { $laps['mustache'] = function (): \Mustache_Engine {
return new \Mustache_Engine( [ return new \Mustache_Engine( [
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/src/mustache' ), 'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/src/mustache' ),
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/src/mustache/cache' ), 'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/src/mustache/cache' ),
+1 -1
View File
@@ -21,7 +21,7 @@ class Hook_Event_Provider implements ServiceProviderInterface {
*/ */
public function register( Container $pimple ): void { public function register( Container $pimple ): void {
$pimple['hook.events'] = function () { $pimple['hook.events'] = function (): array {
return [ return [
'core' => new Core_Events(), 'core' => new Core_Events(),
'genesis' => new Genesis_Events(), 'genesis' => new Genesis_Events(),
+1 -1
View File
@@ -20,7 +20,7 @@ class Manager_Provider implements ServiceProviderInterface, Bootable_Provider_In
*/ */
public function register( Container $pimple ): void { public function register( Container $pimple ): void {
$pimple['managers'] = function ( Plugin $laps ) { $pimple['managers'] = function ( Plugin $laps ): array {
return [ return [
new Load_Order_Manager(), new Load_Order_Manager(),
new Asset_Manager(), new Asset_Manager(),
+3 -3
View File
@@ -23,11 +23,11 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int
*/ */
public function register( Container $pimple ): void { public function register( Container $pimple ): void {
$pimple['stopwatch'] = $pimple->factory( function () { $pimple['stopwatch'] = $pimple->factory( function (): Stopwatch {
return new Stopwatch( true ); return new Stopwatch( true );
} ); } );
$pimple['collectors'] = function ( Plugin $laps ) { $pimple['collectors'] = function ( Plugin $laps ): array {
return [ return [
'core' => new Core_Load_Collector(), 'core' => new Core_Load_Collector(),
'hook' => new Hook_Record_Collector( $laps['stopwatch'], $laps['hook.events'] ), 'hook' => new Hook_Record_Collector( $laps['stopwatch'], $laps['hook.events'] ),
@@ -36,7 +36,7 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int
]; ];
}; };
$pimple['records'] = function ( Plugin $laps ) { $pimple['records'] = function ( Plugin $laps ): array {
$records = []; $records = [];