Completed
Push — master ( 215596...154eb7 )
by Martin
03:32
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/Page/EventPage.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -121,6 +121,9 @@
 block discarded – undo
121 121
         return $sessions;
122 122
     }
123 123
 
124
+    /**
125
+     * @param Event $event
126
+     */
124 127
     public function getComments($event)
125 128
     {
126 129
         $comments = $this->crawler->filter('.comments .comment')->each(function (Crawler $node) use ($event) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $sessions = new ArrayCollection();
83 83
 
84
-        $this->crawler->filter('#snippet--program dt')->each(function (Crawler $dt) use ($sessions, $event) {
84
+        $this->crawler->filter('#snippet--program dt')->each(function(Crawler $dt) use ($sessions, $event) {
85 85
             $session = new Session();
86 86
             $session->setEvent($event);
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             $sessions->add($session);
98 98
         });
99 99
 
100
-        $this->crawler->filter('#snippet--program dd')->each(function (Crawler $dd, $i) use ($sessions) {
100
+        $this->crawler->filter('#snippet--program dd')->each(function(Crawler $dd, $i) use ($sessions) {
101 101
             $session = $sessions[$i];
102 102
             if (preg_match('/program-type-([^ ]+)/', $dd->attr('class'), $matches)) {
103 103
                 $session->setType($matches[1]);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
     public function getComments($event)
125 125
     {
126
-        $comments = $this->crawler->filter('.comments .comment')->each(function (Crawler $node) use ($event) {
126
+        $comments = $this->crawler->filter('.comments .comment')->each(function(Crawler $node) use ($event) {
127 127
             $date = trim($node->filter('.comment-date')->text());
128 128
             $date = \DateTime::createFromFormat('d. m. Y v H:i', $date, new \DateTimeZone('Europe/Prague'));
129 129
 
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.