Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to v5.1.1 #133

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@
]
}
},
"scripts": {
"test": [
"@php vendor/bin/phpunit --testdox"
],
"phpstan": [
"@php vendor/bin/phpstan analyse -c phpstan.neon"
]
},
"require-dev": {
"orchestra/testbench": "^8"
"orchestra/testbench": "^8",
"phpstan/phpstan": "^1.10"
},
"require": {
"php": "^8.1|^8.2",
"laravel/framework": "^10",
"guzzlehttp/guzzle": "^7.5",
"laravel/breeze": "^v1.21.0"
"guzzlehttp/guzzle": "^7.8"
}
}
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 6
paths:
- src
16 changes: 1 addition & 15 deletions src/Models/DiscordAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,11 @@ class DiscordAccessToken extends Model
{
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'access_token',
'refresh_token',
'token_type',
'expires_in',
'expires_at',
'scope',
'user_id',
];
protected $fillable = ['access_token', 'refresh_token', 'token_type', 'expires_in', 'expires_at', 'scope', 'discord_user_id'];

/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'access_token' => 'encrypted',
Expand All @@ -34,8 +22,6 @@ class DiscordAccessToken extends Model

/**
* The attributes that should be hidden for arrays.
*
* @var string[]
*/
protected $hidden = [
'access_token',
Expand Down
13 changes: 13 additions & 0 deletions src/Models/DiscordUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Jakyeru\Larascord\Models;

use Illuminate\Database\Eloquent\Model;

class DiscordUser extends Model
{
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['id', 'username', 'discriminator', 'global_name', 'email', 'avatar', 'verified', 'banner', 'accent_color', 'public_flags', 'flags', 'locale', 'premium_type', 'mfa_enabled'];
}
70 changes: 0 additions & 70 deletions src/Models/User.php

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function up(): void
$table->integer('expires_in');
$table->timestamp('expires_at');
$table->string('scope');
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('discord_user_id')->constrained()->cascadeOnDelete();
$table->timestamps();
});
}
Expand Down

This file was deleted.

42 changes: 0 additions & 42 deletions src/database/migrations/2023_06_11_062809_update_users_table.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
Schema::create('discord_users', function (Blueprint $table) {
$table->id();
$table->string('username');
$table->string('discriminator');
$table->string('global_name')->nullable();
$table->string('email')->nullable()->unique();
$table->string('avatar')->nullable();
$table->boolean('verified');
$table->boolean('verified')->default(false);
$table->string('banner')->nullable();
$table->integer('accent_color')->nullable();
$table->integer('public_flags')->nullable();
$table->integer('flags')->nullable();
$table->string('locale');
$table->boolean('mfa_enabled');
$table->string('refresh_token')->nullable();
$table->integer('premium_type')->nullable();
$table->boolean('mfa_enabled')->default(false);
$table->timestamps();
});
}
Expand All @@ -30,6 +35,6 @@ public function up(): void
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('discord_users');
}
};
};