Completed
Pull Request — master (#35)
by Andreas
01:43
created
src/Command/ParseEventsConfsTech.php 3 patches
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -32,15 +32,9 @@
 block discarded – undo
32 32
 use Callingallpapers\CfpFilter\FilterList;
33 33
 use Callingallpapers\CfpFilter\FollowUriRedirect;
34 34
 use Callingallpapers\CfpFilter\StripParamsFromUri;
35
-use Callingallpapers\ErrorHandling\ErrorStore;
36
-use Callingallpapers\Exception\UnverifiedUriException;
37 35
 use Callingallpapers\Parser\ConfsTech\ConferenceParser;
38 36
 use Callingallpapers\Parser\ConfsTechParser;
39
-use Callingallpapers\Parser\JoindinCfpParser;
40
-use Callingallpapers\Parser\Lanyrd\LanyrdCfpParser;
41
-use Callingallpapers\Parser\PapercallIo\PapercallIoParserFactory;
42 37
 use Callingallpapers\ResultKeeper\ConsoleOutputResultKeeper;
43
-use Callingallpapers\ResultKeeper\ResultKeeper;
44 38
 use Callingallpapers\Service\ConfsTechParserFactory;
45 39
 use Callingallpapers\Service\GeolocationService;
46 40
 use Callingallpapers\Service\TimezoneService;
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     protected function configure()
59 59
     {
60 60
         $this->setName("parseCfPs:confs.tech")
61
-             ->setDescription("Retrieve CfPs from Confs.tech ony and parse them")
62
-             ->setDefinition(array(
63
-                 new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''),
64
-             ))
65
-             ->setHelp(<<<EOT
61
+                ->setDescription("Retrieve CfPs from Confs.tech ony and parse them")
62
+                ->setDefinition(array(
63
+                    new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''),
64
+                ))
65
+                ->setHelp(<<<EOT
66 66
 Get details about CfPs from https://confs.tech
67 67
 
68 68
 Usage:
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 If you ommit the date the current date will be used instead
73 73
 <info>callingallpapers parseCfPs<env></info>
74 74
 EOT
75
-             );
75
+                );
76 76
     }
77 77
 
78 78
     protected function execute(InputInterface $input, OutputInterface $output)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,16 +83,16 @@
 block discarded – undo
83 83
 
84 84
         $start = new \DateTime($input->getOption('start'));
85 85
 
86
-        if (! $start instanceof \DateTime) {
86
+        if (!$start instanceof \DateTime) {
87 87
             throw new \InvalidArgumentException('The given date could not be parsed');
88 88
         }
89 89
 
90
-        $config = parse_ini_file(__DIR__ . '/../../config/callingallpapers.ini');
90
+        $config = parse_ini_file(__DIR__.'/../../config/callingallpapers.ini');
91 91
 
92 92
         $client = new Client([
93 93
             'headers' => [
94 94
                 'Accept' => 'application/json',
95
-                'Authorization' => 'token ' . $config['github.token'],
95
+                'Authorization' => 'token '.$config['github.token'],
96 96
             ],
97 97
         ]);
98 98
 
Please login to merge, or discard this patch.
src/ResultKeeper/ResultKeeper.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace Callingallpapers\ResultKeeper;
11 11
 
12
-use Symfony\Component\Console\Output\OutputInterface;
13
-
14 12
 class ResultKeeper
15 13
 {
16 14
     private $errors = [];
Please login to merge, or discard this patch.
src/Service/ConfsTechParserFactory.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
 use Callingallpapers\Writer\WriterInterface;
17 17
 use DateTimeImmutable;
18 18
 use GuzzleHttp\Client;
19
-use Symfony\Component\Console\Output\OutputInterface;
20 19
 
21 20
 class ConfsTechParserFactory
22 21
 {
Please login to merge, or discard this patch.
src/Writer/ApiCfpWriter.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@
 block discarded – undo
56 56
 
57 57
     private $keeper;
58 58
 
59
+    /**
60
+     * @param Client $client
61
+     */
59 62
     public function __construct($baseUri, $bearerToken, $client = null)
60 63
     {
61 64
         $this->baseUri     = $baseUri;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
         try {
107 107
             $this->client->request('GET', sprintf(
108
-                $this->baseUri . '/%1$s',
108
+                $this->baseUri.'/%1$s',
109 109
                 sha1($cfp->conferenceUri)
110 110
             ), []);
111 111
             $exists = true;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                     $this->baseUri
121 121
                 ), [
122 122
                     'headers' => [
123
-                        'Authorization' => 'Bearer ' . $this->bearerToken,
123
+                        'Authorization' => 'Bearer '.$this->bearerToken,
124 124
                     ],
125 125
                     'form_params' => $body
126 126
                 ]);
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
             } else {
129 129
                 // Exists, so update it
130 130
                 $response = $this->client->request('PUT', sprintf(
131
-                    $this->baseUri . '/%1$s',
131
+                    $this->baseUri.'/%1$s',
132 132
                     sha1($cfp->conferenceUri)
133 133
                 ), [
134 134
                     'headers' => [
135
-                        'Authorization' => 'Bearer ' . $this->bearerToken,
135
+                        'Authorization' => 'Bearer '.$this->bearerToken,
136 136
                     ],
137 137
                     'form_params' => $body
138 138
                 ]);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $this->keeper->add($result);
151 151
         }
152 152
 
153
-        return (isset($response) && ($response->getStatusCode() === 204 || $response->getStatusCode() === 200 || $response->getStatusCode() === 201))?'Success':'Failure';
153
+        return (isset($response) && ($response->getStatusCode() === 204 || $response->getStatusCode() === 200 || $response->getStatusCode() === 201)) ? 'Success' : 'Failure';
154 154
     }
155 155
 
156 156
     public function setOutput(OutputInterface $output)
Please login to merge, or discard this patch.
src/ResultKeeper/Created.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
 
12 12
 class Created extends Success
13 13
 {
14
-   // Nothing to be done.
14
+    // Nothing to be done.
15 15
 }
Please login to merge, or discard this patch.
src/Parser/ConfsTech/CategoryParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             $cat = json_decode(base64_decode($cat['content']), true);
45 45
         }
46 46
         foreach ($cat as $conference) {
47
-            if (! isset($conference['cfpEndDate'])) {
47
+            if (!isset($conference['cfpEndDate'])) {
48 48
                 continue;
49 49
             }
50 50
             try {
Please login to merge, or discard this patch.
src/Parser/ConfsTech/ConferenceParser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $cfp->location = $conference['city'];
36 36
 
37 37
         $geolocation = $this->geolocation->getLocationForAddress(
38
-            $conference['country'] . ', ' . $cfp->location
38
+            $conference['country'].', '.$cfp->location
39 39
         );
40 40
 
41 41
         $cfp->latitude = $geolocation->getLatitude();
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
 
49 49
         $cfp->conferenceName = $conference['name'];
50 50
         $cfp->eventStartDate = new DateTimeImmutable(
51
-            $conference['startDate'] . ' 08:00:00',
51
+            $conference['startDate'].' 08:00:00',
52 52
             new DateTimeZone($cfp->timezone)
53 53
         );
54
-        if (! isset($conference['endDate'])) {
54
+        if (!isset($conference['endDate'])) {
55 55
             $conference['endDate'] = $conference['startDate'];
56 56
         }
57 57
         $cfp->eventEndDate = new DateTimeImmutable(
58
-            $conference['endDate'] . ' 17:00:00',
58
+            $conference['endDate'].' 17:00:00',
59 59
             new DateTimeZone($cfp->timezone)
60 60
         );
61 61
 
62 62
         $cfp->dateEnd = new DateTimeImmutable(
63
-            $conference['cfpEndDate'] . ' 23:59:59',
63
+            $conference['cfpEndDate'].' 23:59:59',
64 64
             new DateTimeZone($cfp->timezone)
65 65
         );
66 66
 
Please login to merge, or discard this patch.