Completed
Push — master ( 6f6236...71f8b3 )
by Ashleigh
06:55
created

Opportunity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
namespace Surge\LaravelSalesforce\Objects;
4
5
class Opportunity extends AbstractObject
6
{
7
    protected $objName = 'Opportunity';
8
9
    /**
10
     * Insert new account.
11
     *
12
     * @param $params
13
     *
14
     * @return bool
15
     */
16
    public function create($params)
17
    {
18
        $params['RecordTypeId'] = config('sf.oppurtunityrecordtypeid');
19
        $params['Divisions__c'] = $this->brandName;
0 ignored issues
show
Bug introduced by
The property brandName does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
20
21
        return $this->createRecord($this->objName, $params);
0 ignored issues
show
Bug introduced by
The method createRecord() does not exist on Surge\LaravelSalesforce\Objects\Opportunity. Did you maybe mean create()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
22
    }
23
}
24