@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | $uriPath = $xpath->query("//a[contains(@title, 'visit their website')]"); |
38 | 38 | |
39 | - if (! $uriPath || $uriPath->length == 0) { |
|
39 | + if (!$uriPath || $uriPath->length == 0) { |
|
40 | 40 | throw new \InvalidArgumentException('The CfP does not seem to have an EventUri'); |
41 | 41 | } |
42 | 42 |
@@ -32,6 +32,10 @@ |
||
32 | 32 | class EventUri |
33 | 33 | { |
34 | 34 | |
35 | + /** |
|
36 | + * @param \DOMDocument $dom |
|
37 | + * @param \DOMXPath $xpath |
|
38 | + */ |
|
35 | 39 | public function parse($dom, $xpath) |
36 | 40 | { |
37 | 41 | $uriPath = $xpath->query("//a[contains(@title, 'visit their website')]"); |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | $content = json_decode($content, true); |
48 | 48 | |
49 | 49 | foreach ($content['events'] as $event) { |
50 | - if (! $event['cfp_url']) { |
|
50 | + if (!$event['cfp_url']) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | $info = new Cfp(); |
54 | 54 | $info->conferenceName = $event['name']; |
55 | 55 | $info->conferenceUri = $event['href']; |
56 | 56 | if ($event['icon']) { |
57 | - $info->iconUri = 'https://joind.in/inc/img/event_icons/' . $event['icon']; |
|
57 | + $info->iconUri = 'https://joind.in/inc/img/event_icons/'.$event['icon']; |
|
58 | 58 | } |
59 | 59 | $info->eventEndDate = new \DateTimeImmutable($event['end_date']); |
60 | 60 | $info->eventStartDate = new \DateTimeImmutable($event['start_date']); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $info->longitude = $event['longitude']; |
67 | 67 | $info->tags = $event['tags']; |
68 | 68 | $info->uri = $event['cfp_url']; |
69 | - $info->timezone = $event['tz_continent'] . '/' . $event['tz_place']; |
|
69 | + $info->timezone = $event['tz_continent'].'/'.$event['tz_place']; |
|
70 | 70 | |
71 | 71 | $writer->write($info, 'joind.in'); |
72 | 72 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | do { |
48 | 48 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
49 | - $dom->loadHTMLFile($uri . '?page=' . ($i+1)); |
|
49 | + $dom->loadHTMLFile($uri.'?page='.($i + 1)); |
|
50 | 50 | $dom->preserveWhiteSpace = false; |
51 | 51 | |
52 | 52 | $xpath = new \DOMXPath($dom); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $eventPageUrl = $links->item(0)->attributes->getNamedItem('href')->textContent; |
79 | 79 | error_log($eventPageUrl); |
80 | - if (! $eventPageUrl) { |
|
80 | + if (!$eventPageUrl) { |
|
81 | 81 | continue; |
82 | 82 | } |
83 | 83 | $writer->write($lanyrdEntryParser->parse($eventPageUrl), 'lanyrd.com'); |
@@ -30,7 +30,6 @@ |
||
30 | 30 | namespace Callingallpapers\Parser\Lanyrd; |
31 | 31 | |
32 | 32 | use Callingallpapers\Entity\Cfp; |
33 | -use Callingallpapers\Parser\Lanyrd\LanyrdEntryParser; |
|
34 | 33 | use Callingallpapers\Parser\ParserInterface; |
35 | 34 | use Callingallpapers\Service\TimezoneService; |
36 | 35 | use Callingallpapers\Writer\WriterInterface; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | class WriterFactory |
31 | 31 | { |
32 | - public $configFile = __DIR__ . '/../../config/callingallpapers.ini'; |
|
32 | + public $configFile = __DIR__.'/../../config/callingallpapers.ini'; |
|
33 | 33 | |
34 | 34 | public function getWriter() |
35 | 35 | { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | throw new UnknownWriterException('The requested writer could not be created'); |
43 | 43 | } |
44 | 44 | |
45 | - if (! $writer instanceof WriterInterface) { |
|
45 | + if (!$writer instanceof WriterInterface) { |
|
46 | 46 | throw new InvalidWriterException('The requested writer is not of the expected type'); |
47 | 47 | } |
48 | 48 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | $values = json_decode($result->getBody()->getContents(), true); |
65 | 65 | |
66 | - if (! isset($values['status']) || $values['status'] !== 'OK') { |
|
66 | + if (!isset($values['status']) || $values['status'] !== 'OK') { |
|
67 | 67 | return 'UTC'; |
68 | 68 | } |
69 | 69 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $list; |
93 | 93 | } |
94 | 94 | |
95 | - if (! $items) { |
|
95 | + if (!$items) { |
|
96 | 96 | return $list; |
97 | 97 | } |
98 | 98 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $cfp->longitude = $item['longitude']; |
111 | 111 | $cfp->iconUri = $item['iconUri']; |
112 | 112 | $cfp->uri = $item['uri']; |
113 | - $cfp->tags = array_filter($item['tags'], function ($item) { |
|
113 | + $cfp->tags = array_filter($item['tags'], function($item) { |
|
114 | 114 | return (bool) $item; |
115 | 115 | }); |
116 | 116 | $cfp->timezone = $item['timezone']; |
@@ -45,18 +45,18 @@ |
||
45 | 45 | protected function configure() |
46 | 46 | { |
47 | 47 | $this->setName("notifyClosingCfps") |
48 | - ->setDescription("Notify about CfPs that close within 24 hours") |
|
49 | - ->setDefinition(array( |
|
50 | - new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
51 | - )) |
|
52 | - ->setHelp(<<<EOT |
|
48 | + ->setDescription("Notify about CfPs that close within 24 hours") |
|
49 | + ->setDefinition(array( |
|
50 | + new InputOption('start', 's', InputOption::VALUE_OPTIONAL, 'What should be the first date to be taken into account?', ''), |
|
51 | + )) |
|
52 | + ->setHelp(<<<EOT |
|
53 | 53 | Notify about CfPs that are closing within 24 hours |
54 | 54 | |
55 | 55 | Usage: |
56 | 56 | |
57 | 57 | <info>callingallpapers notifyClosingCfp</info> |
58 | 58 | EOT |
59 | - ); |
|
59 | + ); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -66,11 +66,11 @@ |
||
66 | 66 | |
67 | 67 | $start = new \DateTime($input->getOption('start')); |
68 | 68 | |
69 | - if (! $start instanceof \DateTime) { |
|
69 | + if (!$start instanceof \DateTime) { |
|
70 | 70 | throw new \InvalidArgumentException('The given date could not be parsed'); |
71 | 71 | } |
72 | 72 | |
73 | - $config = parse_ini_file(__DIR__ . '/../../config/callingallpapers.ini'); |
|
73 | + $config = parse_ini_file(__DIR__.'/../../config/callingallpapers.ini'); |
|
74 | 74 | $reader = new ApiCfpReader($config['event_api_url'], $config['event_api_token']); |
75 | 75 | $cfps = $reader->getCfpsEndingWithinInterval( |
76 | 76 | new \DateInterval('PT1H'), |
@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | public function addTag($tag) |
107 | 107 | { |
108 | - if (! in_array($tag, $this->tags)) { |
|
108 | + if (!in_array($tag, $this->tags)) { |
|
109 | 109 | $this->tags[] = $tag; |
110 | 110 | } |
111 | 111 | } |
@@ -38,6 +38,10 @@ |
||
38 | 38 | $this->timezone = new \DateTimezone($timezone); |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param \DOMDocument $dom |
|
43 | + * @param \DOMXPath $xpath |
|
44 | + */ |
|
41 | 45 | public function parse($dom, $xpath) |
42 | 46 | { |
43 | 47 | $openingDate = $xpath->query("//span[text()='Openend on:']/following-sibling::strong"); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function parse($dom, $xpath) |
42 | 42 | { |
43 | 43 | $openingDate = $xpath->query("//span[text()='Openend on:']/following-sibling::strong"); |
44 | - if (! $openingDate || $openingDate->length == 0) { |
|
44 | + if (!$openingDate || $openingDate->length == 0) { |
|
45 | 45 | throw new \UnexpectedValueException('No CfP-Open Date found'); |
46 | 46 | } |
47 | 47 |