@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | /** |
126 | 126 | * Get Protocol |
127 | - * @return mixed |
|
127 | + * @return string |
|
128 | 128 | */ |
129 | 129 | public function getProtocol() |
130 | 130 | { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | /** |
135 | 135 | * Get HTTP TYPE |
136 | - * @return mixed |
|
136 | + * @return string |
|
137 | 137 | */ |
138 | 138 | public function getHttpType() |
139 | 139 | { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | /** |
162 | 162 | * Concatenation Url In Curl |
163 | - * @param $newParameters |
|
163 | + * @param string $newParameters |
|
164 | 164 | * @return $this |
165 | 165 | */ |
166 | 166 | protected function concatenationUrlCurl($newParameters) |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | /** |
188 | 188 | * Получить обьект для обновления |
189 | - * @return Select |
|
189 | + * @return Update |
|
190 | 190 | */ |
191 | 191 | public function update() |
192 | 192 | { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Get Object for class create |
198 | - * @return Select |
|
198 | + * @return Create |
|
199 | 199 | */ |
200 | 200 | public function create() |
201 | 201 | { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | /** |
205 | 205 | * Get Object for class delete |
206 | - * @return Select |
|
206 | + * @return Delete |
|
207 | 207 | */ |
208 | 208 | public function delete() |
209 | 209 | { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Validation of BPM API response |
259 | 259 | * @param $request |
260 | - * @return bool |
|
260 | + * @return null|boolean |
|
261 | 261 | */ |
262 | 262 | private function checkRequestAuth($request) |
263 | 263 | { |
@@ -3,9 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use agoalofalife\bpmOnline\Facade\Authentication as CookieBpm; |
5 | 5 | use Assert\Assertion; |
6 | -use agoalofalife\bpmOnline\Contract\CreatorData; |
|
7 | 6 | use Illuminate\Config\Repository; |
8 | -use Illuminate\Container\Container; |
|
9 | 7 | |
10 | 8 | /*** |
11 | 9 | * @documentation BPM https://academy.terrasoft.ru/documents/technic-sdk/7-8-0/rabota-s-obektami-bpmonline-po-protokolu-odata-s-ispolzovaniem-http |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $collection = ucfirst($collection); |
83 | 83 | $format = mb_strtolower($format); |
84 | 84 | \Assert\that($collection, 'The first parameter expects a string to the type of collection has BPM')->string(); |
85 | - Assertion::regex($format, '~^json$|^xml$~', 'Expects parameter json or xml'); |
|
85 | + Assertion::regex($format, '~^json$|^xml$~', 'Expects parameter json or xml'); |
|
86 | 86 | } |
87 | 87 | /** |
88 | 88 | * Get Base URL |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $this->protocol, |
226 | 226 | $this->Content_type, |
227 | 227 | $this->formatCurl, |
228 | - ]; |
|
228 | + ]; |
|
229 | 229 | |
230 | 230 | !empty($Data)?curl_setopt($curl, CURLOPT_POSTFIELDS, $Data):true; |
231 | 231 | curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->HTTP_TYPE); |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | |
287 | 287 | foreach ( scandir($pathToConfig) as $file) |
288 | 288 | { |
289 | - if ( preg_match('/.php/', $file) ) |
|
290 | - { |
|
291 | - $nameFile = preg_replace('/.php/', '', $file); |
|
289 | + if ( preg_match('/.php/', $file) ) |
|
290 | + { |
|
291 | + $nameFile = preg_replace('/.php/', '', $file); |
|
292 | 292 | |
293 | - app('config')->set($nameFile, require_once $pathToConfig . '/'.$file); |
|
294 | - } |
|
293 | + app('config')->set($nameFile, require_once $pathToConfig . '/'.$file); |
|
294 | + } |
|
295 | 295 | } |
296 | 296 | } |
297 | 297 | } |
298 | 298 | \ No newline at end of file |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * Type HTTP |
20 | 20 | * @var string |
21 | 21 | */ |
22 | - protected $HTTP_TYPE ; |
|
22 | + protected $HTTP_TYPE; |
|
23 | 23 | /** |
24 | 24 | * Type protocol HTTP |
25 | 25 | * @var string |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | $format = strtoupper($format); |
104 | 104 | switch ($format) { |
105 | 105 | case 'JSON': |
106 | - $this->formatCurl = 'Accept: application/json;odata=verbose'; |
|
107 | - $this->Content_type = 'Content-type: application/json;odata=verbose;'; |
|
106 | + $this->formatCurl = 'Accept: application/json;odata=verbose'; |
|
107 | + $this->Content_type = 'Content-type: application/json;odata=verbose;'; |
|
108 | 108 | break; |
109 | 109 | case 'XML': |
110 | - $this->formatCurl = 'application/atom+xml;type=entry;'; |
|
111 | - $this->Content_type = 'Content-type: application/atom+xml;type=entry;'; |
|
110 | + $this->formatCurl = 'application/atom+xml;type=entry;'; |
|
111 | + $this->Content_type = 'Content-type: application/atom+xml;type=entry;'; |
|
112 | 112 | break; |
113 | 113 | } |
114 | 114 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | protected function concatenationUrlCurl($newParameters) |
167 | 167 | { |
168 | - if ($this->UrlHome == '?') { |
|
168 | + if ($this->UrlHome == '?') { |
|
169 | 169 | $this->URL_CURL .= $newParameters; |
170 | 170 | } elseif ($this->URL_CURL == '') { |
171 | 171 | $this->URL_CURL .= $newParameters; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $this->formatCurl, |
228 | 228 | ]; |
229 | 229 | |
230 | - !empty($Data)?curl_setopt($curl, CURLOPT_POSTFIELDS, $Data):true; |
|
230 | + !empty($Data) ? curl_setopt($curl, CURLOPT_POSTFIELDS, $Data) : true; |
|
231 | 231 | curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->HTTP_TYPE); |
232 | 232 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
233 | 233 | curl_setopt($curl, CURLOPT_COOKIE, $this->getCookie()); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | private function bootstrapping() |
276 | 276 | { |
277 | - if ( app()->resolved('config') === false ) |
|
277 | + if (app()->resolved('config') === false) |
|
278 | 278 | { |
279 | 279 | app()->instance('config', new Repository()); |
280 | 280 | } |
@@ -282,15 +282,15 @@ discard block |
||
282 | 282 | |
283 | 283 | private function loadConfiguration() |
284 | 284 | { |
285 | - $pathToConfig = $_SERVER['PWD'] . '/config'; |
|
285 | + $pathToConfig = $_SERVER['PWD'].'/config'; |
|
286 | 286 | |
287 | - foreach ( scandir($pathToConfig) as $file) |
|
287 | + foreach (scandir($pathToConfig) as $file) |
|
288 | 288 | { |
289 | - if ( preg_match('/.php/', $file) ) |
|
289 | + if (preg_match('/.php/', $file)) |
|
290 | 290 | { |
291 | 291 | $nameFile = preg_replace('/.php/', '', $file); |
292 | 292 | |
293 | - app('config')->set($nameFile, require_once $pathToConfig . '/'.$file); |
|
293 | + app('config')->set($nameFile, require_once $pathToConfig.'/'.$file); |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | } |
@@ -20,8 +20,8 @@ |
||
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Create constructor. |
23 | - * @param null $collection |
|
24 | - * @param null $format |
|
23 | + * @param string $collection |
|
24 | + * @param string $format |
|
25 | 25 | */ |
26 | 26 | public function __construct($collection, $format) |
27 | 27 | { |
@@ -14,6 +14,10 @@ discard block |
||
14 | 14 | */ |
15 | 15 | protected $HTTP_TYPE = 'GET'; |
16 | 16 | |
17 | + /** |
|
18 | + * @param string $collection |
|
19 | + * @param string $format |
|
20 | + */ |
|
17 | 21 | public function __construct($collection,$format) |
18 | 22 | { |
19 | 23 | parent::__construct($collection,$format); |
@@ -24,7 +28,7 @@ discard block |
||
24 | 28 | * Restrictions in the sample query |
25 | 29 | * If you want the request to return more than 40 records at a time, it can be implemented using the parameter $ top |
26 | 30 | * @param $amountMax |
27 | - * @return string |
|
31 | + * @return Select |
|
28 | 32 | */ |
29 | 33 | public function amount($amountMax=null) |
30 | 34 | { |
@@ -71,7 +75,7 @@ discard block |
||
71 | 75 | * Example $newobject->select()->choose()->orderby()->run(); |
72 | 76 | * It can not use |
73 | 77 | * @param array $parameters |
74 | - * @return string |
|
78 | + * @return Select |
|
75 | 79 | */ |
76 | 80 | public function choose($parameters = array()) |
77 | 81 | { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public function __construct($collection,$format) |
18 | 18 | { |
19 | - parent::__construct($collection,$format); |
|
19 | + parent::__construct($collection,$format); |
|
20 | 20 | |
21 | 21 | $this->getFormatData($format); |
22 | 22 | } |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | */ |
15 | 15 | protected $HTTP_TYPE = 'GET'; |
16 | 16 | |
17 | - public function __construct($collection,$format) |
|
17 | + public function __construct($collection, $format) |
|
18 | 18 | { |
19 | - parent::__construct($collection,$format); |
|
19 | + parent::__construct($collection, $format); |
|
20 | 20 | |
21 | 21 | $this->getFormatData($format); |
22 | 22 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * @param $amountMax |
27 | 27 | * @return string |
28 | 28 | */ |
29 | - public function amount($amountMax=null) |
|
29 | + public function amount($amountMax = null) |
|
30 | 30 | { |
31 | - \Assert\that($amountMax,'You must specify a numeric parameter for the amount of the method')->integer(); |
|
31 | + \Assert\that($amountMax, 'You must specify a numeric parameter for the amount of the method')->integer(); |
|
32 | 32 | $ParameterQuery = '$top='.$amountMax; |
33 | 33 | return $this->concatenationUrlCurl($ParameterQuery); |
34 | 34 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | public function orderby($asc, $param = null) |
58 | 58 | { |
59 | 59 | $ParameterQuery = '$orderby='; |
60 | - $ParameterQuery.= ucfirst($asc); |
|
60 | + $ParameterQuery .= ucfirst($asc); |
|
61 | 61 | if (!empty($param)) { |
62 | 62 | if ($param != 'desc' && $param != 'asc') { |
63 | 63 | throw new \Exception('no valid orderby parameters'); |
64 | 64 | } |
65 | - $ParameterQuery.= " ".$param; |
|
65 | + $ParameterQuery .= " ".$param; |
|
66 | 66 | } |
67 | 67 | return $this->concatenationUrlCurl($ParameterQuery); |
68 | 68 | } |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function choose($parameters = array()) |
77 | 77 | { |
78 | - $ParameterQuery='select='; |
|
78 | + $ParameterQuery = 'select='; |
|
79 | 79 | $counter = 0; |
80 | 80 | foreach ($parameters as $parameter) { |
81 | 81 | $counter++; |
82 | 82 | if ($counter == count($parameters)) { |
83 | - $ParameterQuery.= ucfirst($parameter); |
|
83 | + $ParameterQuery .= ucfirst($parameter); |
|
84 | 84 | } else { |
85 | - $ParameterQuery.= ucfirst($parameter).','; |
|
85 | + $ParameterQuery .= ucfirst($parameter).','; |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | return $this->concatenationUrlCurl($ParameterQuery); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | public function filterConstructor($strRequest) |
103 | 103 | { |
104 | 104 | $ParameterQuery = '$filter='; |
105 | - $ParameterQuery.= $strRequest; |
|
105 | + $ParameterQuery .= $strRequest; |
|
106 | 106 | return $this->concatenationUrlCurl($ParameterQuery); |
107 | 107 | } |
108 | 108 |
@@ -7,6 +7,10 @@ |
||
7 | 7 | { |
8 | 8 | protected $HTTP_TYPE = 'PUT'; |
9 | 9 | |
10 | + /** |
|
11 | + * @param string $collection |
|
12 | + * @param string $format |
|
13 | + */ |
|
10 | 14 | public function __construct($collection, $format) |
11 | 15 | { |
12 | 16 | parent::__construct($collection, $format); |
@@ -22,10 +22,10 @@ |
||
22 | 22 | { |
23 | 23 | $this->URL_CURL = ''; |
24 | 24 | $ParameterQuery = '(guid'; |
25 | - $ParameterQuery.= "'"; |
|
26 | - $ParameterQuery.= $guid; |
|
27 | - $ParameterQuery.= "'"; |
|
28 | - $ParameterQuery.=')'; |
|
25 | + $ParameterQuery .= "'"; |
|
26 | + $ParameterQuery .= $guid; |
|
27 | + $ParameterQuery .= "'"; |
|
28 | + $ParameterQuery .= ')'; |
|
29 | 29 | return $this->concatenationUrlCurl($ParameterQuery); |
30 | 30 | } |
31 | 31 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | /** |
74 | 74 | * Get one Element |
75 | - * @return mixed |
|
75 | + * @return XmlHandler |
|
76 | 76 | */ |
77 | 77 | public function arrayOne() |
78 | 78 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Extraction array in response XML , more element one |
86 | - * @return array |
|
86 | + * @return XmlHandler|null |
|
87 | 87 | * @throws \Exception |
88 | 88 | */ |
89 | 89 | public function arrayMany() |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | /** |
149 | 149 | * Get collect Data in proprty @responceRender |
150 | - * @return mixed |
|
150 | + * @return \Illuminate\Support\Collection |
|
151 | 151 | */ |
152 | 152 | public function collectData() |
153 | 153 | { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | try { |
93 | 93 | foreach ($this->responceXML->children(self::$Atom)->entry as $item) { |
94 | 94 | $array_cashe[] = $item->content->children(self::$Metadata) |
95 | - ->children(self::$Dataservices); |
|
95 | + ->children(self::$Dataservices); |
|
96 | 96 | } |
97 | 97 | return $this->Addrender($array_cashe); |
98 | 98 | } catch (\Exeption $e) { |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $value = $dom->createTextNode($value[key($value)]); |
175 | 175 | $xmlBase->appendChild($value); |
176 | 176 | } |
177 | - //---------- <content type="application/xml"> ----------// |
|
177 | + //---------- <content type="application/xml"> ----------// |
|
178 | 178 | $content = $dom->createElement('content'); |
179 | 179 | $entry->appendChild($content); |
180 | 180 | $xmlns_dcd = $dom->createAttribute('type'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | if ($responseXml) { |
62 | - $array_vars_list = get_object_vars($copyresponceXML); |
|
62 | + $array_vars_list = get_object_vars($copyresponceXML); |
|
63 | 63 | if (key_exists('content', $array_vars_list)) { |
64 | 64 | return $this->arrayOne(); |
65 | 65 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $array_cashe = []; |
92 | 92 | try { |
93 | 93 | foreach ($this->responceXML->children(self::$Atom)->entry as $item) { |
94 | - $array_cashe[] = $item->content->children(self::$Metadata) |
|
94 | + $array_cashe[] = $item->content->children(self::$Metadata) |
|
95 | 95 | ->children(self::$Dataservices); |
96 | 96 | } |
97 | 97 | return $this->Addrender($array_cashe); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | if (!empty($this->responceXML->message->collection->title)) { |
110 | 110 | throw new \Exception("responce BPM API : ". |
111 | - $this->responceXML->innererror->message.". ENG :". $this->responceXML->message); |
|
111 | + $this->responceXML->innererror->message.". ENG :".$this->responceXML->message); |
|
112 | 112 | } |
113 | 113 | foreach ($this->responceXML->workspace->collection as $item) { |
114 | 114 | $array_cashe[] = get_object_vars($item->children(self::$Atom))['title']; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | if (! function_exists('JsonHandler')) { |
19 | 19 | /** |
20 | 20 | * Just return object XmlHandler |
21 | - * @return XmlHandler |
|
21 | + * @return JsonHandler |
|
22 | 22 | */ |
23 | 23 | function JsonHandler() |
24 | 24 | { |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use agoalofalife\bpmOnline\Api\JsonHandler; |
4 | 4 | use Illuminate\Container\Container; |
5 | 5 | |
6 | -if (! function_exists('XmlHandler')) { |
|
6 | +if (!function_exists('XmlHandler')) { |
|
7 | 7 | /** |
8 | 8 | * Just return object XmlHandler |
9 | 9 | * @return XmlHandler |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | |
18 | -if (! function_exists('JsonHandler')) { |
|
18 | +if (!function_exists('JsonHandler')) { |
|
19 | 19 | /** |
20 | 20 | * Just return object XmlHandler |
21 | 21 | * @return XmlHandler |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | -if (! function_exists('config')) { |
|
30 | +if (!function_exists('config')) { |
|
31 | 31 | /** |
32 | 32 | * Get / set the specified configuration value. |
33 | 33 | * |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | -if (! function_exists('app')) { |
|
54 | +if (!function_exists('app')) { |
|
55 | 55 | /** |
56 | 56 | * Get the available container instance. |
57 | 57 | * |
@@ -26,10 +26,10 @@ |
||
26 | 26 | { |
27 | 27 | $this->URL_CURL = ''; |
28 | 28 | $ParameterQuery = '(guid'; |
29 | - $ParameterQuery.= "'"; |
|
30 | - $ParameterQuery.= $guid; |
|
31 | - $ParameterQuery.= "'"; |
|
32 | - $ParameterQuery.=')'; |
|
29 | + $ParameterQuery .= "'"; |
|
30 | + $ParameterQuery .= $guid; |
|
31 | + $ParameterQuery .= "'"; |
|
32 | + $ParameterQuery .= ')'; |
|
33 | 33 | return $this->concatenationUrlCurl($ParameterQuery); |
34 | 34 | } |
35 | 35 | /** |