Completed
Push — develop ( c0e442...ef223d )
by Abdelrahman
13:47
created

HasSocialAttributes::scopeWithSocial()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Support\Traits;
6
7
use Illuminate\Database\Eloquent\Builder;
8
use Spatie\SchemalessAttributes\SchemalessAttributes;
9
10
trait HasSocialAttributes
11
{
12
    /**
13
     * Escape all values.
14
     *
15
     * @param array $data
0 ignored issues
show
Bug introduced by
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
16
     *
17
     * @return array
0 ignored issues
show
Documentation introduced by
Should the return type not be SchemalessAttributes?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
18
     */
19
    public function getSocialAttribute(): SchemalessAttributes
20
    {
21
        return SchemalessAttributes::createForModel($this, 'social');
22
    }
23
24
    public function scopeWithSocial(): Builder
25
    {
26
        return SchemalessAttributes::scopeWithSchemalessAttributes('social');
27
    }
28
}
29