From dde2de44955ee8c7d7092d968de7a58784c6a517 Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 28 Jan 2019 11:24:45 +0800 Subject: [PATCH 01/29] Feature: add accounts end point, add get domains --- src/Endpoints/Accounts.php | 61 ++++++++++++++++++++++ tests/Endpoints/AccountsTest.php | 37 +++++++++++++ tests/Fixtures/Endpoints/listAccounts.json | 20 +++++++ 3 files changed, 118 insertions(+) create mode 100644 src/Endpoints/Accounts.php create mode 100644 tests/Endpoints/AccountsTest.php create mode 100644 tests/Fixtures/Endpoints/listAccounts.json diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php new file mode 100644 index 0000000..4ded300 --- /dev/null +++ b/src/Endpoints/Accounts.php @@ -0,0 +1,61 @@ +adapter = $adapter; + } + + public function listAccounts( + int $page = 1, + int $perPage = 20, + string $direction = '' + ): \stdClass { + $query = [ + 'page' => $page, + 'per_page' => $perPage + ]; + + if (!empty($direction)) { + $query['direction'] = $direction; + } + + $user = $this->adapter->get('accounts', $query); + $this->body = json_decode($user->getBody()); + + return (object)['result' => $this->body->result, 'result_info' => $this->body->result_info]; + } + + public function getDomains(string $accountID): \stdClass + { + $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains'); + + $this->body = $response->getBody(); + + return json_decode($this->body)->result; + } + + public function getDomainDetails(string $accountID, string $domainName): \stdClass + { + $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains' . $domainName); + + $this->body = $response->getBody(); + + return json_decode($this->body)->result; + } +} diff --git a/tests/Endpoints/AccountsTest.php b/tests/Endpoints/AccountsTest.php new file mode 100644 index 0000000..db2b1be --- /dev/null +++ b/tests/Endpoints/AccountsTest.php @@ -0,0 +1,37 @@ +getPsr7JsonResponseForFixture('Endpoints/listAccounts.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('accounts'), + $this->equalTo([ + 'page' => 1, + 'per_page' => 20, + 'direction' => 'desc', + ]) + ); + + $accounts = new \Cloudflare\API\Endpoints\Accounts($mock); + $result = $accounts->listAccounts(1, 20, 'desc'); + + $this->assertObjectHasAttribute('result', $result); + $this->assertObjectHasAttribute('result_info', $result); + + $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $result->result[0]->id); + $this->assertEquals(1, $result->result_info->page); + $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $accounts->getBody()->result[0]->id); + } +} diff --git a/tests/Fixtures/Endpoints/listAccounts.json b/tests/Fixtures/Endpoints/listAccounts.json new file mode 100644 index 0000000..0e6275a --- /dev/null +++ b/tests/Fixtures/Endpoints/listAccounts.json @@ -0,0 +1,20 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": [ + { + "id": "023e105f4ecef8ad9ca31a8372d0c353", + "name": "Example Account", + "settings": { + "enforce_twofactor": true + } + } + ], + "result_info": { + "page": 1, + "per_page": 20, + "count": 1, + "total_count": 2000 + } +} From fb45932677328e317719ceac624c95a0ce697c9e Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 28 Jan 2019 11:35:58 +0800 Subject: [PATCH 02/29] cast result as object --- src/Endpoints/Accounts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index 4ded300..3004ea9 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -47,7 +47,7 @@ class Accounts implements API $this->body = $response->getBody(); - return json_decode($this->body)->result; + return (object)['result' => $this->body->result]; } public function getDomainDetails(string $accountID, string $domainName): \stdClass @@ -56,6 +56,6 @@ class Accounts implements API $this->body = $response->getBody(); - return json_decode($this->body)->result; + return (object)['result' => $this->body->result]; } } From 44eb77f9ca43e36a7bffcbc625d93c06f337b26e Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 28 Jan 2019 11:39:49 +0800 Subject: [PATCH 03/29] cast response as array instead of object --- src/Endpoints/Accounts.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index 3004ea9..fd42189 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -41,21 +41,21 @@ class Accounts implements API return (object)['result' => $this->body->result, 'result_info' => $this->body->result_info]; } - public function getDomains(string $accountID): \stdClass + public function getDomains(string $accountID): array { $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains'); - $this->body = $response->getBody(); + $this->body = json_decode($response->getBody()); - return (object)['result' => $this->body->result]; + return $this->body->result; } - public function getDomainDetails(string $accountID, string $domainName): \stdClass + public function getDomainDetails(string $accountID, string $domainName): array { $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains' . $domainName); - $this->body = $response->getBody(); + $this->body = json_decode($response->getBody()); - return (object)['result' => $this->body->result]; + return $this->body->result; } } From b04abe73bcfb3f8b60b5e02f628759468fa5326e Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Thu, 6 Jun 2019 15:00:57 +0800 Subject: [PATCH 04/29] Feature: add pause --- src/Endpoints/Zones.php | 15 +++++++++++++++ tests/Endpoints/ZonesTest.php | 23 +++++++++++++++++++++++ tests/Fixtures/Endpoints/pauseTest.json | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 tests/Fixtures/Endpoints/pauseTest.json diff --git a/src/Endpoints/Zones.php b/src/Endpoints/Zones.php index 8595cb6..22db2ee 100644 --- a/src/Endpoints/Zones.php +++ b/src/Endpoints/Zones.php @@ -58,6 +58,21 @@ class Zones implements API return false; } + public function pause(string $zoneID, bool $paused = true): bool + { + $options = [ + 'paused' => $paused, + ]; + $user = $this->adapter->patch('zones/' . $zoneID, $options); + $this->body = json_decode($user->getBody()); + + if (isset($this->body->result->id)) { + return true; + } + + return false; + } + public function listZones( string $name = '', string $status = '', diff --git a/tests/Endpoints/ZonesTest.php b/tests/Endpoints/ZonesTest.php index 0bda651..a95f690 100644 --- a/tests/Endpoints/ZonesTest.php +++ b/tests/Endpoints/ZonesTest.php @@ -49,6 +49,29 @@ class ZonesTest extends TestCase $this->assertEquals('9a7806061c88ada191ed06f989cc3dac', $zones->getBody()->result->id); } + public function testPauseTest() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/pauseTest.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41'), + $this->equalTo([ + 'pause' => true, + ]) + ); + + $zones = new \Cloudflare\API\Endpoints\Zones($mock); + $result = $zones->pause('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); + + $this->assertTrue($result); + $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $zones->getBody()->result->id); + } + public function testActivationTest() { $response = $this->getPsr7JsonResponseForFixture('Endpoints/activationTest.json'); diff --git a/tests/Fixtures/Endpoints/pauseTest.json b/tests/Fixtures/Endpoints/pauseTest.json new file mode 100644 index 0000000..bedd2f5 --- /dev/null +++ b/tests/Fixtures/Endpoints/pauseTest.json @@ -0,0 +1,8 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "023e105f4ecef8ad9ca31a8372d0c353" + } +} From 89986cfb029a7a7fc3104dc51c24718ffa844d52 Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Tue, 25 Jun 2019 11:54:56 +0300 Subject: [PATCH 05/29] Added Firewall rules endpoints --- src/Endpoints/Firewall.php | 84 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/Endpoints/Firewall.php diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php new file mode 100644 index 0000000..1734ff4 --- /dev/null +++ b/src/Endpoints/Firewall.php @@ -0,0 +1,84 @@ +adapter = $adapter; + } + + public function createFirewallRules( + string $zoneID, + array $rules + ): array { + $query = $this->adapter->post('zones/' . $zoneID . '/firewall/rules', $rules); + $body = json_decode($query->getBody()); + + return $body->result; + } + + public function createFirewallRule( + string $zoneID, + string $expression, + string $action, + string $description = null, + bool $paused = true, + int $priority = null + ): array { + $rule = [ + 'filter' => [ + 'expression' => $expression, + 'paused' => false + ], + 'action' => $action, + 'paused' => $paused + ]; + + if ($description !== null) { + $options['description'] = $description; + } + + if ($priority !== null) { + $options['priority'] = $priority; + } + + return $this->createFirewallRules($zoneID, [$rule]); + } + + public function listFirewallRules( + string $zoneID, + int $page = 1, + int $perPage = 50 + ): array { + $query = [ + 'page' => $page, + 'per_page' => $perPage, + ]; + + $rules = $this->adapter->get('zones/' . $zoneID . '/firewall/rules', $query); + $body = json_decode($rules->getBody()); + + return $body->result; + } + + public function deleteFirewallRule( + string $zoneID, + string $ruleID + ): bool { + $rule = $this->adapter->delete('zones/' . $zoneID . '/firewall/rules/' . $ruleID); + + $body = json_decode($rule->getBody()); + + if (isset($body->result->id)) { + return true; + } + + return false; + } +} From c5b6bceecbd58f8f4eee038babfaefbe15506ebc Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Thu, 27 Jun 2019 18:19:24 +0300 Subject: [PATCH 06/29] Fixed passing the description and priority of the createFirewallRule method --- src/Endpoints/Firewall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index 1734ff4..9c025da 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -41,11 +41,11 @@ class Firewall implements API ]; if ($description !== null) { - $options['description'] = $description; + $rule['description'] = $description; } if ($priority !== null) { - $options['priority'] = $priority; + $rule['priority'] = $priority; } return $this->createFirewallRules($zoneID, [$rule]); From 48404cd0ac5819b4b0f51a54768d02ccea37e5cf Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Thu, 27 Jun 2019 18:20:34 +0300 Subject: [PATCH 07/29] Added update to Firewall rules --- src/Endpoints/Firewall.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index 9c025da..49f68e9 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -81,4 +81,39 @@ class Firewall implements API return false; } + + public function updateFirewallRule( + string $zoneID, + string $ruleID, + string $filterID, + string $expression, + string $action, + string $description = null, + bool $paused = true, + int $priority = null + ): \stdClass { + $rule = [ + 'id' => $ruleID, + 'filter' => [ + 'id' => $filterID, + 'expression' => $expression, + 'paused' => false + ], + 'action' => $action, + 'paused' => $paused + ]; + + if ($description !== null) { + $rule['description'] = $description; + } + + if ($priority !== null) { + $rule['priority'] = $priority; + } + + $rule = $this->adapter->put('zones/' . $zoneID . '/firewall/rules/' . $ruleID, $rule); + $body = json_decode($rule->getBody()); + + return $body->result; + } } From 29ab1011301cb77570c7e077e13e144be233b8a6 Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Thu, 27 Jun 2019 18:26:23 +0300 Subject: [PATCH 08/29] Fixed enable the firewall rule by default --- src/Endpoints/Firewall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index 49f68e9..c9cd95d 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -28,7 +28,7 @@ class Firewall implements API string $expression, string $action, string $description = null, - bool $paused = true, + bool $paused = false, int $priority = null ): array { $rule = [ From 66ec1b318fd79f4e391570527dd31ab43c3767d3 Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Mon, 8 Jul 2019 14:09:42 +0300 Subject: [PATCH 09/29] Changed return value of the "listFirewallRules" method --- src/Endpoints/Firewall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index c9cd95d..84791f0 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -55,7 +55,7 @@ class Firewall implements API string $zoneID, int $page = 1, int $perPage = 50 - ): array { + ): \stdClass { $query = [ 'page' => $page, 'per_page' => $perPage, @@ -64,7 +64,7 @@ class Firewall implements API $rules = $this->adapter->get('zones/' . $zoneID . '/firewall/rules', $query); $body = json_decode($rules->getBody()); - return $body->result; + return (object)['result' => $body->result, 'result_info' => $body->result_info]; } public function deleteFirewallRule( From 68d862f7daeade4c53fe2217d9f5c213069e5138 Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Mon, 8 Jul 2019 20:08:57 +0300 Subject: [PATCH 10/29] Changed return value of the "createFirewallRules" method --- src/Endpoints/Firewall.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index 84791f0..9772951 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -16,11 +16,17 @@ class Firewall implements API public function createFirewallRules( string $zoneID, array $rules - ): array { + ): bool { $query = $this->adapter->post('zones/' . $zoneID . '/firewall/rules', $rules); $body = json_decode($query->getBody()); - return $body->result; + foreach ($body->result as $result) { + if (!isset($result->id)) { + return false; + } + } + + return true; } public function createFirewallRule( @@ -30,7 +36,7 @@ class Firewall implements API string $description = null, bool $paused = false, int $priority = null - ): array { + ): bool { $rule = [ 'filter' => [ 'expression' => $expression, From 22a87e1b91cc9c9c70130eceb06e3dc791fbe1ac Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Mon, 8 Jul 2019 21:09:19 +0300 Subject: [PATCH 11/29] Moved the action type and paused or not from the signature to the separate class --- src/Configurations/FirewallRuleOptions.php | 46 ++++++++++++++++++++++ src/Endpoints/Firewall.php | 23 +++++------ 2 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 src/Configurations/FirewallRuleOptions.php diff --git a/src/Configurations/FirewallRuleOptions.php b/src/Configurations/FirewallRuleOptions.php new file mode 100644 index 0000000..93f0531 --- /dev/null +++ b/src/Configurations/FirewallRuleOptions.php @@ -0,0 +1,46 @@ + false, + 'action' => 'block' + ]; + + public function getArray(): array + { + return $this->configs; + } + + public function setPaused(bool $paused) + { + $this->configs['paused'] = $paused; + } + + public function setActionBlock() + { + $this->configs['action'] = 'block'; + } + + public function setActionAllow() + { + $this->configs['action'] = 'allow'; + } + + public function setActionChallenge() + { + $this->configs['action'] = 'challenge'; + } + + public function setActionJsChallenge() + { + $this->configs['action'] = 'js_challenge'; + } + + public function setActionLog() + { + $this->configs['action'] = 'log'; + } +} diff --git a/src/Endpoints/Firewall.php b/src/Endpoints/Firewall.php index 9772951..14ebb76 100644 --- a/src/Endpoints/Firewall.php +++ b/src/Endpoints/Firewall.php @@ -3,6 +3,7 @@ namespace Cloudflare\API\Endpoints; use Cloudflare\API\Adapter\Adapter; +use Cloudflare\API\Configurations\FirewallRuleOptions; class Firewall implements API { @@ -32,19 +33,16 @@ class Firewall implements API public function createFirewallRule( string $zoneID, string $expression, - string $action, + FirewallRuleOptions $options, string $description = null, - bool $paused = false, int $priority = null ): bool { - $rule = [ + $rule = array_merge([ 'filter' => [ 'expression' => $expression, 'paused' => false - ], - 'action' => $action, - 'paused' => $paused - ]; + ] + ], $options->getArray()); if ($description !== null) { $rule['description'] = $description; @@ -93,21 +91,18 @@ class Firewall implements API string $ruleID, string $filterID, string $expression, - string $action, + FirewallRuleOptions $options, string $description = null, - bool $paused = true, int $priority = null ): \stdClass { - $rule = [ + $rule = array_merge([ 'id' => $ruleID, 'filter' => [ 'id' => $filterID, 'expression' => $expression, 'paused' => false - ], - 'action' => $action, - 'paused' => $paused - ]; + ] + ], $options->getArray()); if ($description !== null) { $rule['description'] = $description; From 8364249fbb5e21f71c98bf8924eb0549eb2a77e7 Mon Sep 17 00:00:00 2001 From: Vitaliy Dotsenko Date: Mon, 8 Jul 2019 21:12:21 +0300 Subject: [PATCH 12/29] Added unit tests to check Firewall rules --- tests/Endpoints/FirewallTest.php | 177 ++++++++++++++++++ .../Endpoints/createFirewallRule.json | 20 ++ .../Endpoints/createFirewallRules.json | 33 ++++ .../Endpoints/deleteFirewallRule.json | 8 + .../Fixtures/Endpoints/listFirewallRules.json | 27 +++ .../Endpoints/updateFirewallRule.json | 19 ++ 6 files changed, 284 insertions(+) create mode 100644 tests/Endpoints/FirewallTest.php create mode 100644 tests/Fixtures/Endpoints/createFirewallRule.json create mode 100644 tests/Fixtures/Endpoints/createFirewallRules.json create mode 100644 tests/Fixtures/Endpoints/deleteFirewallRule.json create mode 100644 tests/Fixtures/Endpoints/listFirewallRules.json create mode 100644 tests/Fixtures/Endpoints/updateFirewallRule.json diff --git a/tests/Endpoints/FirewallTest.php b/tests/Endpoints/FirewallTest.php new file mode 100644 index 0000000..c2b2ed6 --- /dev/null +++ b/tests/Endpoints/FirewallTest.php @@ -0,0 +1,177 @@ +getPsr7JsonResponseForFixture('Endpoints/createFirewallRules.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('post')->willReturn($response); + + $mock->expects($this->once()) + ->method('post') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules'), + $this->equalTo([ + [ + 'action' => 'block', + 'description' => 'Foo', + 'filter' => [ + 'expression' => 'http.cookie eq "foo"', + 'paused' => false + ], + ], + [ + 'action' => 'block', + 'description' => 'Bar', + 'filter' => [ + 'expression' => 'http.cookie eq "bar"', + 'paused' => false + ], + ] + ]) + ); + + $firewall = new Cloudflare\API\Endpoints\Firewall($mock); + $result = $firewall->createFirewallRules( + '023e105f4ecef8ad9ca31a8372d0c353', + [ + [ + 'filter' => [ + 'expression' => 'http.cookie eq "foo"', + 'paused' => false + ], + 'action' => 'block', + 'description' => 'Foo' + ], + [ + 'filter' => [ + 'expression' => 'http.cookie eq "bar"', + 'paused' => false + ], + 'action' => 'block', + 'description' => 'Bar' + ], + ] + ); + $this->assertTrue($result); + } + + public function testCreatePageRule() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/createFirewallRule.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('post')->willReturn($response); + + $mock->expects($this->once()) + ->method('post') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules'), + $this->equalTo([ + [ + 'action' => 'block', + 'description' => 'Foobar', + 'filter' => [ + 'expression' => 'http.cookie eq "foobar"', + 'paused' => false + ], + 'paused' => false + ] + ]) + ); + + $firewall = new Cloudflare\API\Endpoints\Firewall($mock); + $options = new \Cloudflare\API\Configurations\FirewallRuleOptions(); + $options->setActionBlock(); + $result = $firewall->createFirewallRule( + '023e105f4ecef8ad9ca31a8372d0c353', + 'http.cookie eq "foobar"', + $options, + 'Foobar' + ); + $this->assertTrue($result); + } + + public function testListFirewallRules() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/listFirewallRules.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules'), + $this->equalTo([ + 'page' => 1, + 'per_page' => 50 + ]) + ); + + $firewall = new Cloudflare\API\Endpoints\Firewall($mock); + $result = $firewall->listFirewallRules('023e105f4ecef8ad9ca31a8372d0c353'); + + $this->assertObjectHasAttribute('result', $result); + $this->assertObjectHasAttribute('result_info', $result); + + $this->assertEquals('970b10321e3f4adda674c912b5f76591', $result->result[0]->id); + } + + public function testDeleteFirewallRule() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/deleteFirewallRule.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('delete')->willReturn($response); + + $mock->expects($this->once()) + ->method('delete') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules/970b10321e3f4adda674c912b5f76591') + ); + + $firewall = new Cloudflare\API\Endpoints\Firewall($mock); + $firewall->deleteFirewallRule('023e105f4ecef8ad9ca31a8372d0c353', '970b10321e3f4adda674c912b5f76591'); + } + + public function testUpdateFirewallRule() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateFirewallRule.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('put')->willReturn($response); + + $mock->expects($this->once()) + ->method('put') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules/970b10321e3f4adda674c912b5f76591'), + $this->equalTo([ + 'id' => '970b10321e3f4adda674c912b5f76591', + 'action' => 'block', + 'description' => 'Foo', + 'filter' => [ + 'id' => '5def9c4297e0466cb0736b838345d910', + 'expression' => 'http.cookie eq "foo"', + 'paused' => false + ], + 'paused' => false + ]) + ); + + $firewall = new Cloudflare\API\Endpoints\Firewall($mock); + $options = new \Cloudflare\API\Configurations\FirewallRuleOptions(); + $options->setActionBlock(); + $result = $firewall->updateFirewallRule( + '023e105f4ecef8ad9ca31a8372d0c353', + '970b10321e3f4adda674c912b5f76591', + '5def9c4297e0466cb0736b838345d910', + 'http.cookie eq "foo"', + $options, + 'Foo' + ); + $this->assertEquals('970b10321e3f4adda674c912b5f76591', $result->id); + } +} diff --git a/tests/Fixtures/Endpoints/createFirewallRule.json b/tests/Fixtures/Endpoints/createFirewallRule.json new file mode 100644 index 0000000..e00b22c --- /dev/null +++ b/tests/Fixtures/Endpoints/createFirewallRule.json @@ -0,0 +1,20 @@ +{ + "result": [ + { + "id": "970b10321e3f4adda674c912b5f76591", + "paused": false, + "description": "Foobar", + "action": "block", + "filter": { + "id": "70f39827184d487e97cc286b960f4cc3", + "expression": "http.cookie eq \"foobar\"", + "paused": false + }, + "created_on": "2019-07-05T15:53:15Z", + "modified_on": "2019-07-05T15:53:15Z" + } + ], + "success": true, + "errors": [], + "messages": [] +} diff --git a/tests/Fixtures/Endpoints/createFirewallRules.json b/tests/Fixtures/Endpoints/createFirewallRules.json new file mode 100644 index 0000000..0b08b18 --- /dev/null +++ b/tests/Fixtures/Endpoints/createFirewallRules.json @@ -0,0 +1,33 @@ +{ + "result": [ + { + "id": "970b10321e3f4adda674c912b5f76591", + "paused": false, + "description": "Foo", + "action": "block", + "filter": { + "id": "70f39827184d487e97cc286b960f4cc3", + "expression": "http.cookie eq \"foo\"", + "paused": false + }, + "created_on": "2019-07-05T15:53:15Z", + "modified_on": "2019-07-05T15:53:15Z" + }, + { + "id": "42c05fd0e0af4d17a361d2d1423476bc", + "paused": false, + "description": "Bar", + "action": "block", + "filter": { + "id": "246b4d9f5f51471485bdc95e1c6b53a7", + "expression": "http.cookie eq \"bar\"", + "paused": false + }, + "created_on": "2019-07-05T15:53:15Z", + "modified_on": "2019-07-05T15:53:15Z" + } + ], + "success": true, + "errors": [], + "messages": [] +} diff --git a/tests/Fixtures/Endpoints/deleteFirewallRule.json b/tests/Fixtures/Endpoints/deleteFirewallRule.json new file mode 100644 index 0000000..8a99884 --- /dev/null +++ b/tests/Fixtures/Endpoints/deleteFirewallRule.json @@ -0,0 +1,8 @@ +{ + "result": { + "id": "970b10321e3f4adda674c912b5f76591" + }, + "success": true, + "errors": [], + "messages": [] +} diff --git a/tests/Fixtures/Endpoints/listFirewallRules.json b/tests/Fixtures/Endpoints/listFirewallRules.json new file mode 100644 index 0000000..a343395 --- /dev/null +++ b/tests/Fixtures/Endpoints/listFirewallRules.json @@ -0,0 +1,27 @@ +{ + "result": [ + { + "id": "970b10321e3f4adda674c912b5f76591", + "paused": false, + "description": "Foobar", + "action": "block", + "filter": { + "id": "70f39827184d487e97cc286b960f4cc3", + "expression": "http.cookie eq \"foobar\"", + "paused": false + }, + "created_on": "2019-07-05T15:53:15Z", + "modified_on": "2019-07-05T15:53:15Z" + } + ], + "success": true, + "errors": [], + "messages": [], + "result_info": { + "page": 1, + "per_page": 50, + "count": 1, + "total_count": 1, + "total_pages": 1 + } +} diff --git a/tests/Fixtures/Endpoints/updateFirewallRule.json b/tests/Fixtures/Endpoints/updateFirewallRule.json new file mode 100644 index 0000000..27359e0 --- /dev/null +++ b/tests/Fixtures/Endpoints/updateFirewallRule.json @@ -0,0 +1,19 @@ +{ + "result": { + "id": "970b10321e3f4adda674c912b5f76591", + "paused": false, + "description": "Foo", + "action": "block", + "filter": { + "id": "5def9c4297e0466cb0736b838345d910", + "expression": "http.cookie eq \"foo\"", + "paused": false + }, + "created_on": "2019-07-05T15:53:15Z", + "modified_on": "2019-07-05T18:07:46Z", + "index": 1 + }, + "success": true, + "errors": [], + "messages": [] +} From 6a80cb69e29c8a93811acc54921d6b4088262c9e Mon Sep 17 00:00:00 2001 From: Martin Pecha Date: Tue, 30 Jul 2019 23:06:59 +0200 Subject: [PATCH 13/29] add api token support --- src/Auth/APIToken.php | 25 +++++++++++++++++++++++++ tests/Auth/APITokenTest.php | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/Auth/APIToken.php create mode 100644 tests/Auth/APITokenTest.php diff --git a/src/Auth/APIToken.php b/src/Auth/APIToken.php new file mode 100644 index 0000000..c1d20ff --- /dev/null +++ b/src/Auth/APIToken.php @@ -0,0 +1,25 @@ +apiToken = $apiToken; + } + + public function getHeaders(): array + { + return [ + 'Authorization' => 'Bearer ' . $this->apiToken + ]; + } +} diff --git a/tests/Auth/APITokenTest.php b/tests/Auth/APITokenTest.php new file mode 100644 index 0000000..dc6a470 --- /dev/null +++ b/tests/Auth/APITokenTest.php @@ -0,0 +1,21 @@ +getHeaders(); + + $this->assertArrayHasKey('Authorization', $headers); + + $this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']); + + $this->assertCount(1, $headers); + } +} From ecbe2fe5523e9cd349c50aa8a9aaa0e17be403d3 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 30 Jul 2019 23:19:31 +0200 Subject: [PATCH 14/29] fix codestyle --- src/Auth/APIToken.php | 22 +++++++++++----------- tests/Auth/APITokenTest.php | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Auth/APIToken.php b/src/Auth/APIToken.php index c1d20ff..7ec00cc 100644 --- a/src/Auth/APIToken.php +++ b/src/Auth/APIToken.php @@ -9,17 +9,17 @@ namespace Cloudflare\API\Auth; class APIToken implements Auth { - private $apiToken; + private $apiToken; - public function __construct(string $apiToken) - { - $this->apiToken = $apiToken; - } + public function __construct(string $apiToken) + { + $this->apiToken = $apiToken; + } - public function getHeaders(): array - { - return [ - 'Authorization' => 'Bearer ' . $this->apiToken - ]; - } + public function getHeaders(): array + { + return [ + 'Authorization' => 'Bearer ' . $this->apiToken + ]; + } } diff --git a/tests/Auth/APITokenTest.php b/tests/Auth/APITokenTest.php index dc6a470..9d6b82c 100644 --- a/tests/Auth/APITokenTest.php +++ b/tests/Auth/APITokenTest.php @@ -9,13 +9,13 @@ class APITokenTest extends TestCase { public function testGetHeaders() { - $auth = new \Cloudflare\API\Auth\APIToken('zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy'); - $headers = $auth->getHeaders(); + $auth = new \Cloudflare\API\Auth\APIToken('zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy'); + $headers = $auth->getHeaders(); - $this->assertArrayHasKey('Authorization', $headers); + $this->assertArrayHasKey('Authorization', $headers); - $this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']); + $this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']); - $this->assertCount(1, $headers); + $this->assertCount(1, $headers); } } From efae17f29db123d853d05ff8be45b8034926387e Mon Sep 17 00:00:00 2001 From: Martin Pecha Date: Tue, 30 Jul 2019 23:26:16 +0200 Subject: [PATCH 15/29] add api token support --- tests/Auth/APITokenTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Auth/APITokenTest.php b/tests/Auth/APITokenTest.php index 9d6b82c..ea7ec3c 100644 --- a/tests/Auth/APITokenTest.php +++ b/tests/Auth/APITokenTest.php @@ -1,9 +1,9 @@ Date: Mon, 12 Aug 2019 14:25:33 +0300 Subject: [PATCH 16/29] add endpoint for server-side exclude setting --- src/Endpoints/ZoneSettings.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Endpoints/ZoneSettings.php b/src/Endpoints/ZoneSettings.php index a32b84f..b7baf48 100644 --- a/src/Endpoints/ZoneSettings.php +++ b/src/Endpoints/ZoneSettings.php @@ -9,9 +9,12 @@ namespace Cloudflare\API\Endpoints; use Cloudflare\API\Adapter\Adapter; +use Cloudflare\API\Traits\BodyAccessorTrait; class ZoneSettings implements API { + use BodyAccessorTrait; + private $adapter; public function __construct(Adapter $adapter) @@ -75,6 +78,20 @@ class ZoneSettings implements API return false; } + public function getServerSideExcludeSetting($zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/server_side_exclude' + ); + $body = json_decode($return->getBody()); + + if ($body->success) { + return $body->result->value; + } + + return false; + } + public function getHotlinkProtectionSetting($zoneID) { $return = $this->adapter->get( @@ -177,4 +194,21 @@ class ZoneSettings implements API return false; } + + public function updateServerSideExcludeSetting($zoneID, $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/server_side_exclude', + [ + 'value' => $value + ] + ); + $body = json_decode($return->getBody()); + + if ($body->success) { + return $body->result->value; + } + + return false; + } } From c49409b978199a07e854978fd64bd38377eae41b Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 12 Aug 2019 15:00:34 +0300 Subject: [PATCH 17/29] add endpoint for server-side exclude setting --- composer.lock | 823 +++++++++++------- tests/Endpoints/ZoneSettingsTest.php | 39 + .../Endpoints/getServerSideExclude.json | 11 + .../Endpoints/updateServerSideExclude.json | 11 + 4 files changed, 570 insertions(+), 314 deletions(-) create mode 100644 tests/Endpoints/ZoneSettingsTest.php create mode 100644 tests/Fixtures/Endpoints/getServerSideExclude.json create mode 100644 tests/Fixtures/Endpoints/updateServerSideExclude.json diff --git a/composer.lock b/composer.lock index 0b8441f..f812c61 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9a243e606c74dcbd67ae934182df9d2c", + "content-hash": "8688d249424455bcfc940ba755ce0b6a", "packages": [ { "name": "guzzlehttp/guzzle", @@ -124,32 +124,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -179,13 +184,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "psr/http-message", @@ -236,21 +242,61 @@ "response" ], "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" } ], "packages-dev": [ { "name": "composer/semver", - "version": "1.4.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", "shasum": "" }, "require": { @@ -299,20 +345,20 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2019-03-19T17:25:45+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.3.0", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", "shasum": "" }, "require": { @@ -343,34 +389,34 @@ "Xdebug", "performance" ], - "time": "2018-08-31T19:07:57+00:00" + "time": "2019-05-27T17:52:04+00:00" }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7.5@dev" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -383,6 +429,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -391,10 +441,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -411,36 +457,38 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2019-08-08T18:11:40+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "a2c590166b2133a4633738648b6b064edae0814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", + "reference": "a2c590166b2133a4633738648b6b064edae0814a", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -460,39 +508,44 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-03-17T17:37:11+00:00" }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea", + "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -500,39 +553,42 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-07-30T19:33:28+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.13.1", + "version": "v2.15.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161" + "reference": "20064511ab796593a3990669eff5f5b535001f7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/54814c62d5beef3ba55297b9b3186ed8b8a1b161", - "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/20064511ab796593a3990669eff5f5b535001f7c", + "reference": "20064511ab796593a3990669eff5f5b535001f7c", "shasum": "" }, "require": { @@ -541,7 +597,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || >=7.0 <7.3", + "php": "^5.6 || ^7.0", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.17 || ^4.1.6", "symfony/event-dispatcher": "^3.0 || ^4.0", @@ -553,21 +609,18 @@ "symfony/process": "^3.0 || ^4.0", "symfony/stopwatch": "^3.0 || ^4.0" }, - "conflict": { - "hhvm": "*" - }, "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.1", + "keradus/cli-executor": "^1.2", "mikey179/vfsstream": "^1.6", "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", - "phpunitgoodpractices/traits": "^1.5.1", - "symfony/phpunit-bridge": "^4.0" + "phpunitgoodpractices/traits": "^1.8", + "symfony/phpunit-bridge": "^4.3" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", @@ -610,29 +663,32 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2018-10-21T00:32:10+00:00" + "time": "2019-06-01T10:32:12+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -655,7 +711,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "paragonie/random_compat", @@ -849,16 +905,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { @@ -896,7 +952,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -947,16 +1003,16 @@ }, { "name": "phpmd/phpmd", - "version": "2.6.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" + "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", - "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/a05a999c644f4bc9a204846017db7bb7809fbe4c", + "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c", "shasum": "" }, "require": { @@ -965,13 +1021,15 @@ "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "^4.0", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.27", "squizlabs/php_codesniffer": "^2.0" }, "bin": [ "src/bin/phpmd" ], - "type": "project", + "type": "library", "autoload": { "psr-0": { "PHPMD\\": "src/main/php" @@ -984,24 +1042,24 @@ "authors": [ { "name": "Manuel Pichler", + "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler", - "role": "Project Founder" - }, - { - "name": "Other contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", - "role": "Contributors" + "homepage": "https://github.com/manuelpichler" }, { "name": "Marc Würth", + "role": "Project Maintainer", "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84", - "role": "Project Maintainer" + "homepage": "https://github.com/ravage84" + }, + { + "name": "Other contributors", + "role": "Contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", - "homepage": "http://phpmd.org/", + "homepage": "https://phpmd.org/", "keywords": [ "mess detection", "mess detector", @@ -1009,20 +1067,20 @@ "phpmd", "pmd" ], - "time": "2017-01-20T14:41:10+00:00" + "time": "2019-07-30T21:13:32+00:00" }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "shasum": "" }, "require": { @@ -1043,8 +1101,8 @@ } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -1072,7 +1130,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-06-13T12:50:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1124,8 +1182,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", @@ -1172,8 +1230,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", @@ -1214,8 +1272,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "Simple template engine.", @@ -1263,8 +1321,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "Utility class for timing", @@ -1392,8 +1450,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "The PHP Unit Testing framework.", @@ -1462,6 +1520,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2017-06-30T09:13:00+00:00" }, { @@ -1515,16 +1574,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1558,7 +1617,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2065,8 +2124,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", @@ -2075,32 +2134,32 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "a17a2aea43950ce83a0603ed301bac362eb86870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/a17a2aea43950ce83a0603ed301bac362eb86870", + "reference": "a17a2aea43950ce83a0603ed301bac362eb86870", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/messenger": "~4.1", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -2108,7 +2167,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2135,41 +2194,47 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2019-07-18T10:34:59+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", + "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1" }, "conflict": { "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "^4.3", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0", + "symfony/var-dumper": "^4.3" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2177,7 +2242,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2204,94 +2269,40 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.17", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2019-07-24T17:13:59+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", + "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" + "php": "^7.1.3", + "psr/container": "^1.0", + "symfony/service-contracts": "^1.1.2" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", + "symfony/config": "<4.3", + "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/config": "^4.3", + "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -2304,7 +2315,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2331,34 +2342,41 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2019-07-26T07:03:43+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "212b020949331b6531250584531363844b34a94e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/212b020949331b6531250584531363844b34a94e", + "reference": "212b020949331b6531250584531363844b34a94e", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/event-dispatcher-contracts": "^1.1" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/http-foundation": "^3.4|^4.0", + "symfony/service-contracts": "^1.1", + "symfony/stopwatch": "~3.4|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2367,7 +2385,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2394,30 +2412,88 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2019-06-27T06:42:14+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.4.17", + "name": "symfony/event-dispatcher-contracts", + "version": "v1.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "c61766f4440ca687de1084a5c00b08e167a2575c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c61766f4440ca687de1084a5c00b08e167a2575c", + "reference": "c61766f4440ca687de1084a5c00b08e167a2575c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-06-20T06:46:26+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d", + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d", + "shasum": "" + }, + "require": { + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2444,29 +2520,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2019-06-23T08:51:25+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", + "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2493,29 +2569,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "time": "2019-06-28T13:16:30+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.17", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" + "reference": "40762ead607c8f792ee4516881369ffa553fee6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", - "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2547,20 +2623,20 @@ "configuration", "options" ], - "time": "2018-09-17T17:29:18+00:00" + "time": "2019-06-13T11:01:17+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { @@ -2572,7 +2648,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2588,13 +2664,13 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, { "name": "Gert de Pagter", "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -2605,20 +2681,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "shasum": "" }, "require": { @@ -2630,7 +2706,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2664,20 +2740,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.9.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + "reference": "54b4c428a0054e254223797d2713c31e08610831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", + "reference": "54b4c428a0054e254223797d2713c31e08610831", "shasum": "" }, "require": { @@ -2687,7 +2763,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2723,20 +2799,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.9.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae" + "reference": "04ce3335667451138df4307d6a9b61565560199e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/95c50420b0baed23852452a7f0c7b527303ed5ae", - "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", + "reference": "04ce3335667451138df4307d6a9b61565560199e", "shasum": "" }, "require": { @@ -2745,7 +2821,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2778,29 +2854,87 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/process", - "version": "v3.4.17", + "name": "symfony/polyfill-php73", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2019-08-06T08:03:45+00:00" + }, + { + "name": "symfony/process", + "version": "v4.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" } }, "autoload": { @@ -2827,29 +2961,88 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { - "name": "symfony/stopwatch", - "version": "v3.4.17", + "name": "symfony/service-contracts", + "version": "v1.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", - "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", + "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-06-13T11:15:36+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6b100e9309e8979cf1978ac1778eb155c1f7d93b", + "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/service-contracts": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" } }, "autoload": { @@ -2876,20 +3069,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2019-05-27T08:16:38+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.17", + "version": "v3.4.30", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "url": "https://api.github.com/repos/symfony/yaml/zipball/051d045c684148060ebfc9affb7e3f5e0899d40b", + "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b", "shasum": "" }, "require": { @@ -2935,24 +3128,25 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2019-07-24T13:01:31+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2985,7 +3179,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" } ], "aliases": [], @@ -2996,7 +3190,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0.0" + "php": ">=7.0.0", + "ext-json": "*" }, "platform-dev": [] } diff --git a/tests/Endpoints/ZoneSettingsTest.php b/tests/Endpoints/ZoneSettingsTest.php new file mode 100644 index 0000000..05bc2a7 --- /dev/null +++ b/tests/Endpoints/ZoneSettingsTest.php @@ -0,0 +1,39 @@ +getPsr7JsonResponseForFixture('Endpoints/getServerSideExclude.json'); + + $mock = $this->getMockBuilder(Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once())->method('get'); + + $zones = new ZoneSettings($mock); + $result = $zones->getServerSideExcludeSetting('023e105f4ecef8ad9ca31a8372d0c353'); + + $this->assertSame('on', $result); + } + + public function testUpdateServerSideExcludeSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateServerSideExclude.json'); + + $mock = $this->getMockBuilder(Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once())->method('patch'); + + $zones = new ZoneSettings($mock); + $result = $zones->updateServerSideExcludeSetting('023e105f4ecef8ad9ca31a8372d0c353', 'on'); + + $this->assertSame('on', $result); + } +} diff --git a/tests/Fixtures/Endpoints/getServerSideExclude.json b/tests/Fixtures/Endpoints/getServerSideExclude.json new file mode 100644 index 0000000..8da6ab1 --- /dev/null +++ b/tests/Fixtures/Endpoints/getServerSideExclude.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "server_side_exclude", + "value": "on", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} diff --git a/tests/Fixtures/Endpoints/updateServerSideExclude.json b/tests/Fixtures/Endpoints/updateServerSideExclude.json new file mode 100644 index 0000000..8da6ab1 --- /dev/null +++ b/tests/Fixtures/Endpoints/updateServerSideExclude.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "server_side_exclude", + "value": "on", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} From 39b2f2fd2a5b8bcb1a531b40fde13373dae61e58 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 12 Aug 2019 15:02:10 +0300 Subject: [PATCH 18/29] add endpoint for server-side exclude setting --- composer.lock | 817 +++++++++++++++++++------------------------------- 1 file changed, 311 insertions(+), 506 deletions(-) diff --git a/composer.lock b/composer.lock index f812c61..0b8441f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8688d249424455bcfc940ba755ce0b6a", + "content-hash": "9a243e606c74dcbd67ae934182df9d2c", "packages": [ { "name": "guzzlehttp/guzzle", @@ -124,37 +124,32 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "psr/http-message": "~1.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" - }, - "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -184,14 +179,13 @@ "keywords": [ "http", "message", - "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "psr/http-message", @@ -242,61 +236,21 @@ "response" ], "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2019-03-08T08:55:37+00:00" } ], "packages-dev": [ { "name": "composer/semver", - "version": "1.5.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", "shasum": "" }, "require": { @@ -345,20 +299,20 @@ "validation", "versioning" ], - "time": "2019-03-19T17:25:45+00:00" + "time": "2016-08-30T16:08:34+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.3.3", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", "shasum": "" }, "require": { @@ -389,34 +343,34 @@ "Xdebug", "performance" ], - "time": "2019-05-27T17:52:04+00:00" + "time": "2018-08-31T19:07:57+00:00" }, { "name": "doctrine/annotations", - "version": "v1.7.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^7.1" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5@dev" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -429,10 +383,6 @@ "MIT" ], "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -441,6 +391,10 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -457,38 +411,36 @@ "docblock", "parser" ], - "time": "2019-08-08T18:11:40+00:00" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -508,44 +460,39 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "doctrine/lexer", - "version": "1.1.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea" + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", "shasum": "" }, "require": { - "php": "^7.2" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "php": ">=5.3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -553,42 +500,39 @@ "MIT" ], "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "annotations", - "docblock", "lexer", - "parser", - "php" + "parser" ], - "time": "2019-07-30T19:33:28+00:00" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.15.1", + "version": "v2.13.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "20064511ab796593a3990669eff5f5b535001f7c" + "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/20064511ab796593a3990669eff5f5b535001f7c", - "reference": "20064511ab796593a3990669eff5f5b535001f7c", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/54814c62d5beef3ba55297b9b3186ed8b8a1b161", + "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161", "shasum": "" }, "require": { @@ -597,7 +541,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0", + "php": "^5.6 || >=7.0 <7.3", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.17 || ^4.1.6", "symfony/event-dispatcher": "^3.0 || ^4.0", @@ -609,18 +553,21 @@ "symfony/process": "^3.0 || ^4.0", "symfony/stopwatch": "^3.0 || ^4.0" }, + "conflict": { + "hhvm": "*" + }, "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.2", + "keradus/cli-executor": "^1.1", "mikey179/vfsstream": "^1.6", "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", - "phpunitgoodpractices/traits": "^1.8", - "symfony/phpunit-bridge": "^4.3" + "phpunitgoodpractices/traits": "^1.5.1", + "symfony/phpunit-bridge": "^4.0" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", @@ -663,32 +610,29 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-06-01T10:32:12+00:00" + "time": "2018-10-21T00:32:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { @@ -711,7 +655,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2017-10-19T19:58:43+00:00" }, { "name": "paragonie/random_compat", @@ -905,16 +849,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { @@ -952,7 +896,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1003,16 +947,16 @@ }, { "name": "phpmd/phpmd", - "version": "2.7.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c" + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/a05a999c644f4bc9a204846017db7bb7809fbe4c", - "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", "shasum": "" }, "require": { @@ -1021,15 +965,13 @@ "php": ">=5.3.9" }, "require-dev": { - "gregwar/rst": "^1.0", - "mikey179/vfsstream": "^1.6.4", - "phpunit/phpunit": "^4.8.36 || ^5.7.27", + "phpunit/phpunit": "^4.0", "squizlabs/php_codesniffer": "^2.0" }, "bin": [ "src/bin/phpmd" ], - "type": "library", + "type": "project", "autoload": { "psr-0": { "PHPMD\\": "src/main/php" @@ -1042,24 +984,24 @@ "authors": [ { "name": "Manuel Pichler", - "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler" - }, - { - "name": "Marc Würth", - "role": "Project Maintainer", - "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84" + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" }, { "name": "Other contributors", - "role": "Contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", - "homepage": "https://phpmd.org/", + "homepage": "http://phpmd.org/", "keywords": [ "mess detection", "mess detector", @@ -1067,20 +1009,20 @@ "phpmd", "pmd" ], - "time": "2019-07-30T21:13:32+00:00" + "time": "2017-01-20T14:41:10+00:00" }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { @@ -1101,8 +1043,8 @@ } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" + "psr-0": { + "Prophecy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1130,7 +1072,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1182,8 +1124,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sb@sebastian-bergmann.de" + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", @@ -1230,8 +1172,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sb@sebastian-bergmann.de" + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", @@ -1272,8 +1214,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Simple template engine.", @@ -1321,8 +1263,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sb@sebastian-bergmann.de" + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], "description": "Utility class for timing", @@ -1450,8 +1392,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "The PHP Unit Testing framework.", @@ -1520,7 +1462,6 @@ "mock", "xunit" ], - "abandoned": true, "time": "2017-06-30T09:13:00+00:00" }, { @@ -1574,16 +1515,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, "require": { @@ -1617,7 +1558,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2124,8 +2065,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", @@ -2134,32 +2075,32 @@ }, { "name": "symfony/config", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a17a2aea43950ce83a0603ed301bac362eb86870" + "reference": "e5389132dc6320682de3643091121c048ff796b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a17a2aea43950ce83a0603ed301bac362eb86870", - "reference": "a17a2aea43950ce83a0603ed301bac362eb86870", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0", + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<3.4" + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" }, "require-dev": { - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/messenger": "~4.1", - "symfony/yaml": "~3.4|~4.0" + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -2167,7 +2108,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2194,47 +2135,41 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-07-18T10:34:59+00:00" + "time": "2018-09-08T13:15:14+00:00" }, { "name": "symfony/console", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9" + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", + "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", "symfony/process": "<3.3" }, - "provide": { - "psr/log-implementation": "1.0" - }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" + "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2242,7 +2177,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2269,40 +2204,94 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-07-24T17:13:59+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v4.3.3", + "name": "symfony/debug", + "version": "v3.4.17", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b" + "url": "https://github.com/symfony/debug.git", + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", - "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", + "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", "shasum": "" }, "require": { - "php": "^7.1.3", - "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.2" + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" }, "conflict": { - "symfony/config": "<4.3", - "symfony/finder": "<3.4", + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.4.17", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "aea20fef4e92396928b5db175788b90234c0270d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", + "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" + }, + "conflict": { + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0" + "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "^4.3", - "symfony/expression-language": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -2315,7 +2304,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2342,41 +2331,34 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-07-26T07:03:43+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "212b020949331b6531250584531363844b34a94e" + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/212b020949331b6531250584531363844b34a94e", - "reference": "212b020949331b6531250584531363844b34a94e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": "^5.5.9|>=7.0.8" }, "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "^3.4|^4.0", - "symfony/service-contracts": "^1.1", - "symfony/stopwatch": "~3.4|~4.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2385,7 +2367,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2412,88 +2394,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-06-27T06:42:14+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "c61766f4440ca687de1084a5c00b08e167a2575c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c61766f4440ca687de1084a5c00b08e167a2575c", - "reference": "c61766f4440ca687de1084a5c00b08e167a2575c", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-06-20T06:46:26+00:00" + "time": "2018-07-26T09:06:28+00:00" }, { "name": "symfony/filesystem", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d", - "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2520,29 +2444,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-06-23T08:51:25+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/finder", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2569,29 +2493,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f" + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2623,20 +2547,20 @@ "configuration", "options" ], - "time": "2019-06-13T11:01:17+00:00" + "time": "2018-09-17T17:29:18+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { @@ -2648,7 +2572,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2664,13 +2588,13 @@ "MIT" ], "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -2681,20 +2605,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -2706,7 +2630,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2740,20 +2664,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", "shasum": "" }, "require": { @@ -2763,7 +2687,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2799,20 +2723,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/95c50420b0baed23852452a7f0c7b527303ed5ae", + "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae", "shasum": "" }, "require": { @@ -2821,7 +2745,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2854,87 +2778,29 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.12.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", + "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2961,88 +2827,29 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v1.1.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-06-13T11:15:36+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.3", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b" + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6b100e9309e8979cf1978ac1778eb155c1f7d93b", - "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3069,20 +2876,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-05-27T08:16:38+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.30", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/051d045c684148060ebfc9affb7e3f5e0899d40b", - "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { @@ -3128,25 +2935,24 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-07-24T13:01:31+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "webmozart/assert", - "version": "1.4.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -3179,7 +2985,7 @@ "check", "validate" ], - "time": "2018-12-25T11:19:39+00:00" + "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], @@ -3190,8 +2996,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0.0", - "ext-json": "*" + "php": ">=7.0.0" }, "platform-dev": [] } From 1be0e794d93a8c372448d2c97794884df693de3f Mon Sep 17 00:00:00 2001 From: Pezhvak Date: Tue, 3 Dec 2019 17:29:32 +0330 Subject: [PATCH 19/29] Update DNS.php fixing php 7.4 deprecation of curly braces --- src/Endpoints/DNS.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/DNS.php b/src/Endpoints/DNS.php index 65dc4a4..c3609e9 100644 --- a/src/Endpoints/DNS.php +++ b/src/Endpoints/DNS.php @@ -128,8 +128,8 @@ class DNS implements API public function getRecordID(string $zoneID, string $type = '', string $name = ''): string { $records = $this->listRecords($zoneID, $type, $name); - if (isset($records->result{0}->id)) { - return $records->result{0}->id; + if (isset($records->result[0]->id)) { + return $records->result[0]->id; } return false; } From f4c2f546b0ca75c70a5ca1cce50962003848fafb Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Sat, 14 Dec 2019 15:24:43 +0800 Subject: [PATCH 20/29] Feature: add lock and unlock domain --- src/Endpoints/Accounts.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index fd42189..2264534 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -58,4 +58,18 @@ class Accounts implements API return $this->body->result; } + + public function lockDomain(string $accountID, string $domainName): array + { + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains' . $domainName, ["locked" => true]); + $this->body = json_decode($response->getBody()); + return $this->body; + } + + public function unlockDomain(string $accountID, string $domainName): array + { + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains' . $domainName, ["locked" => false]); + $this->body = json_decode($response->getBody()); + return $this->body; + } } From d918f7b99e8eab0f89265f2177118f74c52fe9b0 Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Sat, 14 Dec 2019 15:36:38 +0800 Subject: [PATCH 21/29] fix typo --- src/Endpoints/Accounts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index 2264534..9509feb 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -52,7 +52,7 @@ class Accounts implements API public function getDomainDetails(string $accountID, string $domainName): array { - $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains' . $domainName); + $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains/' . $domainName); $this->body = json_decode($response->getBody()); @@ -61,14 +61,14 @@ class Accounts implements API public function lockDomain(string $accountID, string $domainName): array { - $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains' . $domainName, ["locked" => true]); + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => true]); $this->body = json_decode($response->getBody()); return $this->body; } public function unlockDomain(string $accountID, string $domainName): array { - $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains' . $domainName, ["locked" => false]); + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => false]); $this->body = json_decode($response->getBody()); return $this->body; } From f0892ac64fb63c794c654ffe66d59505b4ced3ba Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Sat, 14 Dec 2019 15:40:29 +0800 Subject: [PATCH 22/29] fix return type --- src/Endpoints/Accounts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index 9509feb..1bfd61f 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -50,7 +50,7 @@ class Accounts implements API return $this->body->result; } - public function getDomainDetails(string $accountID, string $domainName): array + public function getDomainDetails(string $accountID, string $domainName): \stdClass { $response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains/' . $domainName); @@ -59,14 +59,14 @@ class Accounts implements API return $this->body->result; } - public function lockDomain(string $accountID, string $domainName): array + public function lockDomain(string $accountID, string $domainName): \stdClass { $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => true]); $this->body = json_decode($response->getBody()); return $this->body; } - public function unlockDomain(string $accountID, string $domainName): array + public function unlockDomain(string $accountID, string $domainName): \stdClass { $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => false]); $this->body = json_decode($response->getBody()); From b54c3481a39f01bc372c98fc287fca45ec9b8a2d Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 16 Dec 2019 17:39:29 +0800 Subject: [PATCH 23/29] fix typo in test case --- tests/Endpoints/ZonesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Endpoints/ZonesTest.php b/tests/Endpoints/ZonesTest.php index d0158bf..906d01a 100644 --- a/tests/Endpoints/ZonesTest.php +++ b/tests/Endpoints/ZonesTest.php @@ -61,7 +61,7 @@ class ZonesTest extends TestCase ->with( $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41'), $this->equalTo([ - 'pause' => true, + 'paused' => true, ]) ); From b9051fc1f2d32b52a4dbad173b636e6eb7966c97 Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 16 Dec 2019 17:55:48 +0800 Subject: [PATCH 24/29] fix lint --- src/Endpoints/Accounts.php | 4 ++-- src/Endpoints/Zones.php | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Endpoints/Accounts.php b/src/Endpoints/Accounts.php index 1bfd61f..4d4d80a 100644 --- a/src/Endpoints/Accounts.php +++ b/src/Endpoints/Accounts.php @@ -61,14 +61,14 @@ class Accounts implements API public function lockDomain(string $accountID, string $domainName): \stdClass { - $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => true]); + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ['locked' => true]); $this->body = json_decode($response->getBody()); return $this->body; } public function unlockDomain(string $accountID, string $domainName): \stdClass { - $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => false]); + $response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ['locked' => false]); $this->body = json_decode($response->getBody()); return $this->body; } diff --git a/src/Endpoints/Zones.php b/src/Endpoints/Zones.php index bbd3564..19390b1 100644 --- a/src/Endpoints/Zones.php +++ b/src/Endpoints/Zones.php @@ -58,12 +58,9 @@ class Zones implements API return false; } - public function pause(string $zoneID, bool $paused = true): bool + public function pause(string $zoneID): bool { - $options = [ - 'paused' => $paused, - ]; - $user = $this->adapter->patch('zones/' . $zoneID, $options); + $user = $this->adapter->patch('zones/' . $zoneID, ['paused' => true]); $this->body = json_decode($user->getBody()); if (isset($this->body->result->id)) { @@ -72,7 +69,19 @@ class Zones implements API return false; } - + + public function unpause(string $zoneID): bool + { + $user = $this->adapter->patch('zones/' . $zoneID, ['paused' => false]); + $this->body = json_decode($user->getBody()); + + if (isset($this->body->result->id)) { + return true; + } + + return false; + } + public function getZoneById( string $zoneId ): \stdClass { From 6e6a850d623e02fbf2bfe9b5c23eab59ec413c4a Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 16 Dec 2019 17:58:04 +0800 Subject: [PATCH 25/29] fix test case --- tests/Endpoints/ZonesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Endpoints/ZonesTest.php b/tests/Endpoints/ZonesTest.php index 906d01a..d44e169 100644 --- a/tests/Endpoints/ZonesTest.php +++ b/tests/Endpoints/ZonesTest.php @@ -66,7 +66,7 @@ class ZonesTest extends TestCase ); $zones = new \Cloudflare\API\Endpoints\Zones($mock); - $result = $zones->pause('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); + $result = $zones->pause('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); $this->assertTrue($result); $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $zones->getBody()->result->id); From 9d0df448383f92776ea24552e9b94fefe4a43436 Mon Sep 17 00:00:00 2001 From: Kyle Yee Date: Mon, 16 Dec 2019 18:02:49 +0800 Subject: [PATCH 26/29] remove test --- tests/Endpoints/ZonesTest.php | 23 ----------------------- tests/Fixtures/Endpoints/pauseTest.json | 8 -------- 2 files changed, 31 deletions(-) delete mode 100644 tests/Fixtures/Endpoints/pauseTest.json diff --git a/tests/Endpoints/ZonesTest.php b/tests/Endpoints/ZonesTest.php index d44e169..f6b75fc 100644 --- a/tests/Endpoints/ZonesTest.php +++ b/tests/Endpoints/ZonesTest.php @@ -49,29 +49,6 @@ class ZonesTest extends TestCase $this->assertEquals('9a7806061c88ada191ed06f989cc3dac', $zones->getBody()->result->id); } - public function testPauseTest() - { - $response = $this->getPsr7JsonResponseForFixture('Endpoints/pauseTest.json'); - - $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); - $mock->method('patch')->willReturn($response); - - $mock->expects($this->once()) - ->method('patch') - ->with( - $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41'), - $this->equalTo([ - 'paused' => true, - ]) - ); - - $zones = new \Cloudflare\API\Endpoints\Zones($mock); - $result = $zones->pause('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); - - $this->assertTrue($result); - $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $zones->getBody()->result->id); - } - public function testActivationTest() { $response = $this->getPsr7JsonResponseForFixture('Endpoints/activationTest.json'); diff --git a/tests/Fixtures/Endpoints/pauseTest.json b/tests/Fixtures/Endpoints/pauseTest.json deleted file mode 100644 index bedd2f5..0000000 --- a/tests/Fixtures/Endpoints/pauseTest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "success": true, - "errors": [], - "messages": [], - "result": { - "id": "023e105f4ecef8ad9ca31a8372d0c353" - } -} From adfb6d28d2be552da7d18664b83000b860c8d734 Mon Sep 17 00:00:00 2001 From: Pezhvak Date: Fri, 20 Dec 2019 17:12:58 +0330 Subject: [PATCH 27/29] Update SSLTest.php fixed curly braces in this file as @aaronhuisinga reported --- tests/Endpoints/SSLTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Endpoints/SSLTest.php b/tests/Endpoints/SSLTest.php index 1f0fc53..c2a1b40 100644 --- a/tests/Endpoints/SSLTest.php +++ b/tests/Endpoints/SSLTest.php @@ -38,7 +38,7 @@ class SSLTest extends TestCase $result = $sslMock->getSSLVerificationStatus('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); $this->assertObjectHasAttribute('result', $result); - $this->assertEquals('active', $result->result{0}->certificate_status); + $this->assertEquals('active', $result->result[0]->certificate_status); } public function testGetHTTPSRedirectSetting() From ed91e639be2dfa0babaecea287706a313b151e51 Mon Sep 17 00:00:00 2001 From: Abhay Saraf Date: Tue, 28 Jan 2020 11:11:05 +0530 Subject: [PATCH 28/29] Adding new function setOriginCacheControl as a new page rule action. --- src/Configurations/PageRulesActions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Configurations/PageRulesActions.php b/src/Configurations/PageRulesActions.php index 359d3c7..70b4b3a 100755 --- a/src/Configurations/PageRulesActions.php +++ b/src/Configurations/PageRulesActions.php @@ -33,6 +33,13 @@ class PageRulesActions implements Configurations ]); } + public function setOriginCacheControl(bool $active) + { + $this->addConfigurationOption('explicit_cache_control', [ + 'value' => $this->getBoolAsOnOrOff($active) + ]); + } + public function setBrowserIntegrityCheck(bool $active) { $this->addConfigurationOption('browser_check', [ From f2e0d6cbe3e3fd57fb7d33aabc61f86fda7e427e Mon Sep 17 00:00:00 2001 From: Abhay Saraf Date: Tue, 28 Jan 2020 15:26:35 +0530 Subject: [PATCH 29/29] Adding new function editPageRule to allow put method to support removal of rule settings or rule action items from the page rule which is not supported by updatePageRule. --- src/Endpoints/PageRules.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/Endpoints/PageRules.php b/src/Endpoints/PageRules.php index c8480f4..c7e5964 100644 --- a/src/Endpoints/PageRules.php +++ b/src/Endpoints/PageRules.php @@ -109,6 +109,37 @@ class PageRules implements API return $this->body->result; } + public function editPageRule( + string $zoneID, + string $ruleID, + PageRulesTargets $target, + PageRulesActions $actions, + bool $active = null, + int $priority = null + ): bool { + $options = []; + $options['targets'] = $target->getArray(); + $options['actions'] = $actions->getArray(); + + if ($active !== null) { + $options['status'] = $active == true ? 'active' : 'disabled'; + } + + if ($priority !== null) { + $options['priority'] = $priority; + } + + $query = $this->adapter->put('zones/' . $zoneID . '/pagerules/' . $ruleID, $options); + + $this->body = json_decode($query->getBody()); + + if (isset($this->body->result->id)) { + return true; + } + + return false; + } + public function updatePageRule( string $zoneID, string $ruleID,