herpaderpaldent/seat-notifications

View on GitHub

Showing 135 of 135 total issues

Avoid using static access to class '\Seat\Web\Models\Group' in method 'via'.
Open

            'private to: ' . $this->getMainCharacter(Group::find($notifiable->group_id))->name);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Seat\Web\Models\Group' in method 'via'.
Open

            'private to: ' . $this->getMainCharacter(Group::find($notifiable->group_id))->name);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'down'.
Open

        Schema::dropIfExists('herpaderp_discord_users');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

        Schema::create('herpaderp_seat_notification_subscriptions', function (Blueprint $table) {
            $table->integer('recipient_id')->unsigned();
            $table->string('notification');
            $table->json('affiliations')->nullable()->default(null);
            $table->timestamps();

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Herpaderpaldent\Seat\SeatNotifications\Models\NotificationRecipient' in method 'execute'.
Open

            $recipient = NotificationRecipient::firstOrCreate(
                ['driver_id' => $driver_id, 'driver' => $driver], ['group_id' => $group_id]
            );
Severity: Minor
Found in src/Http/Actions/SubscribeAction.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

        Schema::create('herpaderp_discord_users', function (Blueprint $table) {
            $table->unsignedInteger('group_id');
            $table->bigInteger('discord_id');
            $table->bigInteger('channel_id');
            $table->timestamps();

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using empty try-catch blocks in execute.
Open

        } catch (Exception $exception) {

        }

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Avoid using static access to class '\Herpaderpaldent\Seat\SeatNotifications\Models\Discord\DiscordUser' in method 'bindingUser'.
Open

        DiscordUser::updateOrCreate([
            'group_id'   => auth()->user()->group_id,
        ], [
            'discord_id'    => $user->id,
            'channel_id'    => $channel_id,

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Arr' in method 'getGateway'.
Open

            $gateway = Arr::get(json_decode($response->getBody(), true), 'url', $gateway);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method is_loss is not named in camelCase.
Open

    public function is_loss($notifiable): bool
    {

        return $notifiable
            ->subscriptions

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method add_migrations is not named in camelCase.
Open

    private function add_migrations()
    {
        $this->loadMigrationsFrom(__DIR__ . '/database/migrations/');
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

TODO found
Open

        //TODO: check if delay if victim corporation_id is not available.
Severity: Minor
Found in src/Jobs/KillmaillDispatcher.php by fixme

TODO found
Open

     * TODO : is it an helper ?

TODO found
Open

        //$this->notify((new RefreshTokenDeleted())->delay($when)); //TODO: Check if that is working, according to docs it should

TODO found
Open

     * TODO : is it an helper ?
Severity
Category
Status
Source
Language