Skip to content

Commit 6c2bc7f

Browse files
committed
feat: Adds parameter typehints to ContainerInterface
This patch bumps the minimum supported PHP version to 7.2 and adds parameter typehints to ContainerInterface, as the first step towards adding explicit typehints based on the specification. See https://www.php-fig.org/blog/2019/10/upgrading-psr-interfaces/
1 parent fc1bc36 commit 6c2bc7f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.3.0"
15+
"php": ">=7.2.0"
1616
},
1717
"autoload": {
1818
"psr-4": {
@@ -21,7 +21,7 @@
2121
},
2222
"extra": {
2323
"branch-alias": {
24-
"dev-master": "1.0.x-dev"
24+
"dev-master": "2.0.x-dev"
2525
}
2626
}
2727
}

src/ContainerInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Psr\Container;
46

57
/**
@@ -17,7 +19,7 @@ interface ContainerInterface
1719
*
1820
* @return mixed Entry.
1921
*/
20-
public function get($id);
22+
public function get(string $id);
2123

2224
/**
2325
* Returns true if the container can return an entry for the given identifier.
@@ -30,5 +32,5 @@ public function get($id);
3032
*
3133
* @return bool
3234
*/
33-
public function has($id);
35+
public function has(string $id);
3436
}

0 commit comments

Comments
 (0)