Fixed some style errors; Updated the PHP_CodeSniffer rules to be better
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
c4afe6f08e
commit
2b1ec13f53
@ -15,8 +15,14 @@
|
|||||||
<file>src/</file>
|
<file>src/</file>
|
||||||
|
|
||||||
<!-- Our base rule: set to PSR12-->
|
<!-- 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 -->
|
<!-- Set indent size to 2 -->
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -15,7 +15,7 @@ use Pigeon\Models\Video;
|
|||||||
$config = new Config('config/config.yaml');
|
$config = new Config('config/config.yaml');
|
||||||
|
|
||||||
// create Eloquent connection object
|
// create Eloquent connection object
|
||||||
$capsule = new Capsule;
|
$capsule = new Capsule();
|
||||||
$capsule->addConnection([
|
$capsule->addConnection([
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => $config->get('pigeon.db_path'),
|
'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
|
// create Video model objects with the above uploads
|
||||||
foreach ($uploads as $u) {
|
foreach ($uploads as $u) {
|
||||||
$video = new Video;
|
$video = new Video();
|
||||||
$video->video_id = $u->contentDetails->videoId;
|
$video->video_id = $u->contentDetails->videoId;
|
||||||
$video->published_at = date($u->contentDetails->videoPublishedAt);
|
$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
|
// add the video to the DB
|
||||||
$video = new Video;
|
$video = new Video();
|
||||||
$video->video_id = $uploadDetails->videoId;
|
$video->video_id = $uploadDetails->videoId;
|
||||||
$video->published_at = date($uploadDetails->videoPublishedAt);
|
$video->published_at = date($uploadDetails->videoPublishedAt);
|
||||||
$video->save();
|
$video->save();
|
||||||
|
Loading…
Reference in New Issue
Block a user