Completed
Pull Request — master (#11)
by
unknown
02:00
created

StockAvailable::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php 
2
/**
3
 * Collmex StockAvailable Type
4
 *
5
 * @author    Marcus Jaschen <[email protected]>
6
 * @author    René Galle <[email protected]>
7
 * @license   http://www.opensource.org/licenses/mit-license MIT License
8
 * @link      https://github.com/mjaschen/collmex
9
 */
10
11
namespace MarcusJaschen\Collmex\Type;
12
13
/**
14
 * Collmex StockAvailable Type
15
 *
16
 * @author   Marcus Jaschen <[email protected]>
17
 * @author   René Galle <[email protected]>
18
 * @license  http://www.opensource.org/licenses/mit-license MIT License
19
 * @link     https://github.com/mjaschen/collmex
20
 */
21 View Code Duplication
class StockAvailable extends AbstractType implements TypeInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $template = array(
27
        'type_identifier'  => 'STOCK_AVAILABLE',
28
        'product_id'       => null,
29
        'client_id'        => null,
30
        'stock'            => null,
31
        'unit'             => null,
32
        'reorder_time'     => null
33
    );
34
35
    /**
36
     * Formally validates the type data in $data attribute.
37
     *
38
     * @return bool Validation success
39
     */
40
    public function validate()
41
    {
42
        return true;
43
    }
44
}
45
46
47
 ?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...