Passed
Push — master ( 7521db...924ca4 )
by Rodrigo
02:00
created
src/OneDocApi.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 
27 27
     public $instructs = [
28 28
         'method' => self::XXX,
29
-	    'client_auth' => self::XXX,
30
-	    'token' => self::XXX,
29
+        'client_auth' => self::XXX,
30
+        'token' => self::XXX,
31 31
         'secret' => self::XXX,
32 32
     ];
33 33
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -39,17 +39,17 @@  discard block
 block discarded – undo
39 39
      * 
40 40
      * @return void
41 41
      */
42
-    public function init ( )
42
+    public function init( )
43 43
     {
44 44
         // Verifica se existe parametros de autenticação
45 45
         $auth = Yii::$app->session->get('1doc-auth', []);
46
-        foreach ( ['client_auth', 'token', 'secret'] as $attribute){
47
-            if(!array_key_exists($attribute, $auth)){
46
+        foreach (['client_auth', 'token', 'secret'] as $attribute) {
47
+            if (!array_key_exists($attribute, $auth)) {
48 48
                 throw new OneDocException("Autenticação Incompleta!\nNão foi encontrado: [{$attribute}]");
49 49
             }
50 50
         }
51 51
         // Define uma URL padrão para quando não foi escolhida
52
-        if ( !$this->url_request ) {
52
+        if (!$this->url_request) {
53 53
             $url = self::URLS;
54 54
             $this->url_request = current($url);
55 55
         }
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return string-json a requisão que sera feita para api 1doc
65 65
      */
66
-    public function getRequest( $real = false )
66
+    public function getRequest($real = false)
67 67
     {
68 68
         $json = $this->instructs;
69 69
 
70
-        if( $real ){
71
-            $json = \yii\helpers\ArrayHelper::merge( $json, self::getConnection1Doc( ) ); 
70
+        if ($real) {
71
+            $json = \yii\helpers\ArrayHelper::merge($json, self::getConnection1Doc( )); 
72 72
         }
73 73
 
74
-        return \yii\helpers\Json::encode( $json, false );
74
+        return \yii\helpers\Json::encode($json, false);
75 75
     }
76 76
 
77 77
 
78 78
     /**
79 79
      * 
80 80
      */
81
-    public function getSubmitRequest ( )
81
+    public function getSubmitRequest( )
82 82
     {
83 83
 
84 84
     }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      *
91 91
      * @return array [client_auth, token, secret]
92 92
      */
93
-    public static function getConnection1Doc ( ) 
93
+    public static function getConnection1Doc( ) 
94 94
     {
95 95
         return Yii::$app->session->get('1doc-auth', []);
96 96
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @param mixed $value
103 103
      * 
104 104
      */
105
-    public function __set( $name, $value )
105
+    public function __set($name, $value)
106 106
     {
107 107
         switch ($name)
108 108
         {
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
                     Yii::$app->session->get('1doc-auth', []),
114 114
                     [$name => $value]
115 115
                 ));
116
-            return ;
116
+            return;
117 117
             case 'url': 
118 118
                 $urls = self::URLS;
119
-                $this->url_request = !isset($urls[$value]) ? $value:$urls[$value];
120
-            return ;
119
+                $this->url_request = !isset($urls[$value]) ? $value : $urls[$value];
120
+            return;
121 121
         }
122 122
         
123
-        parent::__set( $name, $value );
123
+        parent::__set($name, $value);
124 124
     }
125 125
 }
Please login to merge, or discard this patch.