Skip to content
Snippets Groups Projects
Verified Commit 6f7aa21b authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

chore: improve typings

parent fa051ae0
Branches
Tags
1 merge request!5feat: remove compilation command
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -23,6 +23,11 @@ class ArrayDefinitions implements BindingDefinitions { ...@@ -23,6 +23,11 @@ class ArrayDefinitions implements BindingDefinitions {
yield from $this->normalize( $this->bindings ); yield from $this->normalize( $this->bindings );
} }
/**
* @param iterable<string,array> $bindings
*
* @return iterable<Definition>
*/
private function normalize( iterable $bindings ): iterable { private function normalize( iterable $bindings ): iterable {
foreach ( $bindings as $key => $value ) { foreach ( $bindings as $key => $value ) {
if ( is_array( $value ) ) { if ( is_array( $value ) ) {
......
...@@ -22,7 +22,9 @@ final class Init { ...@@ -22,7 +22,9 @@ final class Init {
private $config; private $config;
/** /**
* @param string|array|Configuration $config * @param string|array<string,mixed>|Configuration $config
*
* @return self
*/ */
public static function setup( $config ) { public static function setup( $config ) {
$result = require __DIR__ . '/platform_check.php'; $result = require __DIR__ . '/platform_check.php';
...@@ -35,7 +37,7 @@ final class Init { ...@@ -35,7 +37,7 @@ final class Init {
} }
/** /**
* @param string|array|Configuration $config * @param string|array<string, mixed>|Configuration $config
*/ */
public function __construct( $config ) { public function __construct( $config ) {
if ( $config instanceof Configuration ) { if ( $config instanceof Configuration ) {
...@@ -52,8 +54,10 @@ final class Init { ...@@ -52,8 +54,10 @@ final class Init {
/** /**
* @param string|null $filename Filename of the booted plugin. May be null, if called from plugin's main file. * @param string|null $filename Filename of the booted plugin. May be null, if called from plugin's main file.
*
* @return void
*/ */
public function boot( ?string $filename = null ) { public function boot( $filename = null ) {
if ( self::$bootable === false ) { if ( self::$bootable === false ) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment