Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3763806
D753.id1936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D753.id1936.diff
View Options
diff --git a/app/Phabricator/ProjectsMap.php b/app/Phabricator/ProjectsMap.php
--- a/app/Phabricator/ProjectsMap.php
+++ b/app/Phabricator/ProjectsMap.php
@@ -2,7 +2,7 @@
namespace Nasqueron\Notifications\Phabricator;
-use Nasqueron\Notifications\Phabricator\PhabricatorAPIClient as ApiClient;
+use Nasqueron\Notifications\Contracts\APIClient as APIClient;
use App;
use Cache;
@@ -143,7 +143,7 @@
* @param Nasqueron\Notifications\Contracts\APIClient $apiClient The Phabricator API client
* @return ProjectsMap
*/
- public static function fetch ($phabricatorInstanceName, APIClient $apiClient = null) {
+ public static function fetch ($phabricatorInstanceName, ?APIClient $apiClient = null) {
$instance = new self($phabricatorInstanceName);
$instance->setAPIClient($apiClient);
$instance->fetchFromAPI();
@@ -168,7 +168,7 @@
/**
* @param Nasqueron\Notifications\Contracts\APIClient $apiClient
*/
- public function setAPIClient (APIClient $apiClient = null) {
+ public function setAPIClient (?APIClient $apiClient = null) {
$this->apiClient = $apiClient;
}
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
"license": "BSD-2-Clause",
"type": "project",
"require": {
- "php": ">=5.6.0",
+ "php": ">=7.1.0",
"laravel/framework": "5.2.*",
"guzzlehttp/guzzle": "^6.2",
"keruald/dockerhub": "^0.0.3",
diff --git a/tests/Phabricator/ProjectsMapTest.php b/tests/Phabricator/ProjectsMapTest.php
--- a/tests/Phabricator/ProjectsMapTest.php
+++ b/tests/Phabricator/ProjectsMapTest.php
@@ -2,6 +2,7 @@
namespace Nasqueron\Notifications\Tests\Phabricator;
+use Nasqueron\Notifications\Contracts\APIClient;
use Nasqueron\Notifications\Phabricator\ProjectsMap;
use Nasqueron\Notifications\Tests\TestCase;
@@ -167,10 +168,20 @@
/// Tests API
///
- private function mockPhabricatorAPIWithReply ($reply) {
- return Mockery::mock('Nasqueron\Notifications\Contract\APIClient')
- ->shouldReceive('call')
- ->andReturn($reply);
+ private function mockPhabricatorAPIWithReply ($reply) : APIClient {
+ return (new class($reply) implements APIClient {
+ private $reply;
+
+ public function __construct ($reply) {
+ $this->reply = $reply;
+ }
+
+ public function setEndPoint ($url) : void { }
+
+ public function call ($method, $arguments = []) {
+ return $this->reply;
+ }
+ });
}
/**
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 02:39 (14 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2256909
Default Alt Text
D753.id1936.diff (2 KB)
Attached To
Mode
D753: Upgrade code to PHP 7.1
Attached
Detach File
Event Timeline
Log In to Comment