Completed
Pull Request — master (#60)
by Marko
07:23
created

Curvedimage::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 20
ccs 16
cts 16
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
crap 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jul 7, 2016 - 9:46:02 PM
5
 * Contact      [email protected]
6
 * @copyright   2016 Marko Kungla - https://github.com/mkungla
7
 * @license     The MIT License (MIT)
8
 * 
9
 * @category       AframeVR
10
 * @package        aframe-php
11
 * 
12
 * Lang         PHP (php version >= 7)
13
 * Encoding     UTF-8
14
 * File         Curvedimage.php
15
 * Code format  PSR-2 and 12
16
 * @link        https://github.com/mkungla/aframe-php
17
 * @issues      https://github.com/mkungla/aframe-php/issues
18
 * ********************************************************************
19
 * Contributors:
20
 * @author Marko Kungla <[email protected]>
21
 * ********************************************************************
22
 * Comments:
23
 * @formatter:on */
24
namespace AframeVR\Extras\Primitives;
25
26
use \AframeVR\Interfaces\Extras\Primitives\CurvedimagePrimitiveIF;
27
use \AframeVR\Core\Entity;
28
use \AframeVR\Core\Helpers\MeshAttributes;
29
30
/**
31
 * <a-obj-model>
32
 *
33
 * The .OBJ model primitive displays a 3D Wavefront model. It is an entity that maps the src and mtl attributes to the
34
 * obj-model component’s obj and mtl properties respectively.
35
 */
36
final class Curvedimage extends Entity implements CurvedimagePrimitiveIF
37
{
38
    
39
    use MeshAttributes;
40
41
    /**
42
     * Selector to obj
43
     *
44
     * Selector to an <a-asset-item> pointing to a .OBJ file or an inline path to a .OBJ file.
45
     *
46
     * @param null|string $selector            
0 ignored issues
show
Bug introduced by
There is no parameter named $selector. 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...
47
     * @return ObjModelPrimitiveIF
0 ignored issues
show
Documentation introduced by
Should the return type not be Curvedimage?

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...
48
     */
49 3
    public function init()
50
    {
51 3
        $this->component('Geometry')->primitive('cylinder');
52 3
        $this->component('Geometry')->height(1);
53 3
        $this->component('Geometry')->radius(2);
54 3
        $this->component('Geometry')->segmentsRadial(48);
55 3
        $this->component('Geometry')->thetaLength(270);
56 3
        $this->component('Geometry')->openEnded(true);
57 3
        $this->component('Geometry')->thetaStart(0);
58
        
59 3
        $this->component('Material')->shader('flat');
60 3
        $this->color('#fff');
61 3
        $this->component('Material')->side('double');
62 3
        $this->component('Material')->transparent(true);
63
64 3
        $this->component('Material')
65 3
        ->shader()
66 3
        ->repeat(-1, 1);
67 3
        return $this;
68
    }
69
70
}