@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ); |
52 | 52 | $request = new Request( |
53 | 53 | 'POST', |
54 | - 'statuses/update.json?' . $this->formUrlEncode([ |
|
54 | + 'statuses/update.json?'.$this->formUrlEncode([ |
|
55 | 55 | 'status' => $notificationString, |
56 | 56 | 'lat' => $cfp->latitude, |
57 | 57 | 'long' => $cfp->longitude, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (strlen($name) < 70) { |
72 | 72 | return $name; |
73 | 73 | } |
74 | - return substr($name, 0, 69) . '…'; |
|
74 | + return substr($name, 0, 69).'…'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | protected function shortenUri($uri) |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $xpath = new DOMXPath($dom); |
45 | 45 | $titlePath = $xpath->query("//div[contains(@class, 'subheader__logo')]/img"); |
46 | 46 | |
47 | - if (! $titlePath || $titlePath->length == 0) { |
|
47 | + if (!$titlePath || $titlePath->length == 0) { |
|
48 | 48 | return $cfp; |
49 | 49 | } |
50 | 50 |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | try { |
66 | 66 | $myuri = ''; |
67 | 67 | $this->client->get($uri, [ |
68 | - 'on_stats' => function (TransferStats $stats) use (&$myuri) { |
|
68 | + 'on_stats' => function(TransferStats $stats) use (&$myuri) { |
|
69 | 69 | $myuri = (string) $stats->getEffectiveUri(); |
70 | 70 | } |
71 | 71 | ]); |
72 | 72 | } catch (Exception $e) { |
73 | - throw new UnverifiedUriException('Event-URI could not be verified: ' . $e->getMessage()); |
|
73 | + throw new UnverifiedUriException('Event-URI could not be verified: '.$e->getMessage()); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this->normalizeUri($myuri); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $elements = parse_url($uri); |
82 | 82 | $newUri = ''; |
83 | 83 | if (isset($elements['scheme'])) { |
84 | - $newUri .= $elements['scheme'] . '://'; |
|
84 | + $newUri .= $elements['scheme'].'://'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | if (isset($elements['host'])) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if (isset($elements['port'])) { |
92 | - $newUri .= ':' . $elements['port']; |
|
92 | + $newUri .= ':'.$elements['port']; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | if (isset($elements['path'])) { |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if (isset($elements['query'])) { |
100 | - $newUri .= '?' . $elements['query']; |
|
100 | + $newUri .= '?'.$elements['query']; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($elements['fragment'])) { |
104 | - $newUri .= '#' . $elements['fragment']; |
|
104 | + $newUri .= '#'.$elements['fragment']; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return $newUri; |
@@ -32,15 +32,9 @@ |
||
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; |
@@ -58,11 +58,11 @@ discard block |
||
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 |
||
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) |
@@ -83,16 +83,16 @@ |
||
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 |
@@ -9,8 +9,6 @@ |
||
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 = []; |
@@ -16,7 +16,6 @@ |
||
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 | { |
@@ -105,7 +105,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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) |
@@ -11,5 +11,5 @@ |
||
11 | 11 | |
12 | 12 | class Created extends Success |
13 | 13 | { |
14 | - // Nothing to be done. |
|
14 | + // Nothing to be done. |
|
15 | 15 | } |
@@ -44,7 +44,7 @@ |
||
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 { |