@@ -4,7 +4,7 @@ |
||
4 | 4 | * @return an instance of the EntityManager |
5 | 5 | */ |
6 | 6 | if (!function_exists('em')) { |
7 | - function em() |
|
7 | + function em () |
|
8 | 8 | { |
9 | 9 | return app('Doctrine\ORM\EntityManagerInterface'); |
10 | 10 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * @param string $file |
14 | 14 | */ |
15 | - function register_annotation_file(string $file) |
|
15 | + function register_annotation_file (string $file) |
|
16 | 16 | { |
17 | 17 | if (!is_file($file)) { |
18 | 18 | return false; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * Retrieve all annotations of a giving object |
27 | 27 | */ |
28 | 28 | if (!function_exists('get_class_annotations')) { |
29 | - function get_class_annotations($element, $annotation = null) |
|
29 | + function get_class_annotations ($element, $annotation = null) |
|
30 | 30 | { |
31 | 31 | $class = $element; |
32 | 32 | if (is_object($element)) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * Retrieve annotations of a especific property of a giving object |
45 | 45 | */ |
46 | 46 | if (!function_exists('get_property_annotations')) { |
47 | - function get_property_annotations($element, $property = null, $annotation = null) |
|
47 | + function get_property_annotations ($element, $property = null, $annotation = null) |
|
48 | 48 | { |
49 | 49 | $class = $element; |
50 | 50 | if (is_object($element) && !($element instanceof ReflectionClass)) { |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | |
63 | 63 | $reflectClass = new ReflectionClass($class); |
64 | 64 | $reflectProperties = $reflectClass->getProperties(); |
65 | - $annotations = []; |
|
65 | + $annotations = [ ]; |
|
66 | 66 | foreach ($reflectProperties as $property) { |
67 | - $annotations[$property->getName()] = get_property_annotations($reflectClass, $property, $annotation); |
|
67 | + $annotations[ $property->getName() ] = get_property_annotations($reflectClass, $property, $annotation); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | return $annotations; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param string $host Parametro obrigatório, endereço do WSDL |
39 | 39 | * @param array $options Parametro opcional, referente aos options que serão utilizados |
40 | 40 | */ |
41 | - public function __construct($host, array $options = []) |
|
41 | + public function __construct ($host, array $options = [ ]) |
|
42 | 42 | { |
43 | 43 | $this->setHost($host) |
44 | 44 | ->setOptions($options); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return self |
51 | 51 | */ |
52 | - public function connect() |
|
52 | + public function connect () |
|
53 | 53 | { |
54 | 54 | if (!$host = $this->getHost()) { |
55 | 55 | throw new InvalidArgumentException('Host não informado'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return SoapClient::__soapCall |
69 | 69 | */ |
70 | - public function call() |
|
70 | + public function call () |
|
71 | 71 | { |
72 | 72 | $host = $this->getHost(); |
73 | 73 | if (!$host || empty($host)) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public function getHost() |
|
98 | + public function getHost () |
|
99 | 99 | { |
100 | 100 | return $this->host; |
101 | 101 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * |
108 | 108 | * @return self |
109 | 109 | */ |
110 | - public function setHost($host) |
|
110 | + public function setHost ($host) |
|
111 | 111 | { |
112 | 112 | $this->host = $host; |
113 | 113 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @return array |
121 | 121 | */ |
122 | - public function getOptions() |
|
122 | + public function getOptions () |
|
123 | 123 | { |
124 | 124 | return $this->options; |
125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @return self |
133 | 133 | */ |
134 | - public function setOptions(array $options) |
|
134 | + public function setOptions (array $options) |
|
135 | 135 | { |
136 | 136 | $this->options = $options; |
137 | 137 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return mixed |
145 | 145 | */ |
146 | - public function getRequest() |
|
146 | + public function getRequest () |
|
147 | 147 | { |
148 | 148 | return $this->request; |
149 | 149 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @return self |
157 | 157 | */ |
158 | - public function setRequest($request) |
|
158 | + public function setRequest ($request) |
|
159 | 159 | { |
160 | 160 | $this->request = $request; |
161 | 161 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @return mixed |
169 | 169 | */ |
170 | - public function getService() |
|
170 | + public function getService () |
|
171 | 171 | { |
172 | 172 | return $this->service; |
173 | 173 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @return self |
181 | 181 | */ |
182 | - public function setService($service) |
|
182 | + public function setService ($service) |
|
183 | 183 | { |
184 | 184 | $this->service = $service; |
185 | 185 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @return SoapClient |
193 | 193 | */ |
194 | - public function getClient() |
|
194 | + public function getClient () |
|
195 | 195 | { |
196 | 196 | return $this->client; |
197 | 197 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return self |
205 | 205 | */ |
206 | - public function setClient(NativeSoapClient $client) |
|
206 | + public function setClient (NativeSoapClient $client) |
|
207 | 207 | { |
208 | 208 | $this->client = $client; |
209 | 209 |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use InvalidArgumentException; |
6 | 6 | use SoapClient as NativeSoapClient; |
7 | 7 | |
8 | -class SoapClient |
|
9 | -{ |
|
8 | +class SoapClient { |
|
10 | 9 | /** |
11 | 10 | * @var string |
12 | 11 | */ |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * @param string $key |
11 | 11 | */ |
12 | - function env($key, $defaultValue = '') |
|
12 | + function env ($key, $defaultValue = '') |
|
13 | 13 | { |
14 | 14 | $env = getenv($key); |
15 | 15 | if (!$env) { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @param string $input |
26 | 26 | */ |
27 | - function onlyNumbers(string $input) |
|
27 | + function onlyNumbers (string $input) |
|
28 | 28 | { |
29 | 29 | return preg_replace('/\D/i', '', $input); |
30 | 30 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param string $from = 'Y-m-d' |
37 | 37 | * @param string $to = 'obj' |
38 | 38 | */ |
39 | - function parseDate($date, string $from = 'Y-m-d', string $to = 'obj') |
|
39 | + function parseDate ($date, string $from = 'Y-m-d', string $to = 'obj') |
|
40 | 40 | { |
41 | 41 | if ($date instanceof DateTime && $to === 'obj') { |
42 | 42 | return $date; |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | class CurlHelper |
6 | 6 | { |
7 | 7 | protected $init; |
8 | - protected $headers = []; |
|
8 | + protected $headers = [ ]; |
|
9 | 9 | protected $response; |
10 | 10 | protected $info; |
11 | 11 | protected $baseUrl; |
12 | 12 | protected $posFixUrl; |
13 | - protected $options = []; |
|
13 | + protected $options = [ ]; |
|
14 | 14 | |
15 | - public function __construct($baseUrl, array $headers = []) |
|
15 | + public function __construct ($baseUrl, array $headers = [ ]) |
|
16 | 16 | { |
17 | 17 | $this->init = curl_init(); |
18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $this->headers = $headers; |
22 | 22 | } |
23 | 23 | |
24 | - protected function exec() |
|
24 | + protected function exec () |
|
25 | 25 | { |
26 | 26 | curl_setopt($this->init, CURLOPT_URL, trim($this->baseUrl.$this->posFixUrl)); |
27 | 27 | curl_setopt($this->init, CURLOPT_RETURNTRANSFER, true); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->info = curl_getinfo($this->init); |
38 | 38 | } |
39 | 39 | |
40 | - public function send($close = true) |
|
40 | + public function send ($close = true) |
|
41 | 41 | { |
42 | 42 | $this->exec(); |
43 | 43 | |
@@ -48,59 +48,59 @@ discard block |
||
48 | 48 | return $this; |
49 | 49 | } |
50 | 50 | |
51 | - public function addHeader($header) |
|
51 | + public function addHeader ($header) |
|
52 | 52 | { |
53 | - $this->headers[] = $header; |
|
53 | + $this->headers[ ] = $header; |
|
54 | 54 | |
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
58 | - public function getResponse() |
|
58 | + public function getResponse () |
|
59 | 59 | { |
60 | 60 | return [ |
61 | - 'code' => $this->info['http_code'], |
|
61 | + 'code' => $this->info[ 'http_code' ], |
|
62 | 62 | 'data' => $this->response, |
63 | 63 | ]; |
64 | 64 | } |
65 | 65 | |
66 | - public function getInfo() |
|
66 | + public function getInfo () |
|
67 | 67 | { |
68 | 68 | return $this->info; |
69 | 69 | } |
70 | 70 | |
71 | - public function setBaseUrl($baseUrl) |
|
71 | + public function setBaseUrl ($baseUrl) |
|
72 | 72 | { |
73 | 73 | $this->baseUrl = $baseUrl; |
74 | 74 | |
75 | 75 | return $this; |
76 | 76 | } |
77 | 77 | |
78 | - public function setPosFixUrl($posFixUrl) |
|
78 | + public function setPosFixUrl ($posFixUrl) |
|
79 | 79 | { |
80 | 80 | $this->posFixUrl = $posFixUrl; |
81 | 81 | |
82 | 82 | return $this; |
83 | 83 | } |
84 | 84 | |
85 | - public function post(array $data) |
|
85 | + public function post (array $data) |
|
86 | 86 | { |
87 | - $this->options[CURLOPT_POST] = true; |
|
88 | - $this->options[CURLOPT_POSTFIELDS] = json_encode($data); |
|
87 | + $this->options[ CURLOPT_POST ] = true; |
|
88 | + $this->options[ CURLOPT_POSTFIELDS ] = json_encode($data); |
|
89 | 89 | |
90 | 90 | return $this; |
91 | 91 | } |
92 | 92 | |
93 | - public function put(array $data) |
|
93 | + public function put (array $data) |
|
94 | 94 | { |
95 | - $this->options[CURLOPT_CUSTOMREQUEST] = 'PUT'; |
|
96 | - $this->options[CURLOPT_POSTFIELDS] = json_encode($data); |
|
95 | + $this->options[ CURLOPT_CUSTOMREQUEST ] = 'PUT'; |
|
96 | + $this->options[ CURLOPT_POSTFIELDS ] = json_encode($data); |
|
97 | 97 | |
98 | 98 | return $this; |
99 | 99 | } |
100 | 100 | |
101 | - public function delete() |
|
101 | + public function delete () |
|
102 | 102 | { |
103 | - $this->options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; |
|
103 | + $this->options[ CURLOPT_CUSTOMREQUEST ] = 'DELETE'; |
|
104 | 104 | |
105 | 105 | return $this; |
106 | 106 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Bludata\Helpers; |
4 | 4 | |
5 | -class CurlHelper |
|
6 | -{ |
|
5 | +class CurlHelper { |
|
7 | 6 | protected $init; |
8 | 7 | protected $headers = []; |
9 | 8 | protected $response; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * @param string $file |
12 | 12 | */ |
13 | - function register_annotation_file(string $file) |
|
13 | + function register_annotation_file (string $file) |
|
14 | 14 | { |
15 | 15 | if (!is_file($file)) { |
16 | 16 | return false; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @param string $dir |
29 | 29 | */ |
30 | - function register_annotation_dir(string $dir) |
|
30 | + function register_annotation_dir (string $dir) |
|
31 | 31 | { |
32 | 32 | if (!is_dir($dir)) { |
33 | 33 | return false; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $handle = opendir($dir); |
37 | 37 | while ($path = readdir($handle)) { |
38 | - $toRegisterPath = implode(DIRECTORY_SEPARATOR, [$dir, $path]); |
|
38 | + $toRegisterPath = implode(DIRECTORY_SEPARATOR, [ $dir, $path ]); |
|
39 | 39 | register_annotation_file($toRegisterPath); |
40 | 40 | } |
41 | 41 | |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | * Default binding a repository interface to a concret class |
48 | 48 | */ |
49 | 49 | if (!function_exists('bind_repository_interface')) { |
50 | - function bind_repository_interface(string $repositoryInterface, string $repository, string $entity) |
|
50 | + function bind_repository_interface (string $repositoryInterface, string $repository, string $entity) |
|
51 | 51 | { |
52 | 52 | app()->bind($repositoryInterface, function ($app) use ($repository, $entity) { |
53 | 53 | return new $repository( |
54 | - $app['em'], |
|
55 | - $app['em']->getClassMetaData($entity) |
|
54 | + $app[ 'em' ], |
|
55 | + $app[ 'em' ]->getClassMetaData($entity) |
|
56 | 56 | ); |
57 | 57 | }); |
58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * Dump and die. |
63 | 63 | */ |
64 | 64 | if (!function_exists('dd')) { |
65 | - function dd() |
|
65 | + function dd () |
|
66 | 66 | { |
67 | 67 | $args = func_get_args(); |
68 | 68 | foreach ($args as $arg) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * Print and die |
77 | 77 | */ |
78 | 78 | if (!function_exists('pd')) { |
79 | - function pd() |
|
79 | + function pd () |
|
80 | 80 | { |
81 | 81 | $args = func_get_args(); |
82 | 82 | foreach ($args as $arg) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * Dump and return |
91 | 91 | */ |
92 | 92 | if (!function_exists('dr')) { |
93 | - function dr() |
|
93 | + function dr () |
|
94 | 94 | { |
95 | 95 | $args = func_get_args(); |
96 | 96 | $result = ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @param string $version = 'v1' |
125 | 125 | * @param boolean $abort = true |
126 | 126 | */ |
127 | - function bdClassExists(string $folder, string $className, string $version = 'v1', boolean $abort = true) |
|
127 | + function bdClassExists (string $folder, string $className, string $version = 'v1', boolean $abort = true) |
|
128 | 128 | { |
129 | 129 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
130 | 130 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param string $version = 'v1' |
152 | 152 | * @param boolean $abort = true |
153 | 153 | */ |
154 | - function bdInterfaceExists(string $folder, string $className, string $version = 'v1', boolean $abort = true) |
|
154 | + function bdInterfaceExists (string $folder, string $className, string $version = 'v1', boolean $abort = true) |
|
155 | 155 | { |
156 | 156 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
157 | 157 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param string $version = 'v1' |
174 | 174 | * @param boolean $abort = true |
175 | 175 | */ |
176 | - function bdInterfaceClass(string $className, string $version = 'v1', boolean $abort = true) |
|
176 | + function bdInterfaceClass (string $className, string $version = 'v1', boolean $abort = true) |
|
177 | 177 | { |
178 | 178 | return bdInterfaceExists(config('bludata.generator.paths.interfaces'), $className.'Interface', $version, $abort); |
179 | 179 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @param string $version = 'v1' |
186 | 186 | * @param boolean $abort = true |
187 | 187 | */ |
188 | - function bdContractClass(string $className, string $version = 'v1', boolean $abort = true) |
|
188 | + function bdContractClass (string $className, string $version = 'v1', boolean $abort = true) |
|
189 | 189 | { |
190 | 190 | return bdInterfaceExists(config('bludata.generator.paths.contracts'), $className.'Interface', $version, $abort); |
191 | 191 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @param string $version = 'v1' |
198 | 198 | * @param boolean $abort = true |
199 | 199 | */ |
200 | - function bdContract(string $className, string $version = 'v1', boolean $abort = true) |
|
200 | + function bdContract (string $className, string $version = 'v1', boolean $abort = true) |
|
201 | 201 | { |
202 | 202 | return app(bdContractClass($className, $version, $abort)); |
203 | 203 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @param string $version = 'v1' |
210 | 210 | * @param boolean $abort = true |
211 | 211 | */ |
212 | - function bdRepositoryInterfaceClass(string $className, string $version = 'v1', boolean $abort = true) |
|
212 | + function bdRepositoryInterfaceClass (string $className, string $version = 'v1', boolean $abort = true) |
|
213 | 213 | { |
214 | 214 | return bdInterfaceClass($className.'Repository', $version, $abort); |
215 | 215 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @param string $version = 'v1' |
222 | 222 | * @param boolean $abort = true |
223 | 223 | */ |
224 | - function bdRepositoryClass(string $className, string $version = 'v1', boolean $abort = true) |
|
224 | + function bdRepositoryClass (string $className, string $version = 'v1', boolean $abort = true) |
|
225 | 225 | { |
226 | 226 | return bdClassExists(config('bludata.generator.paths.repositories'), $className.'Repository', $version, $abort); |
227 | 227 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param string $version = 'v1' |
234 | 234 | * @param boolean $abort = true |
235 | 235 | */ |
236 | - function bdRepository(string $className, string $version = 'v1', boolean $abort = true) |
|
236 | + function bdRepository (string $className, string $version = 'v1', boolean $abort = true) |
|
237 | 237 | { |
238 | 238 | return app(bdRepositoryInterfaceClass($className, $version, $abort)); |
239 | 239 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param string $version = 'v1' |
246 | 246 | * @param boolean $abort = true |
247 | 247 | */ |
248 | - function bdServiceInterfaceClass(string $className, string $version = 'v1', boolean $abort = true) |
|
248 | + function bdServiceInterfaceClass (string $className, string $version = 'v1', boolean $abort = true) |
|
249 | 249 | { |
250 | 250 | return bdInterfaceClass($className.'Service', $version, $abort); |
251 | 251 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @param string $version = 'v1' |
258 | 258 | * @param boolean $abort = true |
259 | 259 | */ |
260 | - function bdServiceClass(string $className, string $version = 'v1', boolean $abort = true) |
|
260 | + function bdServiceClass (string $className, string $version = 'v1', boolean $abort = true) |
|
261 | 261 | { |
262 | 262 | return bdClassExists(config('bludata.generator.paths.services'), $className.'Service', $version, $abort); |
263 | 263 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param string $version = 'v1' |
270 | 270 | * @param boolean $abort = true |
271 | 271 | */ |
272 | - function bdService(string $className, string $version = 'v1', boolean $abort = true) |
|
272 | + function bdService (string $className, string $version = 'v1', boolean $abort = true) |
|
273 | 273 | { |
274 | 274 | return app(bdServiceInterfaceClass($className, $version, $abort)); |
275 | 275 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * @param string $version = 'v1' |
282 | 282 | * @param boolean $abort = true |
283 | 283 | */ |
284 | - function bdEntityClass(string $className, string $version = 'v1', boolean $abort = true) |
|
284 | + function bdEntityClass (string $className, string $version = 'v1', boolean $abort = true) |
|
285 | 285 | { |
286 | 286 | return bdClassExists(config('bludata.generator.paths.entities'), $className, $version, $abort); |
287 | 287 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param string $version = 'v1' |
294 | 294 | * @param boolean $abort = true |
295 | 295 | */ |
296 | - function bdEntity(string $className, string $version = 'v1', boolean $abort = true) |
|
296 | + function bdEntity (string $className, string $version = 'v1', boolean $abort = true) |
|
297 | 297 | { |
298 | 298 | return app(bdEntityClass($className, $version, $abort)); |
299 | 299 | } |