Completed
Pull Request — master (#72)
by
unknown
02:03
created
src/Resource/Orders.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
     /**
167 167
      * Create a new order in MoIP.
168 168
      *
169
-     * @return Orders
169
+     * @return stdClass
170 170
      */
171 171
     public function create()
172 172
     {
Please login to merge, or discard this patch.
src/Resource/MoipResource.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -74,6 +74,9 @@
 block discarded – undo
74 74
         }
75 75
     }
76 76
 
77
+    /**
78
+     * @param string $key
79
+     */
77 80
     protected function getIfSetDateFmt($key, $fmt, stdClass $data = null)
78 81
     {
79 82
         $val = $this->getIfSet($key, $data);
Please login to merge, or discard this patch.
src/MoipOAuth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
tests/MoipTestCase.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
 	/**
145 145
 	 * Creates a account.
146 146
 	 *
147
-	 * @return Account
147
+	 * @return \stdClass
148 148
 	 */
149 149
 	public function createAccount()
150 150
 	{
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -141,30 +141,30 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
tests/MoipTest.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/MoipBasicAuth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Resource/Payment.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
         return $refund;
155 155
     }
156 156
 	
157
-	/**
158
-	 * Get payment status.
159
-	 *
160
-	 * @return string Payment status. Possible values CREATED, WAITING, IN_ANALYSIS, PRE_AUTHORIZED, AUTHORIZED, CANCELLED, REFUNDED, REVERSED, SETTLED
161
-	 */
162
-	public function getStatus()
163
-	{
164
-		return $this->getIfSet('status');
165
-	}
157
+    /**
158
+     * Get payment status.
159
+     *
160
+     * @return string Payment status. Possible values CREATED, WAITING, IN_ANALYSIS, PRE_AUTHORIZED, AUTHORIZED, CANCELLED, REFUNDED, REVERSED, SETTLED
161
+     */
162
+    public function getStatus()
163
+    {
164
+        return $this->getIfSet('status');
165
+    }
166 166
 
167 167
     /**
168 168
      * get creation time.
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $this->data->fundingInstrument->creditCard->holder->phone->countryCode = $holder->getPhoneCountryCode();
262 262
         $this->data->fundingInstrument->creditCard->holder->phone->areaCode = $holder->getPhoneAreaCode();
263 263
         $this->data->fundingInstrument->creditCard->holder->phone->number = $holder->getPhoneNumber();
264
-	$this->data->fundingInstrument->creditCard->holder->billingAddress = $holder->getBillingAddress();
264
+    $this->data->fundingInstrument->creditCard->holder->billingAddress = $holder->getBillingAddress();
265 265
     }
266 266
 
267 267
     /**
Please login to merge, or discard this patch.
src/Resource/Account.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
      * Add a new address to the account.
63 63
      *
64 64
      * @param string $street     Street address.
65
-     * @param string $number_format(number)     Number address.
66 65
      * @param string $district   Neighborhood address.
67 66
      * @param string $city       City address.
68 67
      * @param string $state      State address.
69 68
      * @param string $zip        The zip code billing address.
70 69
      * @param string $complement Address complement.
71 70
      * @param string $country    Country ISO-alpha3 format, BRA example.
71
+     * @param string $number
72 72
      *
73 73
      * @return $this
74 74
      */
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @param string $moip_id
110 110
      *
111
-     * @return \Moip\Resource\Account
111
+     * @return stdClass
112 112
      */
113 113
     public function get($moip_id)
114 114
     {
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
     /**
434 434
      * Set name from account.
435 435
      *
436
-     * @param string $name Account's person name.
437 436
      *
437
+     * @param string $lastname
438 438
      * @return \Moip\Resource\Account
439 439
      */
440 440
     public function setLastName($lastname)
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
     /**
448 448
      * Set birth date from account.
449 449
      *
450
-     * @param \DateTime|string $birthDate Date of birth of the credit card holder.
450
+     * @param string $birthDate Date of birth of the credit card holder.
451 451
      *
452 452
      * @return \Moip\Resource\Account
453 453
      */
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
      *
504 504
      * @param string           $number    Número do documento.  
505 505
      * @param string           $issuer    Emissor do documento.
506
-     * @param \DateTime|string $birthDate $issueDate 	Data de emissão do documento.
507 506
      * @param string           $type      Tipo do documento. Valores possíveis: RG.
507
+     * @param string $issueDate
508 508
      *
509 509
      * @return \Moip\Resource\Account
510 510
      */
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -439,9 +439,9 @@
 block discarded – undo
439 439
      */
440 440
     public function setLastName($lastname)
441 441
     {
442
-    	$this->data->person->lastName = $lastname;
442
+        $this->data->person->lastName = $lastname;
443 443
     
444
-    	return $this;
444
+        return $this;
445 445
     }
446 446
 
447 447
     /**
Please login to merge, or discard this patch.