Completed
Push — master ( 395fb2...b0764c )
by he
10:48 queued 10s
created

JudgerRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A model() 0 3 1
1
<?php
2
3
namespace App\Repositories;
4
5
use App\Entities\Judger;
6
7
class JudgerRepository extends Repository
8
{
9
    /**
10
     * Returns specified model class name.
11
     *
12
     * @return string
13
     */
14
    public function model()
15
    {
16
        return Judger::class;
0 ignored issues
show
Bug Best Practice introduced by
The expression return App\Entities\Judger::class returns the type string which is incompatible with the return type mandated by Czim\Repository\Contract...itoryInterface::model() of Illuminate\Database\Eloquent\Model.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
17
    }
18
}
19