@@ -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; |
@@ -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 { |
@@ -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 |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | $xpath = new DOMXPath($dom); |
57 | 57 | $titlePath = $xpath->query("//h1[contains(@class, 'subheader__subtitle')]"); |
58 | 58 | |
59 | - if (! $titlePath || $titlePath->length == 0) { |
|
59 | + if (!$titlePath || $titlePath->length == 0) { |
|
60 | 60 | return $cfp; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $location = trim($titlePath->item(0)->textContent); |
64 | 64 | $location = explode(PHP_EOL, $location); |
65 | 65 | |
66 | - if (! isset($location[1])) { |
|
66 | + if (!isset($location[1])) { |
|
67 | 67 | return $cfp; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $dates = explode(',', $location[1]); |
71 | - if (count($dates) % 2 !== 0) { |
|
71 | + if (count($dates) % 2 !== 0) { |
|
72 | 72 | return $cfp; |
73 | 73 | } |
74 | 74 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | return $cfp; |
77 | 77 | } |
78 | 78 | |
79 | - $startDate = new DateTimeImmutable($dates[0] . ', ' . $dates[1] . ' 00:00:00', $timezone); |
|
79 | + $startDate = new DateTimeImmutable($dates[0].', '.$dates[1].' 00:00:00', $timezone); |
|
80 | 80 | $cfp->eventStartDate = $startDate; |
81 | 81 | |
82 | 82 | return $cfp; |
@@ -57,29 +57,29 @@ |
||
57 | 57 | $xpath = new DOMXPath($dom); |
58 | 58 | $titlePath = $xpath->query("//h1[contains(@class, 'subheader__subtitle')]"); |
59 | 59 | |
60 | - if (! $titlePath || $titlePath->length == 0) { |
|
60 | + if (!$titlePath || $titlePath->length == 0) { |
|
61 | 61 | return $cfp; |
62 | 62 | } |
63 | 63 | |
64 | 64 | $locationTimeString = trim($titlePath->item(0)->textContent); |
65 | 65 | $locationTime = explode(PHP_EOL, $locationTimeString); |
66 | 66 | |
67 | - if (! isset($locationTime[1])) { |
|
67 | + if (!isset($locationTime[1])) { |
|
68 | 68 | return $cfp; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $dates = explode(',', $locationTime[1]); |
72 | - if (count($dates) % 2 !== 0) { |
|
72 | + if (count($dates) % 2 !== 0) { |
|
73 | 73 | return $cfp; |
74 | 74 | } |
75 | 75 | |
76 | - $datestring = $dates[0] . ', ' . $dates[1]; |
|
76 | + $datestring = $dates[0].', '.$dates[1]; |
|
77 | 77 | |
78 | 78 | if (count($dates) >= 4) { |
79 | - $datestring = $dates[2] . ', ' . $dates[3]; |
|
79 | + $datestring = $dates[2].', '.$dates[3]; |
|
80 | 80 | } |
81 | 81 | |
82 | - $endDate = new DateTimeImmutable($datestring . ' 00:00:00', $timezone); |
|
82 | + $endDate = new DateTimeImmutable($datestring.' 00:00:00', $timezone); |
|
83 | 83 | $cfp->eventEndDate = $endDate; |
84 | 84 | |
85 | 85 | return $cfp; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Copyright Andrea Heigl <[email protected]> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $content = preg_replace('/\<!DOCTYPE[^\>]*?\>/im', '', $content); |
46 | 46 | |
47 | 47 | $dom->loadHTML( |
48 | - '<?xml version="1.0" encoding="UTF-8" ?>' . $content, |
|
48 | + '<?xml version="1.0" encoding="UTF-8" ?>'.$content, |
|
49 | 49 | LIBXML_NOBLANKS ^ LIBXML_NOERROR ^ LIBXML_NOENT |
50 | 50 | ); |
51 | 51 | $dom->preserveWhiteSpace = false; |