@@ -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 | { |
@@ -56,6 +56,9 @@ |
||
| 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; |
@@ -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 { |
@@ -35,7 +35,7 @@ discard block |
||
| 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 |
||
| 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 | |