Completed
Push — master ( 154eb7...2fa72a )
by Martin
04:05
created
src/Client.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@  discard block
 block discarded – undo
53 53
         return $this->{$type}();
54 54
     }
55 55
 
56
+    /**
57
+     * @param string $url
58
+     */
56 59
     public function ajax($url, array $options = [], \Closure $processor = null)
57 60
     {
58 61
         $options['headers'] = array_merge(isset($options['headers']) ? $options['headers'] : [], ['X-Requested-With' => 'XMLHttpRequest']);
@@ -75,6 +78,9 @@  discard block
 block discarded – undo
75 78
         return $crawler;
76 79
     }
77 80
 
81
+    /**
82
+     * @param string $uri
83
+     */
78 84
     public function model($class, $uri)
79 85
     {
80 86
         return $this->manager->get($class, $uri, $this->initializer($class, $uri));
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 
83 83
     private function initializer($class)
84 84
     {
85
-        $initializer = function (GhostObjectInterface &$wrappedObject, $method, array $parameters) use ($class) {
85
+        $initializer = function(GhostObjectInterface&$wrappedObject, $method, array $parameters) use ($class) {
86 86
             if (!method_exists($wrappedObject, $method)) {
87 87
                 return;
88 88
             }
Please login to merge, or discard this patch.
src/Api/EventApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $url = $event->getUri().'?what=yes&do=showAll';
39 39
 
40
-        $crawler = $this->client->ajax($url, [], function ($response) {
40
+        $crawler = $this->client->ajax($url, [], function($response) {
41 41
             return $this->getAttendeesSnippet($response, 'snippet--visitorsallyes');
42 42
         });
43 43
         $page = new AttendeesPage($crawler, $this->client);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $url = $event->getUri().'?what=maybe&do=showAll';
54 54
 
55
-        $crawler = $this->client->ajax($url, [], function ($response) {
55
+        $crawler = $this->client->ajax($url, [], function($response) {
56 56
             return $this->getAttendeesSnippet($response, 'snippet--visitorsallmaybe');
57 57
         });
58 58
         $page = new AttendeesPage($crawler, $this->client);
Please login to merge, or discard this patch.
src/Page/AttendeesPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     public function getAttendees()
22 22
     {
23
-        $attendees = $this->crawler->filter('.attendee-name')->each(function (Crawler $node) {
23
+        $attendees = $this->crawler->filter('.attendee-name')->each(function(Crawler $node) {
24 24
             $uri = $node->link()->getUri();
25 25
 
26 26
             $user = $this->client->model(User::class, $uri);
Please login to merge, or discard this patch.
src/Page/SeriesPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     public function getEvents(Series $series)
40 40
     {
41
-        $events = $this->crawler->filter('.event-main .row .row')->each(function (Crawler $row) use ($series) {
41
+        $events = $this->crawler->filter('.event-main .row .row')->each(function(Crawler $row) use ($series) {
42 42
             $uri = $row->filter('h4 a')->link()->getUri();
43 43
             $event = $this->client->model(Event::class, $uri);
44 44
             $event->setSeries($series);
Please login to merge, or discard this patch.
src/Page/CommunityPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     public function getUsers()
22 22
     {
23
-        $users = $this->crawler->filter('.user-list a')->each(function (Crawler $node) {
23
+        $users = $this->crawler->filter('.user-list a')->each(function(Crawler $node) {
24 24
             $uri = $node->link()->getUri();
25 25
 
26 26
             /* @var $user User */
Please login to merge, or discard this patch.
src/Page/SearchPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 {
22 22
     public function getSeries()
23 23
     {
24
-        $series = $this->crawler->filter('.body-default .span6:first-child h3 a')->each(function (Crawler $link) {
24
+        $series = $this->crawler->filter('.body-default .span6:first-child h3 a')->each(function(Crawler $link) {
25 25
             $uri = $link->link()->getUri();
26 26
             $series = $this->client->model(Series::class, $uri);
27 27
             $series->setName($link->text());
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function getUsers()
37 37
     {
38
-        $users = $this->crawler->filter('.body-default .span6 + .span6 h3 a')->each(function (Crawler $link) {
38
+        $users = $this->crawler->filter('.body-default .span6 + .span6 h3 a')->each(function(Crawler $link) {
39 39
             $uri = $link->link()->getUri();
40 40
             $user = $this->client->model(User::class, $uri);
41 41
             $user->setName($link->text());
Please login to merge, or discard this patch.
src/Page/EventPage.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -123,6 +123,9 @@  discard block
 block discarded – undo
123 123
         return $sessions;
124 124
     }
125 125
 
126
+    /**
127
+     * @param Event $event
128
+     */
126 129
     public function getPolls($event)
127 130
     {
128 131
         $polls = $this->crawler->filter('.poll')->each(function (Crawler $node) use ($event) {
@@ -143,6 +146,9 @@  discard block
 block discarded – undo
143 146
         return new ArrayCollection($polls);
144 147
     }
145 148
 
149
+    /**
150
+     * @param Event $event
151
+     */
146 152
     public function getComments($event)
147 153
     {
148 154
         $comments = $this->crawler->filter('.comments .comment')->each(function (Crawler $node) use ($event) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $sessions = new ArrayCollection();
85 85
 
86
-        $this->crawler->filter('#snippet--program dt')->each(function (Crawler $dt) use ($sessions, $event) {
86
+        $this->crawler->filter('#snippet--program dt')->each(function(Crawler $dt) use ($sessions, $event) {
87 87
             $session = new Session();
88 88
             $session->setEvent($event);
89 89
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $sessions->add($session);
100 100
         });
101 101
 
102
-        $this->crawler->filter('#snippet--program dd')->each(function (Crawler $dd, $i) use ($sessions) {
102
+        $this->crawler->filter('#snippet--program dd')->each(function(Crawler $dd, $i) use ($sessions) {
103 103
             $session = $sessions[$i];
104 104
             if (preg_match('/program-type-([^ ]+)/', $dd->attr('class'), $matches)) {
105 105
                 $session->setType($matches[1]);
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
 
126 126
     public function getPolls($event)
127 127
     {
128
-        $polls = $this->crawler->filter('.poll')->each(function (Crawler $node) use ($event) {
128
+        $polls = $this->crawler->filter('.poll')->each(function(Crawler $node) use ($event) {
129 129
             $poll = new Poll();
130 130
             $poll->setEvent($event);
131 131
             $poll->setName(trim($node->filter('.pollName')->text()));
132
-            $data = $node->filter('.pollRow')->each(function ($node) {
132
+            $data = $node->filter('.pollRow')->each(function($node) {
133 133
                 return [
134 134
                     trim($node->filter('.pollRowText')->text()),
135 135
                     trim($node->filter('.progress')->text()),
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
     public function getComments($event)
147 147
     {
148
-        $comments = $this->crawler->filter('.comments .comment')->each(function (Crawler $node) use ($event) {
148
+        $comments = $this->crawler->filter('.comments .comment')->each(function(Crawler $node) use ($event) {
149 149
             $date = trim($node->filter('.comment-date')->text());
150 150
             $date = \DateTime::createFromFormat('d. m. Y v H:i', $date, new \DateTimeZone('Europe/Prague'));
151 151
 
Please login to merge, or discard this patch.