diff --git a/phpcs.xml b/phpcs.xml index f460698..0ff746b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,27 +1,33 @@ - + -PHPCS configuration file. + PHPCS configuration file. - - - - - - + + + + + + - -src/ + + src/ - - + + + + + - - - - - - + + + + + + + + + diff --git a/src/pigeon.php b/src/pigeon.php index 9ce5cd6..18b0b6d 100644 --- a/src/pigeon.php +++ b/src/pigeon.php @@ -15,7 +15,7 @@ use Pigeon\Models\Video; $config = new Config('config/config.yaml'); // create Eloquent connection object -$capsule = new Capsule; +$capsule = new Capsule(); $capsule->addConnection([ 'driver' => 'sqlite', 'database' => $config->get('pigeon.db_path'), @@ -36,12 +36,12 @@ $uploads = $youtube->getPlaylistItemsByPlaylistId($config->get('youtube.uploads_ // create Video model objects with the above uploads foreach ($uploads as $u) { - $video = new Video; + $video = new Video(); $video->video_id = $u->contentDetails->videoId; $video->published_at = date($u->contentDetails->videoPublishedAt); // create the table entry if it doesn't already exist - Video::where('video_id', $video->video_id)->firstOr(function() use ($video) { + Video::where('video_id', $video->video_id)->firstOr(function () use ($video) { $video->save(); }); } @@ -63,7 +63,7 @@ $loop->addPeriodicTimer($config->get('pigeon.check_interval') * 60, function () $uploadDetails = $uploads[0]->contentDetails; // search for the latest video in the DB - Video::where('video_id', $uploadDetails->videoId)->firstOr(function() use ($discord, $config, $uploadDetails) { + Video::where('video_id', $uploadDetails->videoId)->firstOr(function () use ($discord, $config, $uploadDetails) { $latest_url = "https://youtu.be/$uploadDetails->videoId"; $message_text = str_replace('{link}', $latest_url, $config->get('discord.message_template')); @@ -75,7 +75,7 @@ $loop->addPeriodicTimer($config->get('pigeon.check_interval') * 60, function () }); // add the video to the DB - $video = new Video; + $video = new Video(); $video->video_id = $uploadDetails->videoId; $video->published_at = date($uploadDetails->videoPublishedAt); $video->save();