{"action":"created","comment":{"url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/comments/219705332","pull_request_review_id":157945685,"id":219705332,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTcwNTMzMg==","diff_hunk":"@@ -184,4 +211,112 @@ public function findByDocumentId($documentId, $origin = 'Juridico')\n         }\n     }\n \n+    /**\n+     * findByName\n+     *\n+     * Permite obtener la información de una contribuyente por medio\n+     * de su nombre, apellido o razón social\n+     * \n+     * @param array $params Indica los campos con los que se hará la \n+     *                     consulta.  Para personas FISICA el array  debe ser construido\n+     *                     de la siguiente forma:\n+     *                     ```php\n+     *                           $consulta = [\n+     *                              'NOMBRE1' => 'Juan',\n+     *                              'NOMBRE2' => 'Arnoldo',\n+     *                              'APELLIDO1' => 'Perez',\n+     *                              'APELLIDO2' => 'Gallardo'\n+     *                           ]; \n+     *                     ```\n+     *                     Para consultar personas JURIDICAS la consulta debe ser\n+     *                     construida de la siguiente forma:\n+     *                     ```php\n+     *                           $consulta = [\n+     *                              'RAZON' => 'Coporación ABC'\n+     *                           ]; \n+     *                     ```\n+     *                 \n+     * @param string $origin  Indica si la consulta se hará a personas juridicas \n+     *                        o personas físicas\n+     * @return array  Se retorna un array con todas las coincidencias enviadas por\n+     *                el web service de Hacienda\n+     */\n+    public function findByName($query, $origin = 'Juridico')\n+    {\n+        try {\n+\n+            $return = [];\n+            $options = [\n+                'uri'                => 'http://schemas.xmlsoap.org/soap/envelope/',\n+                'style'              => SOAP_RPC,\n+                'use'                => SOAP_ENCODED,\n+                'soap_version'       => SOAP_1_1,\n+                'cache_wsdl'         => WSDL_CACHE_NONE,\n+                'connection_timeout' => 30,\n+                'trace'              => true,\n+                'encoding'           => 'UTF-8',\n+                'exceptions'         => true,\n+                'compression'        => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE\n+            ];\n+\n+            if ($origin == 'Juridico') {\n+                $params = [\n+                    'origen' => $origin, // Fisico,  Juridico o DIMEX\n+                    'razon'  => $query['RAZON']\n+                ];\n+            } else {","path":"src/Common.php","position":136,"original_position":136,"commit_id":"028ab2c44e51c97a60dbe150fb935e7199b31f5f","original_commit_id":"028ab2c44e51c97a60dbe150fb935e7199b31f5f","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [The method token uses an else expression. Else is never necessary and you can simplify the code to work without else.](https://app.codacy.com/app/opencode506/Faktur-PHP-SDK/pullRequest?prid=2236720)","created_at":"2018-09-23T17:18:32Z","updated_at":"2018-09-23T17:18:32Z","html_url":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16#discussion_r219705332","pull_request_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/comments/219705332"},"html":{"href":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16#discussion_r219705332"},"pull_request":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16","id":217520251,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NTIwMjUx","html_url":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16","diff_url":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16.diff","patch_url":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16.patch","issue_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/16","number":16,"state":"open","locked":false,"title":"[FEATURE] Busca de contribuyentes por nombre","user":{"login":"opencode506","id":39015896,"node_id":"MDQ6VXNlcjM5MDE1ODk2","avatar_url":"https://avatars1.githubusercontent.com/u/39015896?v=4","gravatar_id":"","url":"https://api.github.com/users/opencode506","html_url":"https://github.com/opencode506","followers_url":"https://api.github.com/users/opencode506/followers","following_url":"https://api.github.com/users/opencode506/following{/other_user}","gists_url":"https://api.github.com/users/opencode506/gists{/gist_id}","starred_url":"https://api.github.com/users/opencode506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencode506/subscriptions","organizations_url":"https://api.github.com/users/opencode506/orgs","repos_url":"https://api.github.com/users/opencode506/repos","events_url":"https://api.github.com/users/opencode506/events{/privacy}","received_events_url":"https://api.github.com/users/opencode506/received_events","type":"User","site_admin":false},"body":"| Q                      | A\r\n| ---------------------- | ---\r\n| Es un bugfix?          | no\r\n| Nueva caracterisitca?  | si\r\n| Rompe BC?              | no\r\n| Pasó pruebas?          | si\r\n| Fixed issues           | \r\n","created_at":"2018-09-23T17:16:39Z","updated_at":"2018-09-23T17:18:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d064e456305c976dc320f28076686fe7c8113e86","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16/commits","review_comments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16/comments","review_comment_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/16/comments","statuses_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/statuses/028ab2c44e51c97a60dbe150fb935e7199b31f5f","head":{"label":"opencode506:develop","ref":"develop","sha":"028ab2c44e51c97a60dbe150fb935e7199b31f5f","user":{"login":"opencode506","id":39015896,"node_id":"MDQ6VXNlcjM5MDE1ODk2","avatar_url":"https://avatars1.githubusercontent.com/u/39015896?v=4","gravatar_id":"","url":"https://api.github.com/users/opencode506","html_url":"https://github.com/opencode506","followers_url":"https://api.github.com/users/opencode506/followers","following_url":"https://api.github.com/users/opencode506/following{/other_user}","gists_url":"https://api.github.com/users/opencode506/gists{/gist_id}","starred_url":"https://api.github.com/users/opencode506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencode506/subscriptions","organizations_url":"https://api.github.com/users/opencode506/orgs","repos_url":"https://api.github.com/users/opencode506/repos","events_url":"https://api.github.com/users/opencode506/events{/privacy}","received_events_url":"https://api.github.com/users/opencode506/received_events","type":"User","site_admin":false},"repo":{"id":145022840,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwMjI4NDA=","name":"Faktur-PHP-SDK","full_name":"opencode506/Faktur-PHP-SDK","private":false,"owner":{"login":"opencode506","id":39015896,"node_id":"MDQ6VXNlcjM5MDE1ODk2","avatar_url":"https://avatars1.githubusercontent.com/u/39015896?v=4","gravatar_id":"","url":"https://api.github.com/users/opencode506","html_url":"https://github.com/opencode506","followers_url":"https://api.github.com/users/opencode506/followers","following_url":"https://api.github.com/users/opencode506/following{/other_user}","gists_url":"https://api.github.com/users/opencode506/gists{/gist_id}","starred_url":"https://api.github.com/users/opencode506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencode506/subscriptions","organizations_url":"https://api.github.com/users/opencode506/orgs","repos_url":"https://api.github.com/users/opencode506/repos","events_url":"https://api.github.com/users/opencode506/events{/privacy}","received_events_url":"https://api.github.com/users/opencode506/received_events","type":"User","site_admin":false},"html_url":"https://github.com/opencode506/Faktur-PHP-SDK","description":"Faktur PHP SDK para desarrollo e implementación de Factura Electrónica para Costa Rica ","fork":false,"url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK","forks_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/forks","keys_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/teams","hooks_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/hooks","issue_events_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/events{/number}","events_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/events","assignees_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/assignees{/user}","branches_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/branches{/branch}","tags_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/tags","blobs_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/statuses/{sha}","languages_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/languages","stargazers_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/stargazers","contributors_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/contributors","subscribers_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/subscribers","subscription_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/subscription","commits_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/contents/{+path}","compare_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/merges","archive_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/downloads","issues_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues{/number}","pulls_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls{/number}","milestones_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/milestones{/number}","notifications_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/labels{/name}","releases_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/releases{/id}","deployments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/deployments","created_at":"2018-08-16T18:03:36Z","updated_at":"2018-09-22T03:43:11Z","pushed_at":"2018-09-23T17:16:39Z","git_url":"git://github.com/opencode506/Faktur-PHP-SDK.git","ssh_url":"git@github.com:opencode506/Faktur-PHP-SDK.git","clone_url":"https://github.com/opencode506/Faktur-PHP-SDK.git","svn_url":"https://github.com/opencode506/Faktur-PHP-SDK","homepage":"","size":68,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"opencode506:master","ref":"master","sha":"324ac47e4152fb5f508e48989585b36ccf40fdcc","user":{"login":"opencode506","id":39015896,"node_id":"MDQ6VXNlcjM5MDE1ODk2","avatar_url":"https://avatars1.githubusercontent.com/u/39015896?v=4","gravatar_id":"","url":"https://api.github.com/users/opencode506","html_url":"https://github.com/opencode506","followers_url":"https://api.github.com/users/opencode506/followers","following_url":"https://api.github.com/users/opencode506/following{/other_user}","gists_url":"https://api.github.com/users/opencode506/gists{/gist_id}","starred_url":"https://api.github.com/users/opencode506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencode506/subscriptions","organizations_url":"https://api.github.com/users/opencode506/orgs","repos_url":"https://api.github.com/users/opencode506/repos","events_url":"https://api.github.com/users/opencode506/events{/privacy}","received_events_url":"https://api.github.com/users/opencode506/received_events","type":"User","site_admin":false},"repo":{"id":145022840,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwMjI4NDA=","name":"Faktur-PHP-SDK","full_name":"opencode506/Faktur-PHP-SDK","private":false,"owner":{"login":"opencode506","id":39015896,"node_id":"MDQ6VXNlcjM5MDE1ODk2","avatar_url":"https://avatars1.githubusercontent.com/u/39015896?v=4","gravatar_id":"","url":"https://api.github.com/users/opencode506","html_url":"https://github.com/opencode506","followers_url":"https://api.github.com/users/opencode506/followers","following_url":"https://api.github.com/users/opencode506/following{/other_user}","gists_url":"https://api.github.com/users/opencode506/gists{/gist_id}","starred_url":"https://api.github.com/users/opencode506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencode506/subscriptions","organizations_url":"https://api.github.com/users/opencode506/orgs","repos_url":"https://api.github.com/users/opencode506/repos","events_url":"https://api.github.com/users/opencode506/events{/privacy}","received_events_url":"https://api.github.com/users/opencode506/received_events","type":"User","site_admin":false},"html_url":"https://github.com/opencode506/Faktur-PHP-SDK","description":"Faktur PHP SDK para desarrollo e implementación de Factura Electrónica para Costa Rica ","fork":false,"url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK","forks_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/forks","keys_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/teams","hooks_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/hooks","issue_events_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/events{/number}","events_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/events","assignees_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/assignees{/user}","branches_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/branches{/branch}","tags_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/tags","blobs_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/statuses/{sha}","languages_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/languages","stargazers_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/stargazers","contributors_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/contributors","subscribers_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/subscribers","subscription_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/subscription","commits_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/contents/{+path}","compare_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/merges","archive_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/downloads","issues_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues{/number}","pulls_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls{/number}","milestones_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/milestones{/number}","notifications_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/labels{/name}","releases_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/releases{/id}","deployments_url":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/deployments","created_at":"2018-08-16T18:03:36Z","updated_at":"2018-09-22T03:43:11Z","pushed_at":"2018-09-23T17:16:39Z","git_url":"git://github.com/opencode506/Faktur-PHP-SDK.git","ssh_url":"git@github.com:opencode506/Faktur-PHP-SDK.git","clone_url":"https://github.com/opencode506/Faktur-PHP-SDK.git","svn_url":"https://github.com/opencode506/Faktur-PHP-SDK","homepage":"","size":68,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16"},"html":{"href":"https://github.com/opencode506/Faktur-PHP-SDK/pull/16"},"issue":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/16"},"comments":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/opencode506/Faktur-PHP-SDK/statuses/028ab2c44e51c97a60dbe150fb935e7199b31f5f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"codacy-bot"}}