Skip to content

Commit

Permalink
feat: Adds parameter typehints to ContainerInterface
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
weierophinney committed Jun 17, 2020
1 parent fc1bc36 commit 6c2bc7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php": ">=5.3.0"
"php": ">=7.2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -21,7 +21,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "2.0.x-dev"
}
}
}
6 changes: 4 additions & 2 deletions src/ContainerInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Psr\Container;

/**
Expand All @@ -17,7 +19,7 @@ interface ContainerInterface
*
* @return mixed Entry.
*/
public function get($id);
public function get(string $id);

/**
* Returns true if the container can return an entry for the given identifier.
Expand All @@ -30,5 +32,5 @@ public function get($id);
*
* @return bool
*/
public function has($id);
public function has(string $id);
}

0 comments on commit 6c2bc7f

Please sign in to comment.