diff --git a/.github/workflows/format-php.yml b/.github/workflows/format-php.yml index d03b3870..e755a06d 100644 --- a/.github/workflows/format-php.yml +++ b/.github/workflows/format-php.yml @@ -1,23 +1,33 @@ -name: Format (PHP) +name: Format Code -on: - push: - branches: [ main ] - paths: - - '**.php' +on: [ push ] jobs: - php-cs-fixer: + lint: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [ 8.3 ] + steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, dom, curl, libxml, mbstring + coverage: none - - name: Install - run: composer install + - name: Install Pint + run: composer global require laravel/pint - - name: Run php-cs-fixer - run: ./vendor/bin/php-cs-fixer fix + - name: Run Pint + run: pint - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit linted files + uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: Apply php-cs-fixer changes + commit_message: "Fixes coding style" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index f8c8d330..00000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,185 +0,0 @@ -setFinder( - PhpCsFixer\Finder::create() - ->in(app_path()) - ->in(config_path()) - ->in(database_path('factories')) - ->in(database_path('seeders')) - ->in(base_path('lang')) - ->in(base_path('routes')) - ->in(base_path('tests')) - ) - ->setRules([ - '@PSR2' => true, - 'align_multiline_comment' => [ - 'comment_type' => 'phpdocs_like', - ], - 'ordered_imports' => [ - 'sort_algorithm' => 'alpha', - ], - 'array_indentation' => true, - 'binary_operator_spaces' => [ - 'operators' => [ - '=>' => null, - '=' => 'single_space', - '|' => null, //@see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5495 - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'return', - ], - ], - 'cast_spaces' => true, - 'class_definition' => true, - 'clean_namespace' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => [ - 'spacing' => 'none', - ], - 'declare_equal_normalize' => true, - 'no_alias_language_construct_call' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'function_declaration' => [ - 'closure_function_spacing' => 'none', - ], - 'function_typehint_space' => true, - 'single_line_comment_style' => [ - 'comment_types' => [ - 'hash', - ], - ], - 'heredoc_to_nowdoc' => true, - 'include' => true, - 'indentation_type' => true, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - ], - 'lowercase_cast' => true, - 'constant_case' => [ - 'case' => 'lower', - ], - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'method_argument_space' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'visibility_required' => [ - 'elements' => [ - 'method', - 'property', - ], - ], - 'native_function_casing' => true, - 'native_function_type_declaration_casing' => true, - 'no_alternative_syntax' => true, - 'no_binary_string' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'throw', - 'use', - 'use_trait', - 'extra', - ], - ], - 'no_closing_tag' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'multiline_whitespace_before_semicolons' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_around_offset' => [ - 'positions' => [ - 'inside', - ], - ], - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'lambda_not_used_import' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'not_operator_with_successor_space' => true, - 'object_operator_without_whitespace' => true, - 'phpdoc_indent' => true, - 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, - 'phpdoc_trim' => true, - 'phpdoc_no_alias_tag' => [ - 'replacements' => [ - 'type' => 'var', - ], - ], - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'increment_style' => [ - 'style' => 'post', - ], - 'no_mixed_echo_print' => [ - 'use' => 'echo', - ], - 'return_type_declaration' => [ - 'space_before' => 'none', - ], - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'list_syntax' => [ - 'syntax' => 'short', - ], - 'short_scalar_cast' => true, - 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'switch_case_semicolon_to_colon' => true, - 'switch_case_space' => true, - 'switch_continue_to_break' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline' => [ - 'elements' => [ - 'arrays', - ], - ], - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'line_ending' => true, - 'whitespace_after_comma_in_array' => true, - ]); diff --git a/app/Actions/UpdateStreamAction.php b/app/Actions/UpdateStreamAction.php index a37fe745..800b5cee 100644 --- a/app/Actions/UpdateStreamAction.php +++ b/app/Actions/UpdateStreamAction.php @@ -4,6 +4,7 @@ use App\Models\Stream; use App\Services\YouTube\StreamData; + use function tap; class UpdateStreamAction diff --git a/app/Console/Commands/UpdateLiveAndFinishedStreamsCommand.php b/app/Console/Commands/UpdateLiveAndFinishedStreamsCommand.php index 4412faf4..9dfa2631 100644 --- a/app/Console/Commands/UpdateLiveAndFinishedStreamsCommand.php +++ b/app/Console/Commands/UpdateLiveAndFinishedStreamsCommand.php @@ -43,7 +43,7 @@ public function handle(): int if (is_null($streamData)) { $stream->update([ - 'status' => StreamData::STATUS_DELETED, + 'status' => StreamData::STATUS_DELETED, 'hidden_at' => Carbon::now(), ]); diff --git a/app/Livewire/ImportYouTubeChannel.php b/app/Livewire/ImportYouTubeChannel.php index 63bac28f..e61df1c7 100644 --- a/app/Livewire/ImportYouTubeChannel.php +++ b/app/Livewire/ImportYouTubeChannel.php @@ -12,6 +12,7 @@ class ImportYouTubeChannel extends Component { public string $youTubeChannelId = ''; + public string $languageCode = 'en'; public function getName(): string @@ -37,7 +38,7 @@ public function importChannel(): void dispatch(new ImportYoutubeChannelStreamsJob($this->youTubeChannelId, $this->languageCode)); - session()->flash('channel-message', 'Channel "' . $this->youTubeChannelId . '" was added successfully.'); + session()->flash('channel-message', 'Channel "'.$this->youTubeChannelId.'" was added successfully.'); $this->reset(['youTubeChannelId', 'languageCode']); } diff --git a/app/Livewire/ImportYouTubeLiveStream.php b/app/Livewire/ImportYouTubeLiveStream.php index 06c5b2da..9e3e6a1a 100644 --- a/app/Livewire/ImportYouTubeLiveStream.php +++ b/app/Livewire/ImportYouTubeLiveStream.php @@ -10,6 +10,7 @@ class ImportYouTubeLiveStream extends Component { public string $youTubeId = ''; + public string $language = 'en'; public function render(): View diff --git a/app/Models/Channel.php b/app/Models/Channel.php index 01051ff1..8cf8991b 100644 --- a/app/Models/Channel.php +++ b/app/Models/Channel.php @@ -27,7 +27,7 @@ public function scopeWithApprovedAndFinishedStreams(Builder $query): Builder return $query->whereHas('streams', function(Builder $query) { /** @var Builder $query */ $query->approved() - ->finished(); + ->finished(); }); } diff --git a/app/Models/Stream.php b/app/Models/Stream.php index 851a85ad..f5c3ac66 100644 --- a/app/Models/Stream.php +++ b/app/Models/Stream.php @@ -117,7 +117,7 @@ public function scopeUpcoming(Builder $query): Builder public function scopeUpcomingOrLive(Builder $query): Builder { return $query->where('status', StreamData::STATUS_LIVE) - ->orWhere(function (Builder $query) { + ->orWhere(function(Builder $query) { /* @phpstan-ignore-next-line */ return $query->upcoming(); }); @@ -177,11 +177,11 @@ public function scopeScheduledTimeNotPassed(Builder $query): Builder public function scopeSearch(Builder $query, ?string $search): Builder { - return $query->when($search, function (Builder $builder, ?string $search) { - $builder->where(function (Builder $query) use ($search) { + return $query->when($search, function(Builder $builder, ?string $search) { + $builder->where(function(Builder $query) use ($search) { $query ->where('title', 'like', "%$search%") - ->orWhereHas('channel', function ($query) use ($search) { + ->orWhereHas('channel', function($query) use ($search) { $query->where('name', 'like', "%$search%"); }); }); @@ -198,16 +198,16 @@ public function scopeByStreamer(Builder $query, ?string $streamerHashid): Builde return $query->when( $channelId, - fn(Builder $builder, ?string $streamerHashid) => $builder->where(fn(Builder $query) => $query->where('channel_id', $channelId)) + fn (Builder $builder, ?string $streamerHashid) => $builder->where(fn (Builder $query) => $query->where('channel_id', $channelId)) ); } public function toFeedItem(): FeedItem { return FeedItem::create() - ->id((string)$this->id) + ->id((string) $this->id) ->title($this->title) - ->summary((string)$this->description) + ->summary((string) $this->description) ->updated($this->updated_at ?? now()) ->link($this->url()) ->authorName($this->channel()->first(['id', 'name'])?->name ?? ''); @@ -228,8 +228,8 @@ public function toCalendarItem(): Event $this->title, $this->channel?->name, $this->url(), - Str::of((string)$this->description) - ->whenNotEmpty(fn(Stringable $description) => $description->prepend(str_repeat('-', 15) . PHP_EOL)) + Str::of((string) $this->description) + ->whenNotEmpty(fn (Stringable $description) => $description->prepend(str_repeat('-', 15).PHP_EOL)) ->remove("\r"), ])) ->startsAt($this->scheduled_start_time) @@ -275,20 +275,20 @@ public function isApproved(): bool public function duration(): Attribute { - return Attribute::get(function (): ?string { + return Attribute::get(function(): ?string { if (is_null($this->actual_end_time)) { return null; } $startTime = $this->actual_start_time ?? $this->scheduled_start_time; - return (int)$startTime->diffInHours($this->actual_end_time) . 'h ' . $startTime->diff($this->actual_end_time)->format('%i') . 'm'; + return (int) $startTime->diffInHours($this->actual_end_time).'h '.$startTime->diff($this->actual_end_time)->format('%i').'m'; }); } public function startForHumans(): Attribute { - return Attribute::get(function (): string { + return Attribute::get(function(): string { if ($this->actual_start_time) { return "Started {$this->actual_start_time->diffForHumans()}"; } @@ -303,6 +303,6 @@ public function startForHumans(): Attribute public function startForRobots(): Attribute { - return Attribute::get(fn() => $this->actual_start_time?->toIso8601String() ?? $this->scheduled_start_time->toIso8601String()); + return Attribute::get(fn () => $this->actual_start_time?->toIso8601String() ?? $this->scheduled_start_time->toIso8601String()); } } diff --git a/app/Models/User.php b/app/Models/User.php index bbe19840..2b551f69 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -11,7 +11,6 @@ class User extends Authenticatable use HasFactory; use Notifiable; - protected $fillable = [ 'name', 'email', diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 6c4912be..7913efbf 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,15 +2,15 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\RateLimiter; -use Illuminate\Http\Request; -use Illuminate\Cache\RateLimiting\Limit; use App\Services\YouTube\YouTubeException; +use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Http\Client\Factory; use Illuminate\Http\Client\Response; +use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Http; +use Illuminate\Support\Facades\RateLimiter; +use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -26,7 +26,7 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { - Http::macro('youtube', function(string $url, array $params = [], string $key = null): Collection { + Http::macro('youtube', function(string $url, array $params = [], ?string $key = null): Collection { /** @var Factory $this */ return $this ->asJson() @@ -55,6 +55,5 @@ public function bootRoute(): void return Limit::perMinute(60)->by((string) $request->user()?->id ?: (string) $request->ip()); }); - } } diff --git a/app/Services/Twitter/OAuthTwitter.php b/app/Services/Twitter/OAuthTwitter.php index 204072ca..6af28dfe 100644 --- a/app/Services/Twitter/OAuthTwitter.php +++ b/app/Services/Twitter/OAuthTwitter.php @@ -8,13 +8,12 @@ class OAuthTwitter implements TwitterInterface { public function __construct( protected TwitterOAuth $twitter, - ) - { + ) { } public function tweet(string $text): ?array { - $response = (array)$this->twitter->post('tweets', compact('text'), true); + $response = (array) $this->twitter->post('tweets', compact('text'), true); if ($this->twitter->getLastHttpCode() > 201) { diff --git a/app/Services/YouTube/ChannelData.php b/app/Services/YouTube/ChannelData.php index 9584d51c..15119b71 100644 --- a/app/Services/YouTube/ChannelData.php +++ b/app/Services/YouTube/ChannelData.php @@ -8,11 +8,17 @@ class ChannelData extends DataTransferObject { public string $platformId; + public string $youTubeCustomUrl; + public string $name; + public string $description; + public Carbon $onPlatformSince; + public string $thumbnailUrl; + public string $country; public function prepareForModel(): array diff --git a/app/Services/YouTube/StreamData.php b/app/Services/YouTube/StreamData.php index ea779a4b..972d3c60 100644 --- a/app/Services/YouTube/StreamData.php +++ b/app/Services/YouTube/StreamData.php @@ -8,20 +8,33 @@ class StreamData extends DataTransferObject { public const STATUS_UPCOMING = 'upcoming'; + public const STATUS_LIVE = 'live'; + public const STATUS_FINISHED = 'finished'; + public const STATUS_DELETED = 'deleted'; public string $videoId; + public string $title; + public string $channelId; + public string $channelTitle; + public string $description; + public string $thumbnailUrl; + public Carbon $publishedAt; + public Carbon $plannedStart; + public ?Carbon $actualStartTime; + public ?Carbon $actualEndTime; + public string $status; public function isLive(): bool diff --git a/app/Services/YouTubeClient.php b/app/Services/YouTubeClient.php index 387b3397..20d1be7b 100644 --- a/app/Services/YouTubeClient.php +++ b/app/Services/YouTubeClient.php @@ -14,7 +14,7 @@ class YouTubeClient public function channel(string $id): ChannelData { return $this->channels($id) - ->whenEmpty(fn () => throw YouTubeException::unknownChannel($id)) + ->whenEmpty(fn () => throw YouTubeException::unknownChannel($id)) ->first(); } diff --git a/bootstrap/app.php b/bootstrap/app.php index c1611997..8f154ecb 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -8,19 +8,19 @@ return Application::configure(basePath: dirname(__DIR__)) ->withProviders() ->withRouting( - web: __DIR__ . '/../routes/web.php', - api: __DIR__ . '/../routes/api.php', - commands: __DIR__ . '/../routes/console.php', + web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', + commands: __DIR__.'/../routes/console.php', // channels: __DIR__.'/../routes/channels.php', health: '/up', ) - ->withMiddleware(function (Middleware $middleware) { - $middleware->redirectGuestsTo(fn() => route('login')); + ->withMiddleware(function(Middleware $middleware) { + $middleware->redirectGuestsTo(fn () => route('login')); $middleware->redirectUsersTo(AppServiceProvider::HOME); $middleware->throttleApi(); }) - ->withExceptions(function (Exceptions $exceptions) { - $exceptions->reportable(function (Throwable $e) { + ->withExceptions(function(Exceptions $exceptions) { + $exceptions->reportable(function(Throwable $e) { // }); })->create(); diff --git a/composer.json b/composer.json index 46f1ad69..cc63946e 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "require-dev": { "christophrumpel/missing-livewire-assertions": "^2.5", "fakerphp/faker": "^1.23", - "friendsofphp/php-cs-fixer": "^3.6", + "laravel/pint": "^1.15", "laravel/sail": "^1.26", "mockery/mockery": "^1.6", "nunomaduro/collision": "^8.0 ", diff --git a/composer.lock b/composer.lock index d497adad..15575ffc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "391baaed15ab155ef874dbdfb048091a", + "content-hash": "cc56da354cd2dd3238d9cf1ac73a6560", "packages": [ { "name": "abraham/twitteroauth", @@ -8447,77 +8447,6 @@ }, "time": "2024-03-26T20:42:30+00:00" }, - { - "name": "composer/pcre", - "version": "3.1.3", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-03-19T10:26:25+00:00" - }, { "name": "composer/semver", "version": "3.4.0", @@ -8599,72 +8528,6 @@ ], "time": "2023-08-31T09:50:34+00:00" }, - { - "name": "composer/xdebug-handler", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255", - "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-03-26T18:29:49+00:00" - }, { "name": "fakerphp/faker", "version": "v1.23.1", @@ -8860,98 +8723,6 @@ ], "time": "2023-11-03T12:00:00+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.52.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/6e77207f0d851862ceeb6da63e6e22c01b1587bc", - "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc", - "shasum": "" - }, - "require": { - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0 || ^6.0", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/polyfill-mbstring": "^1.28", - "symfony/polyfill-php80": "^1.28", - "symfony/polyfill-php81": "^1.28", - "symfony/process": "^5.4 || ^6.0 || ^7.0", - "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.0", - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.7", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", - "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz RumiƄski", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.52.1" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2024-03-19T21:02:43+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -9062,6 +8833,72 @@ }, "time": "2024-03-08T09:58:59+00:00" }, + { + "name": "laravel/pint", + "version": "v1.15.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "3600b5d17aff52f6100ea4921849deacbbeb8656" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/3600b5d17aff52f6100ea4921849deacbbeb8656", + "reference": "3600b5d17aff52f6100ea4921849deacbbeb8656", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.54.0", + "illuminate/view": "^10.48.8", + "larastan/larastan": "^2.9.5", + "laravel-zero/framework": "^10.3.0", + "mockery/mockery": "^1.6.11", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.34.7" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-04-30T15:02:26+00:00" + }, { "name": "laravel/sail", "version": "v1.29.1", @@ -12826,136 +12663,6 @@ ], "time": "2024-02-05T13:30:14+00:00" }, - { - "name": "symfony/filesystem", - "version": "v7.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "408105dff4c104454100730bdfd1a9cdd993f04d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/408105dff4c104454100730bdfd1a9cdd993f04d", - "reference": "408105dff4c104454100730bdfd1a9cdd993f04d", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.6" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-03-21T19:37:36+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "700ff4096e346f54cb628ea650767c8130f1001f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", - "reference": "700ff4096e346f54cb628ea650767c8130f1001f", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-08-08T10:20:21+00:00" - }, { "name": "symfony/polyfill-iconv", "version": "v1.29.0", @@ -13036,82 +12743,6 @@ ], "time": "2024-01-29T20:11:03+00:00" }, - { - "name": "symfony/polyfill-php81", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, { "name": "symfony/stopwatch", "version": "v7.0.3", diff --git a/config/filesystems.php b/config/filesystems.php index b7615a38..a5aed52a 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -4,8 +4,8 @@ 'disks' => [ 'backupFolder' => [ - 'driver' => 'ftp', - 'host' => 'nomoreencore.com', + 'driver' => 'ftp', + 'host' => 'nomoreencore.com', 'username' => env('BACKUP_FTP_USER'), 'password' => env('BACKUP_FTP_PW'), ], diff --git a/config/logging.php b/config/logging.php index 8e627a9a..fc95c8a4 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,9 +1,5 @@ env('LOG_DEPRECATIONS_CHANNEL', 'null'), diff --git a/database/factories/StreamFactory.php b/database/factories/StreamFactory.php index 7e4cc5e4..b8e71ecc 100644 --- a/database/factories/StreamFactory.php +++ b/database/factories/StreamFactory.php @@ -47,7 +47,7 @@ public function definition(): array public function finished(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => Carbon::yesterday()->subDays(random_int(0, 10))->toIso8601String(), 'status' => StreamData::STATUS_FINISHED, @@ -57,7 +57,7 @@ public function finished(): StreamFactory public function upcoming(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => Carbon::today()->addDays(random_int(2, 10)), 'status' => StreamData::STATUS_UPCOMING, @@ -67,7 +67,7 @@ public function upcoming(): StreamFactory public function live(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => Carbon::now(), 'status' => StreamData::STATUS_LIVE, @@ -77,7 +77,7 @@ public function live(): StreamFactory public function deleted(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'status' => StreamData::STATUS_DELETED, 'hidden_at' => Carbon::now(), @@ -87,17 +87,17 @@ public function deleted(): StreamFactory public function approved(): StreamFactory { - return $this->state(fn() => ['approved_at' => Carbon::now()->subDay()]); + return $this->state(fn () => ['approved_at' => Carbon::now()->subDay()]); } public function notApproved(): StreamFactory { - return $this->state(fn() => ['approved_at' => null]); + return $this->state(fn () => ['approved_at' => null]); } public function liveTweetWasSend(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'tweeted_at' => now(), ]; @@ -106,7 +106,7 @@ public function liveTweetWasSend(): StreamFactory public function upcomingTweetWasSend(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => now()->addMinutes(5), 'upcoming_tweeted_at' => now(), @@ -116,7 +116,7 @@ public function upcomingTweetWasSend(): StreamFactory public function startsWithinUpcomingTweetRange(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => now()->addMinutes(5), ]; @@ -125,7 +125,7 @@ public function startsWithinUpcomingTweetRange(): StreamFactory public function startsOutsideUpcomingTweetRange(): StreamFactory { - return $this->state(function () { + return $this->state(function() { return [ 'scheduled_start_time' => now()->addMinutes(6), ]; @@ -139,35 +139,35 @@ public function withChannel(array $channelData = []): StreamFactory public function withActualStartTime(Carbon $date): StreamFactory { - return $this->state(fn() => [ + return $this->state(fn () => [ 'actual_start_time' => $date, ]); } public function withActualEndTime(Carbon $date): StreamFactory { - return $this->state(fn() => [ + return $this->state(fn () => [ 'actual_end_time' => $date, ]); } public function withScheduledStartTime(Carbon $date): StreamFactory { - return $this->state(fn() => [ + return $this->state(fn () => [ 'scheduled_start_time' => $date, ]); } public function withTitle(string $title): StreamFactory { - return $this->state(fn() => [ + return $this->state(fn () => [ 'title' => $title, ]); } public function withYoutubeId(string $youtubeId): StreamFactory { - return $this->state(fn() => [ + return $this->state(fn () => [ 'youtube_id' => $youtubeId, ]); } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 6c54ecea..2d1282f5 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::create('users', function (Blueprint $table) { + Schema::create('users', function(Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index 4f42fe69..42d9fb8d 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::create('password_resets', function (Blueprint $table) { + Schema::create('password_resets', function(Blueprint $table) { $table->string('email')->index(); $table->string('token'); $table->timestamp('created_at')->nullable(); diff --git a/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php b/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php index 5b92a624..a82a52c3 100644 --- a/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php +++ b/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php @@ -11,14 +11,14 @@ */ public function up(): void { - Schema::table('users', function (Blueprint $table) { + Schema::table('users', function(Blueprint $table) { $table->text('two_factor_secret') - ->after('password') - ->nullable(); + ->after('password') + ->nullable(); $table->text('two_factor_recovery_codes') - ->after('two_factor_secret') - ->nullable(); + ->after('two_factor_secret') + ->nullable(); }); } @@ -27,7 +27,7 @@ public function up(): void */ public function down(): void { - Schema::table('users', function (Blueprint $table) { + Schema::table('users', function(Blueprint $table) { $table->dropColumn('two_factor_secret', 'two_factor_recovery_codes'); }); } diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 249da817..ca13e76d 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::create('failed_jobs', function (Blueprint $table) { + Schema::create('failed_jobs', function(Blueprint $table) { $table->id(); $table->string('uuid')->unique(); $table->text('connection'); diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 89927c68..b35dfa86 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::create('personal_access_tokens', function (Blueprint $table) { + Schema::create('personal_access_tokens', function(Blueprint $table) { $table->bigIncrements('id'); $table->morphs('tokenable'); $table->string('name'); diff --git a/database/migrations/2021_05_13_104641_create_streams_table.php b/database/migrations/2021_05_13_104641_create_streams_table.php index 9a161eff..a73735e2 100644 --- a/database/migrations/2021_05_13_104641_create_streams_table.php +++ b/database/migrations/2021_05_13_104641_create_streams_table.php @@ -9,7 +9,7 @@ { public function up(): void { - Schema::create('streams', function (Blueprint $table) { + Schema::create('streams', function(Blueprint $table) { $table->bigIncrements('id'); $table->string('youtube_id'); $table->string('channel_title'); diff --git a/database/migrations/2021_05_13_114225_create_sessions_table.php b/database/migrations/2021_05_13_114225_create_sessions_table.php index 647f9c2a..cc9e6102 100644 --- a/database/migrations/2021_05_13_114225_create_sessions_table.php +++ b/database/migrations/2021_05_13_114225_create_sessions_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::create('sessions', function (Blueprint $table) { + Schema::create('sessions', function(Blueprint $table) { $table->string('id')->primary(); $table->foreignId('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); diff --git a/database/migrations/2021_05_15_142833_unique_youtube_id_in_streams_table.php b/database/migrations/2021_05_15_142833_unique_youtube_id_in_streams_table.php index 6cdf0f62..d14cbf5e 100644 --- a/database/migrations/2021_05_15_142833_unique_youtube_id_in_streams_table.php +++ b/database/migrations/2021_05_15_142833_unique_youtube_id_in_streams_table.php @@ -6,17 +6,18 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ public function up(): void { - Schema::table('streams', static function (Blueprint $table) { + Schema::table('streams', static function(Blueprint $table) { $table->unique(['youtube_id']); }); } public function down(): void { - Schema::table('streams', static function (Blueprint $table) { + Schema::table('streams', static function(Blueprint $table) { $table->dropUnique(['youtube_id']); }); } diff --git a/database/migrations/2021_05_15_203702_create_channels_table.php b/database/migrations/2021_05_15_203702_create_channels_table.php index d3850449..4fc74107 100644 --- a/database/migrations/2021_05_15_203702_create_channels_table.php +++ b/database/migrations/2021_05_15_203702_create_channels_table.php @@ -8,7 +8,7 @@ { public function up(): void { - Schema::create('channels', function (Blueprint $table) { + Schema::create('channels', function(Blueprint $table) { $table->bigIncrements('id'); $table->string('platform')->default('youtube'); $table->string('platform_id'); diff --git a/database/migrations/2021_05_17_192445_add_tweeted_at_to_streams_table.php b/database/migrations/2021_05_17_192445_add_tweeted_at_to_streams_table.php index 3ad13741..a95c41a0 100644 --- a/database/migrations/2021_05_17_192445_add_tweeted_at_to_streams_table.php +++ b/database/migrations/2021_05_17_192445_add_tweeted_at_to_streams_table.php @@ -8,7 +8,7 @@ { public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->timestamp('tweeted_at')->nullable(); }); } diff --git a/database/migrations/2021_05_18_135514_add_description_to_stream.php b/database/migrations/2021_05_18_135514_add_description_to_stream.php index f17e3e06..62792812 100644 --- a/database/migrations/2021_05_18_135514_add_description_to_stream.php +++ b/database/migrations/2021_05_18_135514_add_description_to_stream.php @@ -8,7 +8,7 @@ { public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->text('description')->nullable()->after('title'); }); } diff --git a/database/migrations/2021_05_20_200000_add_language_code_to_streams_table.php b/database/migrations/2021_05_20_200000_add_language_code_to_streams_table.php index 3c43b224..c30fb32c 100644 --- a/database/migrations/2021_05_20_200000_add_language_code_to_streams_table.php +++ b/database/migrations/2021_05_20_200000_add_language_code_to_streams_table.php @@ -8,7 +8,7 @@ { public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->string('language_code')->default('en')->after('status'); }); } diff --git a/database/migrations/2021_06_16_143518_add_language_code_to_channels.php b/database/migrations/2021_06_16_143518_add_language_code_to_channels.php index da479729..51bec5ee 100644 --- a/database/migrations/2021_06_16_143518_add_language_code_to_channels.php +++ b/database/migrations/2021_06_16_143518_add_language_code_to_channels.php @@ -8,9 +8,8 @@ { public function up(): void { - Schema::table('channels', function (Blueprint $table) { + Schema::table('channels', function(Blueprint $table) { $table->string('language_code')->after('platform_id')->default('en'); }); } - }; diff --git a/database/migrations/2021_06_23_201855_add_approval_fields_to_streams_table.php b/database/migrations/2021_06_23_201855_add_approval_fields_to_streams_table.php index be78d05f..c22ca606 100644 --- a/database/migrations/2021_06_23_201855_add_approval_fields_to_streams_table.php +++ b/database/migrations/2021_06_23_201855_add_approval_fields_to_streams_table.php @@ -9,13 +9,13 @@ { public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->timestamp('approved_at')->nullable()->after('language_code'); $table->string('submitted_by_email')->nullable()->after('language_code'); }); Stream::each(function(Stream $stream) { - $stream->update(['approved_at' => now()]); + $stream->update(['approved_at' => now()]); }); } }; diff --git a/database/migrations/2021_07_12_163904_add_channel_id_to_streams.php b/database/migrations/2021_07_12_163904_add_channel_id_to_streams.php index b504330c..f90b8835 100644 --- a/database/migrations/2021_07_12_163904_add_channel_id_to_streams.php +++ b/database/migrations/2021_07_12_163904_add_channel_id_to_streams.php @@ -8,9 +8,8 @@ { public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->string('channel_id')->after('youtube_id')->nullable(); }); } - }; diff --git a/database/migrations/2021_07_12_164653_add_twitter_handle_to_channels_table.php b/database/migrations/2021_07_12_164653_add_twitter_handle_to_channels_table.php index 8eee19f1..ac173edc 100644 --- a/database/migrations/2021_07_12_164653_add_twitter_handle_to_channels_table.php +++ b/database/migrations/2021_07_12_164653_add_twitter_handle_to_channels_table.php @@ -8,9 +8,8 @@ { public function up(): void { - Schema::table('channels', function (Blueprint $table) { + Schema::table('channels', function(Blueprint $table) { $table->string('twitter_handle')->nullable()->after('on_platform_since'); }); } - }; diff --git a/database/migrations/2021_07_22_172021_add_announcement_tweeted_at_to_streams_table.php b/database/migrations/2021_07_22_172021_add_announcement_tweeted_at_to_streams_table.php index e8551615..cc4ba398 100644 --- a/database/migrations/2021_07_22_172021_add_announcement_tweeted_at_to_streams_table.php +++ b/database/migrations/2021_07_22_172021_add_announcement_tweeted_at_to_streams_table.php @@ -11,7 +11,7 @@ */ public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->timestamp('upcoming_tweeted_at')->nullable()->after('tweeted_at'); }); } diff --git a/database/migrations/2021_10_12_144648_add_auto_import_field_to_channels_table.php b/database/migrations/2021_10_12_144648_add_auto_import_field_to_channels_table.php index 443bf663..6e890ec4 100644 --- a/database/migrations/2021_10_12_144648_add_auto_import_field_to_channels_table.php +++ b/database/migrations/2021_10_12_144648_add_auto_import_field_to_channels_table.php @@ -8,9 +8,8 @@ { public function up(): void { - Schema::table('channels', function (Blueprint $table) { + Schema::table('channels', function(Blueprint $table) { $table->boolean('auto_import')->default(false)->after('country'); }); } - }; diff --git a/database/migrations/2021_10_19_114954_remove_channel_title_from_streams_table.php b/database/migrations/2021_10_19_114954_remove_channel_title_from_streams_table.php index 9c37ecce..33cb5632 100644 --- a/database/migrations/2021_10_19_114954_remove_channel_title_from_streams_table.php +++ b/database/migrations/2021_10_19_114954_remove_channel_title_from_streams_table.php @@ -6,10 +6,9 @@ return new class extends Migration { - public function up(): void { - Schema::table('streams', function (Blueprint $table) { + Schema::table('streams', function(Blueprint $table) { $table->dropColumn('channel_title'); }); } diff --git a/database/migrations/2021_10_19_123659_update_slug_to_youtube_custom_url_in_channels_table.php b/database/migrations/2021_10_19_123659_update_slug_to_youtube_custom_url_in_channels_table.php index 9c125f8b..3b62f3b2 100644 --- a/database/migrations/2021_10_19_123659_update_slug_to_youtube_custom_url_in_channels_table.php +++ b/database/migrations/2021_10_19_123659_update_slug_to_youtube_custom_url_in_channels_table.php @@ -6,10 +6,9 @@ return new class extends Migration { - public function up(): void { - Schema::table('channels', function (Blueprint $table) { + Schema::table('channels', function(Blueprint $table) { $table->renameColumn('slug', 'youtube_custom_url'); }); } diff --git a/database/migrations/2023_03_02_000000_rename_password_resets_table.php b/database/migrations/2023_03_02_000000_rename_password_resets_table.php index f0ad3757..c3f94898 100644 --- a/database/migrations/2023_03_02_000000_rename_password_resets_table.php +++ b/database/migrations/2023_03_02_000000_rename_password_resets_table.php @@ -1,7 +1,6 @@ string('key')->primary(); $table->mediumText('value'); $table->integer('expiration'); }); - Schema::create('cache_locks', function (Blueprint $table) { + Schema::create('cache_locks', function(Blueprint $table) { $table->string('key')->primary(); $table->string('owner'); $table->integer('expiration'); diff --git a/pint.json b/pint.json new file mode 100644 index 00000000..992f2e35 --- /dev/null +++ b/pint.json @@ -0,0 +1,8 @@ +{ + "preset": "laravel", + "rules": { + "function_declaration": { + "closure_function_spacing": "none" + } + } +} diff --git a/routes/api.php b/routes/api.php index be08a1da..8d9b0d44 100644 --- a/routes/api.php +++ b/routes/api.php @@ -2,6 +2,6 @@ use App\Http\Controllers\Api\V1\Streams\IndexController; -Route::prefix('v1')->group(function () { +Route::prefix('v1')->group(function() { Route::get('streams', IndexController::class)->name('streams'); }); diff --git a/routes/console.php b/routes/console.php index 4cd20562..3619cc58 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,27 +1,24 @@ comment(Inspiring::quote()); })->purpose('Display an inspiring quote')->hourly(); - Schedule::command(CleanupCommand::class)->daily()->at('01:00'); Schedule::command(BackupCommand::class, ['--only-db', '--disable-notifications'])->daily()->at('02:00'); Schedule::command(UpdateUpcomingStreamsCommand::class)->hourly(); diff --git a/routes/web.php b/routes/web.php index 37a85cf9..6782197d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -40,7 +40,7 @@ Route::get('/stream-{stream}.ics', AddSingleStreamToCalendarController::class) ->name('calendar.ics.stream'); -Route::middleware('signed')->group(function () { +Route::middleware('signed')->group(function() { Route::get('submission/{stream}/approve', ApproveStreamController::class)->name('stream.approve'); Route::get('submission/{stream}/reject', RejectStreamController::class)->name('stream.reject'); }); diff --git a/tests/Feature/Http/Livewire/ImportYoutubeChannelTest.php b/tests/Feature/Http/Livewire/ImportYoutubeChannelTest.php index 075f123e..4e337197 100644 --- a/tests/Feature/Http/Livewire/ImportYoutubeChannelTest.php +++ b/tests/Feature/Http/Livewire/ImportYoutubeChannelTest.php @@ -1,7 +1,7 @@ for(Channel::factory()->create(['name' => 'My Channel'])) @@ -25,7 +25,7 @@ ->assertDontSee('Stream Not Seen'); }); -it('shows streamers as dropdown options', function () { +it('shows streamers as dropdown options', function() { // Arrange Stream::factory() ->for(Channel::factory()->create(['name' => 'Channel A'])) @@ -43,13 +43,13 @@ ]); }); -it('wires properties and methods', function () { +it('wires properties and methods', function() { // Arrange & Act & Assert Livewire::test(StreamListArchive::class) ->assertPropertyWired('streamer'); }); -it('does not show streamer as dropdown option without approved finished streams', function () { +it('does not show streamer as dropdown option without approved finished streams', function() { // Arrange Channel::factory() ->create(['name' => 'Channel A']); diff --git a/tests/Feature/PageArchiveTest.php b/tests/Feature/PageArchiveTest.php index e51e395a..7d07a345 100644 --- a/tests/Feature/PageArchiveTest.php +++ b/tests/Feature/PageArchiveTest.php @@ -4,9 +4,10 @@ use App\Models\Stream; use Carbon\Carbon; use Vinkla\Hashids\Facades\Hashids; + use function Pest\Laravel\get; -it('shows only finished streams', function () { +it('shows only finished streams', function() { // Arrange Stream::factory() ->withChannel() @@ -33,7 +34,7 @@ ->assertSee('Finished stream'); }); -it('uses actual start time first for order if given', function () { +it('uses actual start time first for order if given', function() { // Arrange Stream::factory() ->withChannel() @@ -59,7 +60,7 @@ ]); }); -it('orders streams from latest to oldest', function () { +it('orders streams from latest to oldest', function() { // Arrange Stream::factory() ->withChannel() @@ -91,7 +92,7 @@ ]); }); -it('does not show deleted streams', function () { +it('does not show deleted streams', function() { // Arrange Stream::factory() ->withChannel() @@ -112,7 +113,7 @@ ->assertDontSee('Stream deleted'); }); -it('shows duration of stream if given', function () { +it('shows duration of stream if given', function() { $this->withoutExceptionHandling(); // Arrange Stream::factory() @@ -127,7 +128,7 @@ ->assertSee('1h 12m'); }); -it('searches for streams on title', function () { +it('searches for streams on title', function() { // Arrange Stream::factory() ->withChannel() @@ -158,7 +159,7 @@ ]); }); -it('searches for streams on channel title', function () { +it('searches for streams on channel title', function() { // Arrange $channelShown = Channel::factory()->create(['name' => 'Channel Shown']); Stream::factory() @@ -195,7 +196,7 @@ it('searches for streams by specific ->$this->withTitle() - streamer', function () { + streamer', function() { // Arrange Stream::factory() ->withChannel() @@ -216,7 +217,7 @@ ->assertDontSee('Stream Hidden'); }); -it('searches for streams by specific streamer and search term', function () { +it('searches for streams by specific streamer and search term', function() { // Arrange $channel = Channel::factory()->create(); Stream::factory() @@ -238,7 +239,7 @@ ->assertDontSee('Stream Hidden'); }); -it('orders streamers by name', function () { +it('orders streamers by name', function() { $this->withoutExceptionHandling(); // Arrange Channel::factory() diff --git a/tests/Feature/PageDashboardTest.php b/tests/Feature/PageDashboardTest.php index 8b6832e5..97a8b6ef 100644 --- a/tests/Feature/PageDashboardTest.php +++ b/tests/Feature/PageDashboardTest.php @@ -4,13 +4,13 @@ use App\Livewire\ImportYouTubeLiveStream; use App\Models\User; -it('includes livewire youtube import stream component', function () { +it('includes livewire youtube import stream component', function() { $this->actingAs(User::factory()->create()) ->get(route('dashboard')) ->assertSeeLivewire(ImportYouTubeLiveStream::class); })->skip(); -it('includes livewire youtube import channel component', function () { +it('includes livewire youtube import channel component', function() { $this->actingAs(User::factory()->create()) ->get(route('dashboard')) ->assertSeeLivewire(ImportYouTubeChannel::class); diff --git a/tests/Feature/PageHomeTest.php b/tests/Feature/PageHomeTest.php index 488e4ec0..9c253a0a 100644 --- a/tests/Feature/PageHomeTest.php +++ b/tests/Feature/PageHomeTest.php @@ -6,7 +6,7 @@ use Illuminate\Support\Carbon; use Spatie\TestTime\TestTime; -it('shows given streams on home page', function () { +it('shows given streams on home page', function() { // Arrange Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->create(['title' => 'Stream #1', 'scheduled_start_time' => Carbon::now()->addDays(), 'youtube_id' => '1234', 'language_code' => 'en']); Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->create(['title' => 'Stream #2', 'scheduled_start_time' => Carbon::now()->addDays(2), 'youtube_id' => '12345', 'language_code' => 'fr']); @@ -25,7 +25,7 @@ ->assertSee('https://www.youtube.com/watch?v=123456'); }); -it('will not show past upcoming streams on home page', function () { +it('will not show past upcoming streams on home page', function() { // Arrange $upcomingStream = Stream::factory() ->for(Channel::factory()->create()) @@ -42,14 +42,13 @@ ->withScheduledStartTime(Carbon::now()->subHour()) ->create(); - // Act & Assert $this->get(route('home')) ->assertSee('Stream #1') ->assertDontSee('Stream #3'); }); -it('shows from closest to farthest', function () { +it('shows from closest to farthest', function() { // Arrange Stream::factory() ->withChannel() @@ -72,7 +71,7 @@ ->assertSeeInOrder(['Stream #1', 'Stream #2', 'Stream #3']); }); -it('shows unique names for today and tomorrow instead of whole date', function () { +it('shows unique names for today and tomorrow instead of whole date', function() { $this->withoutExceptionHandling(); // Arrange Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->create(['title' => 'Stream #1', 'scheduled_start_time' => Carbon::now()->addHour(2)]); @@ -85,7 +84,7 @@ ->assertSee('Tomorrow'); }); -it('does not show old streams', function () { +it('does not show old streams', function() { // Arrange Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->finished()->create(['title' => 'Stream finished']); Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->live()->create(['title' => 'Stream live']); @@ -99,7 +98,7 @@ ->assertDontSee('Stream finished'); }); -it('does not show deleted streams', function () { +it('does not show deleted streams', function() { // Arrange Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->deleted()->create(['title' => 'Stream deleted']); Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->upcoming()->create(['title' => 'Stream upcoming']); @@ -111,7 +110,7 @@ ->assertDontSee('Stream deleted'); }); -it('marks live streams', function () { +it('marks live streams', function() { // Arrange $stream = Stream::factory()->for(Channel::factory()->create(['name' => 'My Channel']))->upcoming()->create(['title' => 'Stream #1']); @@ -127,7 +126,7 @@ ->assertSee('>live', false); }); -it('shows footer links', function () { +it('shows footer links', function() { // Arrange $twitterLink = 'https://twitter.com/larastreamers'; $githubLink = 'https://github.com/christophrumpel/larastreamers'; @@ -138,12 +137,12 @@ ->assertSee($githubLink); }); -it('adds not button webcal link if no streams', function () { +it('adds not button webcal link if no streams', function() { $this->get(route('home')) ->assertDontSee('webcal://'); }); -it('adds button webcal link if no streams', function () { +it('adds button webcal link if no streams', function() { Stream::factory() ->for(Channel::factory()->create(['name' => 'My Channel'])) ->upcoming() @@ -153,7 +152,7 @@ ->assertSee('webcal://'); }); -it('will show the time till upcoming stream in preview component', function () { +it('will show the time till upcoming stream in preview component', function() { // Arrange TestTime::freeze(); Stream::factory() @@ -168,7 +167,7 @@ ->assertSeeText('Starts 2 hours from now'); }); -it('will show the time passed since the stream started in preview component', function () { +it('will show the time passed since the stream started in preview component', function() { TestTime::freeze(); Stream::factory() ->live() @@ -182,7 +181,7 @@ ->assertSeeText('Started 7 minutes ago'); }); -it('will show the time passed since the stream even if actual start missing', function () { +it('will show the time passed since the stream even if actual start missing', function() { TestTime::freeze(); Stream::factory() ->live() diff --git a/tests/Feature/PagesResponseTest.php b/tests/Feature/PagesResponseTest.php index 687ceadb..e9a9d9c7 100644 --- a/tests/Feature/PagesResponseTest.php +++ b/tests/Feature/PagesResponseTest.php @@ -2,7 +2,7 @@ it('can show the home page', function() { $this->get(route('home')) - ->assertOk(); + ->assertOk(); }); it('can show the feed', function() {