Completed
Push — master ( d21dd2...a23d9a )
by Beñat
8s
created

ExampleShortCode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A exampleShortCode() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the WordPress Standard project.
5
 *
6
 * Copyright (c) 2015-2016 LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace AppTheme\ShortCodes;
13
14
/**
15
 * Very basic example of ShortCode class. Loads all the short codes
16
 * when this class is instantiate with "add_shortcode" internal method.
17
 *
18
 * @author Gorka Laucirica <[email protected]>
19
 * @author Beñat Espiña <[email protected]>
20
 */
21
final class ExampleShortCode
22
{
23
    /**
24
     * Constructor.
25
     */
26
    public function __construct()
27
    {
28
        add_shortcode('example', [$this, 'exampleShortCode']);
29
    }
30
31
    /**
32
     * The callback example short code method.
33
     *
34
     * @param string|array $attributes The attributes param, can be string but often is an array
35
     * @param string       $content    The content
36
     *
37
     * @return string
38
     */
39
    public function exampleShortCode($attributes, $content = '')
40
    {
41
        return $content;
42
    }
43
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
44