From 3ed98f76ac8be14c6aa503f852780970dcb01ab6 Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Tue, 30 Oct 2018 10:54:05 +0100 Subject: [PATCH] Fix the code style of all files --- .gitignore | 1 + .travis.yml | 37 +++++++++++------- composer.json | 1 + phpunit.xml.dist | 18 +++++---- .../CloseIoApiWrapper/Api/ActivityApi.php | 11 +++--- .../CloseIoApiWrapper/Api/CallActivityApi.php | 11 +++--- .../CloseIoApiWrapper/Api/ContactApi.php | 15 ++++---- .../CloseIoApiWrapper/Api/CustomFieldApi.php | 11 +++--- .../Api/EmailActivityApi.php | 11 +++--- .../CloseIoApiWrapper/Api/LeadApi.php | 17 +++++---- .../CloseIoApiWrapper/Api/LeadStatusApi.php | 13 ++++--- .../CloseIoApiWrapper/Api/NoteActivityApi.php | 11 +++--- .../CloseIoApiWrapper/Api/OpportunityApi.php | 13 ++++--- .../Api/OpportunityStatusApi.php | 13 ++++--- .../CloseIoApiWrapper/Api/SmsActivityApi.php | 12 +++--- .../CloseIoApiWrapper/Api/TaskApi.php | 17 +++++---- .../CloseIoApiWrapper/Api/UserApi.php | 11 +++--- .../CloseIoApiWrapper/Client.php | 13 ++++--- .../CloseIoApiWrapper/ClientInterface.php | 9 +++-- .../CloseIoApiWrapper/CloseIoApiWrapper.php | 9 +++-- .../CloseIoApiWrapper/CloseIoRequest.php | 17 +++++---- .../CloseIoApiWrapper/CloseIoResponse.php | 11 +++--- .../CloseIoApiWrapper/Configuration.php | 13 ++++--- .../CloseIoAuthenticationException.php | 9 +++-- .../Exception/CloseIoBadRequestException.php | 9 +++-- .../Exception/CloseIoException.php | 9 +++-- .../CloseIoResourceNotFoundException.php | 9 +++-- .../Exception/CloseIoResponseException.php | 9 +++-- .../Exception/CloseIoThrottleException.php | 9 +++-- .../Exception/InvalidHttpMethodException.php | 9 +++-- .../Exception/JsonException.php | 9 +++-- .../Library/Api/AbstractApi.php | 16 ++++++-- .../InvalidNewLeadPropertyException.php | 11 ++++-- .../Exception/InvalidParamException.php | 11 ++++-- .../Library/Exception/InvalidUrlException.php | 11 ++++-- .../Library/JsonSerializableHelperTrait.php | 18 +++++---- .../Library/ObjectHydrateHelperTrait.php | 17 +++++---- .../CloseIoApiWrapper/Model/Activity.php | 10 +++-- .../CloseIoApiWrapper/Model/Address.php | 17 +++++++-- .../CloseIoApiWrapper/Model/CallActivity.php | 10 +++-- .../CloseIoApiWrapper/Model/Contact.php | 37 +++++++++++++----- .../CloseIoApiWrapper/Model/CustomField.php | 14 ++++--- .../CloseIoApiWrapper/Model/Email.php | 18 ++++++--- .../CloseIoApiWrapper/Model/EmailActivity.php | 30 +++++++++++++-- .../CloseIoApiWrapper/Model/Lead.php | 34 +++++++++++++++-- .../CloseIoApiWrapper/Model/LeadStatus.php | 18 +++++++-- .../CloseIoApiWrapper/Model/NoteActivity.php | 10 +++-- .../CloseIoApiWrapper/Model/Opportunity.php | 38 ++++++++++++++++--- .../Model/OpportunityStatus.php | 20 ++++++++-- .../CloseIoApiWrapper/Model/Phone.php | 13 +++++-- .../CloseIoApiWrapper/Model/SmsActivity.php | 10 +++-- .../CloseIoApiWrapper/Model/Task.php | 30 +++++++++++++-- .../CloseIoApiWrapper/Model/Url.php | 12 ++++-- .../CloseIoApiWrapper/Model/User.php | 20 ++++++---- .../Api/CustomFieldApiTest.php | 23 +++++++---- .../CloseIoApiWrapper/Api/LeadsApiTest.php | 31 ++++++++++----- .../CloseIoApiWrapper/ClientTest.php | 9 +++-- .../CloseIoApiWrapperTest.php | 9 +++-- .../CloseIoApiWrapper/CloseIoRequestTest.php | 9 +++-- .../CloseIoApiWrapper/CloseIoResponseTest.php | 11 +++--- .../CloseIoApiWrapper/ConfigurationTest.php | 9 +++-- .../Library/Fake/ObjectHydrateHelperDemo.php | 14 ++++--- .../Library/ObjectHydrateHelperTraitTest.php | 10 +++-- .../CloseIoApiWrapper/Model/EmailTest.php | 10 +++-- .../CloseIoApiWrapper/Model/PhoneTest.php | 10 +++-- .../CloseIoApiWrapper/Model/UrlTest.php | 10 +++-- tests/bootstrap.php | 9 +++-- 67 files changed, 629 insertions(+), 327 deletions(-) diff --git a/.gitignore b/.gitignore index 945e348..cbc3e76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/ build/ /composer.lock +/.php_cs.cache diff --git a/.travis.yml b/.travis.yml index f7a637d..a14ba09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,12 @@ language: php -sudo: false - php: - - 7.1 - - 7.2 - - nightly + - 7.1 + - 7.2 env: - - dependencies=lowest - - dependencies=highest + - dependencies=lowest + - dependencies=highest matrix: fast_finish: true @@ -22,7 +19,8 @@ cache: stages: - Code style & static analysis - - test + - Test + - Code coverage jobs: include: @@ -31,13 +29,26 @@ jobs: script: composer phpcs - script: composer phpstan name: PHPStan - + - stage: Test + php: nightly + allow_failure: true + env: dependencies=lowest + before_install: + - composer remove --dev friendsofphp/php-cs-fixer # This is needed until PHP-CS-Fixer becames compatible with PHP 7.4 + - php: nightly + allow_failure: true + env: dependencies=highest + before_install: + - composer remove --dev friendsofphp/php-cs-fixer # This is needed until PHP-CS-Fixer becames compatible with PHP 7.4 + - stage: Code coverage + php: 7.2 + env: dependencies=highest + script: vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml + after_success: + - travis_retry php vendor/bin/php-coveralls --verbose install: - - if [ "$dependencies" = "lowest" ]; then composer update --no-interaction --prefer-lowest --prefer-dist; fi; + - if [ "$dependencies" = "lowest" ]; then composer update --no-interaction --prefer-lowest --prefer-dist; fi; - if [ "$dependencies" = "highest" ]; then composer update --no-interaction --prefer-dist; fi; script: - composer tests - -after_success: - - php vendor/bin/php-coveralls -v diff --git a/composer.json b/composer.json index ee8ded7..7f54115 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ "phpunit/phpunit": "^7.3.1", "psr/http-message-implementation": "^1.0", "symfony/options-resolver": "^3.0|^4.0", + "symfony/phpunit-bridge": "^4.1", "webmozart/assert": "^1.3" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d3ebfc7..e8a2832 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,20 +1,18 @@ + + + + - src + src @@ -23,4 +21,8 @@ tests + + + + diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/ActivityApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/ActivityApi.php index 29b6685..d52bb22 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/ActivityApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/ActivityApi.php @@ -1,15 +1,16 @@ '/status/lead/', 'get-status' => '/status/lead/[:id]/', 'update-status' => '/status/lead/[:id]/', - 'delete-status' => '/status/lead/[:id]/' + 'delete-status' => '/status/lead/[:id]/', ]; } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/NoteActivityApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/NoteActivityApi.php index 7593373..cd16348 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/NoteActivityApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/NoteActivityApi.php @@ -1,15 +1,16 @@ '/opportunity/', 'get-opportunity' => '/opportunity/[:id]/', 'update-opportunity' => '/opportunity/[:id]/', - 'delete-opportunity' => '/opportunity/[:id]/' + 'delete-opportunity' => '/opportunity/[:id]/', ]; } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/OpportunityStatusApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/OpportunityStatusApi.php index 41e9239..905cb45 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/OpportunityStatusApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/OpportunityStatusApi.php @@ -1,15 +1,16 @@ '/status/opportunity/', 'get-status' => '/status/opportunity/[:id]/', 'update-status' => '/status/opportunity/[:id]/', - 'delete-status' => '/status/opportunity/[:id]/' + 'delete-status' => '/status/opportunity/[:id]/', ]; } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/SmsActivityApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/SmsActivityApi.php index c3e2c18..236ed7f 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/SmsActivityApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/SmsActivityApi.php @@ -1,15 +1,16 @@ client->get($this->prepareUrlForKey('list-sms'), array_merge($filters, [ diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/TaskApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/TaskApi.php index 360f96d..d76d2bc 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/TaskApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/TaskApi.php @@ -1,15 +1,16 @@ '/task/', 'get-task' => '/task/[:id]/', 'update-task' => '/task/[:id]/', - 'delete-task' => '/task/[:id]/' + 'delete-task' => '/task/[:id]/', ]; } /** * Gets up to the specified number of tasks that matches the given criteria. * - * @param int $offset The offset from which start getting the items - * @param int $limit The maximum number of items to get + * @param int $offset The offset from which start getting the items + * @param int $limit The maximum number of items to get * @param string[] $fields The subset of fields to get (defaults to all) * * @return Task[] diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/UserApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/UserApi.php index 67016ec..5128d3e 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/UserApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/UserApi.php @@ -1,15 +1,16 @@ method, [RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PUT], true)) { + if (\in_array($this->method, [RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PUT], true)) { return $this->params; } @@ -121,7 +122,7 @@ public function getUrl(): string { $url = $this->endpoint; - if (in_array($this->method, [RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PUT], true)) { + if (\in_array($this->method, [RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PUT], true)) { $url = $this->appendParamsToUrl($url, $this->params); } @@ -148,7 +149,7 @@ protected function appendParamsToUrl(string $url, array $params): string // If the _fields param is set transform it to a single string so that // it's not urlencoded as an array - if (isset($params['_fields']) && is_array($params['_fields'])) { + if (isset($params['_fields']) && \is_array($params['_fields'])) { $params['_fields'] = array_unique(array_merge($params['_fields'], ['id'])); $params['_fields'] = implode(',', $params['_fields']); } diff --git a/src/LooplineSystems/CloseIoApiWrapper/CloseIoResponse.php b/src/LooplineSystems/CloseIoApiWrapper/CloseIoResponse.php index 4c36bca..423bd44 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/CloseIoResponse.php +++ b/src/LooplineSystems/CloseIoApiWrapper/CloseIoResponse.php @@ -1,15 +1,16 @@ decodedBody)) { + if (!\is_array($this->decodedBody)) { $this->decodedBody = []; } } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Configuration.php b/src/LooplineSystems/CloseIoApiWrapper/Configuration.php index 1e571c3..1c52b91 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Configuration.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Configuration.php @@ -1,15 +1,16 @@ $value) { $url = $this->prepareUrlSingle($parameter, $value, $url); } + return $url; } /** * @param string $key + * * @return string $url */ protected function getUrlForKey($key) diff --git a/src/LooplineSystems/CloseIoApiWrapper/Library/Exception/InvalidNewLeadPropertyException.php b/src/LooplineSystems/CloseIoApiWrapper/Library/Exception/InvalidNewLeadPropertyException.php index 2f3b007..9c4d74f 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Library/Exception/InvalidNewLeadPropertyException.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Library/Exception/InvalidNewLeadPropertyException.php @@ -1,15 +1,18 @@ - $value) { - if (!$value) { continue; } - if (!in_array($key, $nestedObjects)) { + if (!\in_array($key, $nestedObjects)) { // get setter method for each key in data $setter = 'set' . Inflector::classify($key); if (method_exists($this, $setter)) { $this->$setter($value); } else { // check if setter method exists that doesn't match inflected filter format - if (in_array($setter, array_keys($method_mapper))) { + if (\in_array($setter, array_keys($method_mapper))) { $this->{$method_mapper[$setter]}($value); } else { // value is not set - Entities should be extended if needed @@ -48,7 +51,7 @@ public function hydrate(array $data, array $nestedObjects = [], array $method_ma // if empty then ignore if (!empty($data[$currentNestedObject])) { // if is not array then throw exception - if (is_array($data[$currentNestedObject])) { + if (\is_array($data[$currentNestedObject])) { // rename for clarity $nestedObject = $data[$currentNestedObject]; $NestedObjectCollection = []; diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/Activity.php b/src/LooplineSystems/CloseIoApiWrapper/Model/Activity.php index 5b9a174..4fff335 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/Activity.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/Activity.php @@ -1,12 +1,16 @@ -choices)) { + if (!\in_array($choice, $this->choices)) { $this->choices[] = $choice; } @@ -202,7 +206,7 @@ public function removeChoice($choice) { $index = array_search($choice, $this->choices); - if ($index !== false) { + if (false !== $index) { unset($this->choices[$index]); } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/Email.php b/src/LooplineSystems/CloseIoApiWrapper/Model/Email.php index 7e770a0..d5cc113 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/Email.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/Email.php @@ -1,12 +1,16 @@ -subject = $subject; + return $this; } @@ -84,11 +90,13 @@ public function getSender() /** * @param string $sender + * * @return EmailActivity */ public function setSender($sender) { $this->sender = $sender; + return $this; } @@ -102,11 +110,13 @@ public function getTo() /** * @param mixed $to + * * @return EmailActivity */ public function setTo($to) { $this->to = $to; + return $this; } @@ -120,11 +130,13 @@ public function getBcc() /** * @param mixed $bcc + * * @return EmailActivity */ public function setBcc($bcc) { $this->bcc = $bcc; + return $this; } @@ -138,11 +150,13 @@ public function getCc() /** * @param mixed $cc + * * @return EmailActivity */ public function setCc($cc) { $this->cc = $cc; + return $this; } @@ -156,11 +170,13 @@ public function getBodyText() /** * @param string $body_text + * * @return EmailActivity */ public function setBodyText($body_text) { $this->body_text = $body_text; + return $this; } @@ -174,11 +190,13 @@ public function getBodyHtml() /** * @param string $body_html + * * @return EmailActivity */ public function setBodyHtml($body_html) { $this->body_html = $body_html; + return $this; } @@ -192,11 +210,13 @@ public function getDirection() /** * @param string $direction + * * @return EmailActivity */ public function setDirection($direction) { $this->direction = $direction; + return $this; } @@ -210,11 +230,13 @@ public function getStatus() /** * @param string $status + * * @return EmailActivity */ public function setStatus($status) { $this->status = $status; + return $this; } @@ -228,11 +250,13 @@ public function getDateScheduled() /** * @param string $date_scheduled + * * @return EmailActivity */ public function setDateScheduled($date_scheduled) { $this->date_scheduled = $date_scheduled; + return $this; } } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/Lead.php b/src/LooplineSystems/CloseIoApiWrapper/Model/Lead.php index cb3cadd..e6e62d3 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/Lead.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/Lead.php @@ -1,12 +1,16 @@ -label = $label; + return $this; } @@ -67,11 +73,13 @@ public function getLabel() /** * @param string $id + * * @return LeadStatus */ public function setId($id) { $this->id = $id; + return $this; } @@ -85,11 +93,13 @@ public function getId() /** * @param string $organizationId + * * @return LeadStatus */ public function setOrganizationId($organizationId) { $this->organizationId = $organizationId; + return $this; } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/NoteActivity.php b/src/LooplineSystems/CloseIoApiWrapper/Model/NoteActivity.php index b002eac..7b802f3 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/NoteActivity.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/NoteActivity.php @@ -1,12 +1,16 @@ -confidence = $confidence; } else { throw new InvalidParamException('Opportunity confidence must be of type int'); @@ -205,6 +208,7 @@ public function getCreatedBy() /** * @param string $created_by + * * @return $this */ public function setCreatedBy($created_by) @@ -224,6 +228,7 @@ public function getDateCreated() /** * @param string $date_created + * * @return $this */ public function setDateCreated($date_created) @@ -243,6 +248,7 @@ public function getDateWon() /** * @param string $date_won + * * @return $this */ public function setDateWon($date_won) @@ -262,6 +268,7 @@ public function getLeadName() /** * @param string $lead_name + * * @return $this */ public function setLeadName($lead_name) @@ -281,6 +288,7 @@ public function getNote() /** * @param string $note + * * @return $this */ public function setNote($note) @@ -300,6 +308,7 @@ public function getUserName() /** * @param string $user_name + * * @return $this */ public function setUserName($user_name) @@ -319,6 +328,7 @@ public function getValuePeriod() /** * @param string $value_period + * * @return $this */ public function setValuePeriod($value_period) @@ -338,6 +348,7 @@ public function getContactId() /** * @param string $contact_id + * * @return $this */ public function setContactId($contact_id) @@ -357,6 +368,7 @@ public function getCreatedByName() /** * @param string $created_by_name + * * @return $this */ public function setCreatedByName($created_by_name) @@ -376,6 +388,7 @@ public function getDateLost() /** * @param string $date_lost + * * @return $this */ public function setDateLost($date_lost) @@ -395,6 +408,7 @@ public function getDateUpdated() /** * @param string $date_updated + * * @return $this */ public function setDateUpdated($date_updated) @@ -414,6 +428,7 @@ public function getId() /** * @param string $id + * * @return $this */ public function setId($id) @@ -433,6 +448,7 @@ public function getLeadId() /** * @param string $lead_id + * * @return $this */ public function setLeadId($lead_id) @@ -452,6 +468,7 @@ public function getOrganizationId() /** * @param string $organization_id + * * @return $this */ public function setOrganizationId($organization_id) @@ -471,6 +488,7 @@ public function getStatusId() /** * @param string $status_id + * * @return $this */ public function setStatusId($status_id) @@ -490,6 +508,7 @@ public function getStatusLabel() /** * @param string $status_label + * * @return $this */ public function setStatusLabel($status_label) @@ -509,6 +528,7 @@ public function getStatusType() /** * @param string $status_type + * * @return $this */ public function setStatusType($status_type) @@ -528,6 +548,7 @@ public function getUpdatedBy() /** * @param string $updated_by + * * @return $this */ public function setUpdatedBy($updated_by) @@ -547,6 +568,7 @@ public function getUpdatedByName() /** * @param string $updated_by_name + * * @return $this */ public function setUpdatedByName($updated_by_name) @@ -566,6 +588,7 @@ public function getUserId() /** * @param string $user_id + * * @return $this */ public function setUserId($user_id) @@ -585,6 +608,7 @@ public function getValue() /** * @param string $value + * * @return $this */ public function setValue($value) @@ -604,6 +628,7 @@ public function getValueCurrency() /** * @param string $value_currency + * * @return $this */ public function setValueCurrency($value_currency) @@ -623,6 +648,7 @@ public function getContactName() /** * @param string $contact_name + * * @return $this */ public function setContactName($contact_name) @@ -642,6 +668,7 @@ public function getValueFormatted() /** * @param string $value_formatted + * * @return $this */ public function setValueFormatted($value_formatted) @@ -661,6 +688,7 @@ public function getIntegrationLinks() /** * @param array $integration_links + * * @return $this */ public function setIntegrationLinks($integration_links) diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/OpportunityStatus.php b/src/LooplineSystems/CloseIoApiWrapper/Model/OpportunityStatus.php index c4457b0..0a58534 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/OpportunityStatus.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/OpportunityStatus.php @@ -1,14 +1,17 @@ -label = $label; + return $this; } @@ -76,11 +82,13 @@ public function getLabel() /** * @param string $id + * * @return OpportunityStatus */ public function setId($id) { $this->id = $id; + return $this; } @@ -94,11 +102,13 @@ public function getId() /** * @param string $type + * * @return OpportunityStatus */ public function setType($type) { $this->type = $type; + return $this; } @@ -112,11 +122,13 @@ public function getType() /** * @param string $organizationId + * * @return OpportunityStatus */ public function setOrganizationId($organizationId) { $this->organizationId = $organizationId; + return $this; } diff --git a/src/LooplineSystems/CloseIoApiWrapper/Model/Phone.php b/src/LooplineSystems/CloseIoApiWrapper/Model/Phone.php index 9b75c26..e56cded 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Model/Phone.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Model/Phone.php @@ -1,12 +1,16 @@ - false, - 'data' => $customFieldArray + 'data' => $customFieldArray, ]; $this->httpClient->addResponse(MessageFactoryDiscovery::find()->createResponse(200, null, [], json_encode($responseBody))); @@ -65,6 +71,8 @@ public function testGetCustomFields($customFieldArray) * @dataProvider customFieldDataProvider * * @param CustomField $customField + * + * @group legacy */ public function testUpdateCustomField($customField) { @@ -90,8 +98,8 @@ public function customFieldDataProvider() { return [ [ - new CustomField(['name' => 'Test Name']) - ] + new CustomField(['name' => 'Test Name']), + ], ]; } @@ -113,10 +121,9 @@ public function customFieldArrayProvider() $customFields = [ $customFieldOne, $customFieldTwo, - $customFieldThree + $customFieldThree, ]; return [[$customFields]]; } } - diff --git a/tests/LooplineSystems/CloseIoApiWrapper/Api/LeadsApiTest.php b/tests/LooplineSystems/CloseIoApiWrapper/Api/LeadsApiTest.php index 3686867..76b7df1 100755 --- a/tests/LooplineSystems/CloseIoApiWrapper/Api/LeadsApiTest.php +++ b/tests/LooplineSystems/CloseIoApiWrapper/Api/LeadsApiTest.php @@ -1,15 +1,16 @@ false, - 'data' => $leadsArray + 'data' => $leadsArray, ]; $this->httpClient->addResponse(MessageFactoryDiscovery::find()->createResponse(200, null, [], json_encode($responseBody))); @@ -106,6 +113,8 @@ public function testGetAllLeads($leadsArray) * @param Lead $lead * * @dataProvider leadProvider + * + * @group legacy */ public function testUpdateLead($lead) { @@ -124,6 +133,9 @@ public function testUpdateLead($lead) $this->assertEquals($originalLead->getId(), $response->getId()); } + /** + * @group legacy + */ public function testDeleteLead() { $this->httpClient->addResponse(MessageFactoryDiscovery::find()->createResponse(200, null, [], '{}')); @@ -144,8 +156,8 @@ public function leadProvider() { return [ [ - (new Lead(['name' => 'Test Name', 'description' => 'Test Description'])) - ] + (new Lead(['name' => 'Test Name', 'description' => 'Test Description'])), + ], ]; } @@ -168,14 +180,13 @@ public function leadArrayProvider() $leadsArray = [ $leadOne, $leadTwo, - $leadThree + $leadThree, ]; return [ [ - $leadsArray + $leadsArray, ], ]; } } - diff --git a/tests/LooplineSystems/CloseIoApiWrapper/ClientTest.php b/tests/LooplineSystems/CloseIoApiWrapper/ClientTest.php index 3c8a5c8..46f01c5 100644 --- a/tests/LooplineSystems/CloseIoApiWrapper/ClientTest.php +++ b/tests/LooplineSystems/CloseIoApiWrapper/ClientTest.php @@ -1,15 +1,16 @@ first = $first; } + /** * @return mixed */ diff --git a/tests/LooplineSystems/CloseIoApiWrapper/Library/ObjectHydrateHelperTraitTest.php b/tests/LooplineSystems/CloseIoApiWrapper/Library/ObjectHydrateHelperTraitTest.php index 6233e1d..434807b 100644 --- a/tests/LooplineSystems/CloseIoApiWrapper/Library/ObjectHydrateHelperTraitTest.php +++ b/tests/LooplineSystems/CloseIoApiWrapper/Library/ObjectHydrateHelperTraitTest.php @@ -1,12 +1,16 @@ -