@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $bandNode = $node->filter('.grid-items'); |
51 | 51 | |
52 | - return $bandNode->filter('.grid-items-item')->each(function (Crawler $node): array { |
|
52 | + return $bandNode->filter('.grid-items-item')->each(function(Crawler $node): array { |
|
53 | 53 | return array( |
54 | 54 | 'image' => $this->parseImage($node->filter('.grid-items-cover-image-image img')), |
55 | 55 | 'name' => $this->parseString($node->filter('.grid-items-item-main-text')), |
@@ -132,7 +132,7 @@ |
||
132 | 132 | */ |
133 | 133 | private function filterNull(array $object): array |
134 | 134 | { |
135 | - return array_filter($object, function ($val) { |
|
135 | + return array_filter($object, function($val) { |
|
136 | 136 | return null !== $val; |
137 | 137 | }); |
138 | 138 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | $years = $node->filter('.content-top .secondary-nav-item-link') |
30 | - ->each(function (Crawler $node) { |
|
30 | + ->each(function(Crawler $node) { |
|
31 | 31 | return (int) trim($node->text()); |
32 | 32 | }); |
33 | 33 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return array|null |
48 | 48 | */ |
49 | - public function getEvents(string $username, ? int $year, int $page = 1): ? array |
|
49 | + public function getEvents(string $username, ? int $year, int $page = 1) : ? array |
|
50 | 50 | { |
51 | 51 | $node = $this->crawlEventList($username, $year, $page); |
52 | 52 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return null; |
55 | 55 | } |
56 | 56 | |
57 | - return $node->filter('.events-list-item')->each(function (Crawler $node): array { |
|
57 | + return $node->filter('.events-list-item')->each(function(Crawler $node): array { |
|
58 | 58 | $eventNode = $node->filter('.events-list-item-event--title a'); |
59 | 59 | |
60 | 60 | $url = $this->parseUrl($eventNode); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return int|null |
79 | 79 | */ |
80 | - public function getYearPages(string $username, ? int $year): ? int |
|
80 | + public function getYearPages(string $username, ? int $year) : ? int |
|
81 | 81 | { |
82 | 82 | $node = $this->crawlEventList($username, $year); |
83 | 83 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return int|null |
99 | 99 | */ |
100 | - public function getYearCount(string $username, ? int $year, int $page = 1): ? int |
|
100 | + public function getYearCount(string $username, ? int $year, int $page = 1) : ? int |
|
101 | 101 | { |
102 | 102 | $node = $this->crawlEventList($username, $year, $page); |
103 | 103 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * |
153 | 153 | * @return Crawler|null |
154 | 154 | */ |
155 | - private function crawlEventList(string $username, ? int $year = null, int $page = 1): ? Crawler |
|
155 | + private function crawlEventList(string $username, ? int $year = null, int $page = 1) : ? Crawler |
|
156 | 156 | { |
157 | 157 | $url = 'http://www.last.fm/user/'.$username.'/events/'.($year ?: '').'?page='.$page; |
158 | 158 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | abstract class AbstractCrawler |
16 | 16 | { |
17 | - public const URL_PREFIX = 'http://last.fm'; |
|
17 | + public const URL_PREFIX = 'http://last.fm'; |
|
18 | 18 | |
19 | 19 | public const NEWLINE = "\n"; |
20 | 20 |