Passed
Push — master ( d156dd...acd975 )
by Thomas
04:20 queued 01:05
created

Mandrill_Metadata::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
class Mandrill_Metadata
4
{
5
6
    public function __construct(Mandrill $master)
7
    {
8
        $this->master = $master;
0 ignored issues
show
Bug Best Practice introduced by
The property master does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
9
    }
10
11
    /**
12
     * Get the list of custom metadata fields indexed for the account.
13
     * @return array the custom metadata fields for the account
14
     *     - return[] struct the individual custom metadata field info
15
     *         - name string the unique identifier of the metadata field to update
16
     *         - state string the current state of the metadata field, one of "active", "delete", or "index"
17
     *         - view_template string Mustache template to control how the metadata is rendered in your activity log
18
     */
19
    public function getList()
20
    {
21
        $_params = array();
22
        return $this->master->call('metadata/list', $_params);
23
    }
24
25
    /**
26
     * Add a new custom metadata field to be indexed for the account.
27
     * @param string $name a unique identifier for the metadata field
28
     * @param string $view_template optional Mustache template to control how the metadata is rendered in your activity log
29
     * @return struct the information saved about the new metadata field
0 ignored issues
show
Bug introduced by
The type struct was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
30
     *     - name string the unique identifier of the metadata field to update
31
     *     - state string the current state of the metadata field, one of "active", "delete", or "index"
32
     *     - view_template string Mustache template to control how the metadata is rendered in your activity log
33
     */
34
    public function add($name, $view_template = null)
35
    {
36
        $_params = array("name" => $name, "view_template" => $view_template);
37
        return $this->master->call('metadata/add', $_params);
38
    }
39
40
    /**
41
     * Update an existing custom metadata field.
42
     * @param string $name the unique identifier of the metadata field to update
43
     * @param string $view_template optional Mustache template to control how the metadata is rendered in your activity log
44
     * @return struct the information for the updated metadata field
45
     *     - name string the unique identifier of the metadata field to update
46
     *     - state string the current state of the metadata field, one of "active", "delete", or "index"
47
     *     - view_template string Mustache template to control how the metadata is rendered in your activity log
48
     */
49
    public function update($name, $view_template)
50
    {
51
        $_params = array("name" => $name, "view_template" => $view_template);
52
        return $this->master->call('metadata/update', $_params);
53
    }
54
55
    /**
56
     * Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
57
     * @param string $name the unique identifier of the metadata field to update
58
     * @return struct the information for the deleted metadata field
59
     *     - name string the unique identifier of the metadata field to update
60
     *     - state string the current state of the metadata field, one of "active", "delete", or "index"
61
     *     - view_template string Mustache template to control how the metadata is rendered in your activity log
62
     */
63
    public function delete($name)
64
    {
65
        $_params = array("name" => $name);
66
        return $this->master->call('metadata/delete', $_params);
67
    }
68
}
69