Fixed some style errors; Updated the PHP_CodeSniffer rules to be better
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-03-08 12:23:41 -05:00
parent c4afe6f08e
commit 2b1ec13f53
2 changed files with 29 additions and 23 deletions

View File

@ -15,8 +15,14 @@
<file>src/</file>
<!-- Our base rule: set to PSR12-->
<rule ref="PSR12"/>
<rule ref="PSR12">
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
</rule>
<!-- Some custom rules -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.Classes.OpeningBraceSameLine" />
<!-- Set indent size to 2 -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>

View File

@ -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,7 +36,7 @@ $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);
@ -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();