@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * |
| 38 | 38 | * @param \Requests_Hooks $hooks Hook system |
| 39 | 39 | */ |
| 40 | - public function register(Requests_Hooks &$hooks) |
|
| 40 | + public function register(Requests_Hooks & $hooks) |
|
| 41 | 41 | { |
| 42 | 42 | $hooks->register('requests.before_request', [&$this, 'before_request']); |
| 43 | 43 | } |
@@ -22,15 +22,15 @@ discard block |
||
| 22 | 22 | $this->assertEquals($customer, $this->moip->customers()); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Test should return instance of \Moip\Resource\Account. |
|
| 27 | - */ |
|
| 28 | - public function testShouldReceiveInstanceOfAccount() |
|
| 29 | - { |
|
| 30 | - $account = new \Moip\Resource\Account($this->moip); |
|
| 25 | + /** |
|
| 26 | + * Test should return instance of \Moip\Resource\Account. |
|
| 27 | + */ |
|
| 28 | + public function testShouldReceiveInstanceOfAccount() |
|
| 29 | + { |
|
| 30 | + $account = new \Moip\Resource\Account($this->moip); |
|
| 31 | 31 | |
| 32 | - $this->assertEquals($account, $this->moip->accounts()); |
|
| 33 | - } |
|
| 32 | + $this->assertEquals($account, $this->moip->accounts()); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Test should return instance of \Moip\Resource\Entry. |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $this->assertEquals("https://sandbox.moip.com.br/v2/orders/$order_id", $links->getLink('self')->getHref()); |
| 191 | 191 | // test nested links |
| 192 | 192 | $this->assertEquals("https://checkout-new-sandbox.moip.com.br?id=$order_id&payment-method=credit-card", |
| 193 | - preg_replace('/token=[^&]*&/', '', $links->getLink('payCreditCard')->getHref())); |
|
| 193 | + preg_replace('/token=[^&]*&/', '', $links->getLink('payCreditCard')->getHref())); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -141,30 +141,30 @@ |
||
| 141 | 141 | return $customer; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - /** |
|
| 145 | - * Creates a account. |
|
| 146 | - * |
|
| 147 | - * @return Account |
|
| 148 | - */ |
|
| 149 | - public function createAccount() |
|
| 150 | - { |
|
| 151 | - $moip = new Moip(new MoipOAuth('1tldio91gi74r34zv30d4saz8yuuws5'), Moip::ENDPOINT_SANDBOX); |
|
| 144 | + /** |
|
| 145 | + * Creates a account. |
|
| 146 | + * |
|
| 147 | + * @return Account |
|
| 148 | + */ |
|
| 149 | + public function createAccount() |
|
| 150 | + { |
|
| 151 | + $moip = new Moip(new MoipOAuth('1tldio91gi74r34zv30d4saz8yuuws5'), Moip::ENDPOINT_SANDBOX); |
|
| 152 | 152 | |
| 153 | - $uniqEmail = 'fulano' . uniqid('MPA-') . '@detal123.com.br'; |
|
| 153 | + $uniqEmail = 'fulano' . uniqid('MPA-') . '@detal123.com.br'; |
|
| 154 | 154 | |
| 155 | - $account = $moip->accounts() |
|
| 156 | - ->setEmail($uniqEmail) |
|
| 157 | - ->setName('Fulano') |
|
| 158 | - ->setLastName('de Tal') |
|
| 159 | - ->setBirthDate('1987-11-27') |
|
| 160 | - ->setTaxDocument('22222222222') |
|
| 161 | - ->setPhone(11,988888888) |
|
| 162 | - ->addAddress('Av. Ibirapuera', '2035', 'Moema', 'Sao Paulo', 'SP', '04078010') |
|
| 163 | - ->setIdentityDocument('411111115', 'SSP', '2000-05-06') |
|
| 164 | - ->create(); |
|
| 155 | + $account = $moip->accounts() |
|
| 156 | + ->setEmail($uniqEmail) |
|
| 157 | + ->setName('Fulano') |
|
| 158 | + ->setLastName('de Tal') |
|
| 159 | + ->setBirthDate('1987-11-27') |
|
| 160 | + ->setTaxDocument('22222222222') |
|
| 161 | + ->setPhone(11,988888888) |
|
| 162 | + ->addAddress('Av. Ibirapuera', '2035', 'Moema', 'Sao Paulo', 'SP', '04078010') |
|
| 163 | + ->setIdentityDocument('411111115', 'SSP', '2000-05-06') |
|
| 164 | + ->create(); |
|
| 165 | 165 | |
| 166 | - return $account; |
|
| 167 | - } |
|
| 166 | + return $account; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * Creates an order. |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $moip = new Moip(new MoipOAuth('1tldio91gi74r34zv30d4saz8yuuws5'), Moip::ENDPOINT_SANDBOX); |
| 152 | 152 | |
| 153 | - $uniqEmail = 'fulano' . uniqid('MPA-') . '@detal123.com.br'; |
|
| 153 | + $uniqEmail = 'fulano'.uniqid('MPA-').'@detal123.com.br'; |
|
| 154 | 154 | |
| 155 | 155 | $account = $moip->accounts() |
| 156 | 156 | ->setEmail($uniqEmail) |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | ->setLastName('de Tal') |
| 159 | 159 | ->setBirthDate('1987-11-27') |
| 160 | 160 | ->setTaxDocument('22222222222') |
| 161 | - ->setPhone(11,988888888) |
|
| 161 | + ->setPhone(11, 988888888) |
|
| 162 | 162 | ->addAddress('Av. Ibirapuera', '2035', 'Moema', 'Sao Paulo', 'SP', '04078010') |
| 163 | 163 | ->setIdentityDocument('411111115', 'SSP', '2000-05-06') |
| 164 | 164 | ->create(); |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * |
| 38 | 38 | * @param \Requests_Hooks $hooks Hook system |
| 39 | 39 | */ |
| 40 | - public function register(Requests_Hooks &$hooks) |
|
| 40 | + public function register(Requests_Hooks & $hooks) |
|
| 41 | 41 | { |
| 42 | 42 | $hooks->register('requests.before_request', [&$this, 'before_request']); |
| 43 | 43 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function getType() |
| 208 | 208 | { |
| 209 | - return $this->getIfSet('type', $this->data); |
|
| 209 | + return $this->getIfSet('type', $this->data); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
@@ -283,9 +283,9 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function setName($name) |
| 285 | 285 | { |
| 286 | - $this->data->person->name = $name; |
|
| 286 | + $this->data->person->name = $name; |
|
| 287 | 287 | |
| 288 | - return $this; |
|
| 288 | + return $this; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -297,9 +297,9 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function setLastName($lastname) |
| 299 | 299 | { |
| 300 | - $this->data->person->lastName = $lastname; |
|
| 300 | + $this->data->person->lastName = $lastname; |
|
| 301 | 301 | |
| 302 | - return $this; |
|
| 302 | + return $this; |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
@@ -368,13 +368,13 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public function setIdentityDocument($number, $issuer, $issueDate, $type = 'RG') |
| 370 | 370 | { |
| 371 | - $this->data->person->identityDocument = new stdClass(); |
|
| 372 | - $this->data->person->identityDocument->type = $type; |
|
| 373 | - $this->data->person->identityDocument->number = $number; |
|
| 374 | - $this->data->person->identityDocument->issuer = $issuer; |
|
| 375 | - $this->data->person->identityDocument->issueDate = $issueDate; |
|
| 371 | + $this->data->person->identityDocument = new stdClass(); |
|
| 372 | + $this->data->person->identityDocument->type = $type; |
|
| 373 | + $this->data->person->identityDocument->number = $number; |
|
| 374 | + $this->data->person->identityDocument->issuer = $issuer; |
|
| 375 | + $this->data->person->identityDocument->issueDate = $issueDate; |
|
| 376 | 376 | |
| 377 | - return $this; |
|
| 377 | + return $this; |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -386,8 +386,8 @@ discard block |
||
| 386 | 386 | */ |
| 387 | 387 | public function setType($type) |
| 388 | 388 | { |
| 389 | - $this->data->type = $type; |
|
| 389 | + $this->data->type = $type; |
|
| 390 | 390 | |
| 391 | - return $this; |
|
| 391 | + return $this; |
|
| 392 | 392 | } |
| 393 | 393 | } |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | */ |
| 137 | 137 | public function getFullname() |
| 138 | 138 | { |
| 139 | - return $this->getIfSet('name', $this->data->person) . ' ' . $this->getIfSet('lastName', $this->data->person); |
|
| 139 | + return $this->getIfSet('name', $this->data->person).' '.$this->getIfSet('lastName', $this->data->person); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |