@@ -36,9 +36,9 @@ |
||
36 | 36 | $pages = $this->pageRepository->getByIds($pagesIds); |
37 | 37 | |
38 | 38 | $characteristics = []; |
39 | - foreach ($pages as $page){ |
|
39 | + foreach ($pages as $page) { |
|
40 | 40 | $characteristic = $this->characteristicsRepository->getByPageId($page->pageId()); |
41 | - if(!isset($characteristic)){ |
|
41 | + if (!isset($characteristic)) { |
|
42 | 42 | $characteristic = $page->createCharacteristicAssociated(); |
43 | 43 | } |
44 | 44 | $characteristics[] = $characteristic->id(); |
@@ -14,9 +14,9 @@ |
||
14 | 14 | $uri = config('wiki.api_uri').'?action=query&list=search&srwhat=text&srsearch='.$search.'&srqiprofile=classic_noboostlinks&srnamespace=3000&format=json'; |
15 | 15 | $response = $client->get($uri); |
16 | 16 | $content = json_decode($response->getBody()->getContents(), true); |
17 | - if(isset($content['query']['search'])){ |
|
17 | + if (isset($content['query']['search'])) { |
|
18 | 18 | $results = array_column($content['query']['search'], 'title'); |
19 | - return array_map(function ($item){ |
|
19 | + return array_map(function($item) { |
|
20 | 20 | return str_replace('Structure:', '', $item); |
21 | 21 | }, $results); |
22 | 22 | } |
@@ -13,10 +13,10 @@ |
||
13 | 13 | |
14 | 14 | private function serialize(array $properties) |
15 | 15 | { |
16 | - foreach ($properties as $key => $property){ |
|
17 | - if(is_object($property)){ |
|
16 | + foreach ($properties as $key => $property) { |
|
17 | + if (is_object($property)) { |
|
18 | 18 | $params[$this->camelToSnake($key)] = $this->serialize(get_object_vars($property)); |
19 | - }else { |
|
19 | + } else { |
|
20 | 20 | $params[$this->camelToSnake($key)] = $property; |
21 | 21 | } |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | foreach ($properties as $key => $property){ |
17 | 17 | if(is_object($property)){ |
18 | 18 | $params[$this->camelToSnake($key)] = $this->serialize(get_object_vars($property)); |
19 | - }else { |
|
19 | + } else { |
|
20 | 20 | $params[$this->camelToSnake($key)] = $property; |
21 | 21 | } |
22 | 22 | } |