QuizQuestion   F
last analyzed

Complexity

Total Complexity 81

Size/Duplication

Total Lines 729
Duplicated Lines 2.88 %

Coupling/Cohesion

Components 5
Dependencies 3

Importance

Changes 0
Metric Value
wmc 81
lcom 5
cbo 3
dl 21
loc 729
rs 1.871
c 0
b 0
f 0

50 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createChrono() 0 5 1
A updateChrono() 0 4 1
A getId() 0 4 1
A setId() 0 6 1
A getQuiz() 0 4 1
A setQuiz() 0 7 1
A getAnswers() 0 4 1
A setAnswers() 0 6 1
A addAnswers() 0 7 2
A removeAnswers() 0 7 2
A addAnswer() 0 4 1
A getType() 0 4 1
A setType() 0 6 1
A getVideo() 0 4 1
A setVideo() 0 6 1
A getImage() 0 4 1
A setImage() 0 6 1
A getAudio() 0 4 1
A setAudio() 0 6 1
A getAutoplay() 0 4 1
A setAutoplay() 0 6 1
A getHint() 0 4 1
A setHint() 0 6 1
A getJsonData() 0 4 1
A setJsonData() 0 6 1
A getTimer() 0 4 1
A setTimer() 0 6 1
A getPrediction() 0 4 1
A setPrediction() 0 6 1
A getTimerDuration() 0 4 1
A setTimerDuration() 0 6 1
A getWeight() 0 4 1
A setWeight() 0 6 1
A getMaxPoints() 0 4 1
A setMaxPoints() 0 6 1
A getMaxCorrectAnswers() 0 4 1
A setMaxCorrectAnswers() 0 6 1
A getCreatedAt() 0 4 1
A setCreatedAt() 0 6 1
A getUpdatedAt() 0 4 1
A setUpdatedAt() 0 6 1
A getQuestion() 0 4 1
A setQuestion() 0 6 1
A getPosition() 0 4 1
A setPosition() 0 6 1
A getArrayCopy() 0 6 1
F populate() 21 58 29
A setInputFilter() 0 4 1
B getInputFilter() 0 117 2

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like QuizQuestion often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use QuizQuestion, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace PlaygroundGame\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
8
use Doctrine\ORM\Mapping\PrePersist;
9
use Doctrine\ORM\Mapping\PreUpdate;
10
use Zend\InputFilter\InputFilter;
11
use Zend\InputFilter\Factory as InputFactory;
12
use Zend\InputFilter\InputFilterAwareInterface;
13
use Zend\InputFilter\InputFilterInterface;
14
use Gedmo\Mapping\Annotation as Gedmo;
15
16
/**
17
 * @ORM\Entity @HasLifecycleCallbacks
18
 * @ORM\Table(name="game_quiz_question")
19
 * @Gedmo\TranslationEntity(class="PlaygroundGame\Entity\QuizQuestionTranslation")
20
 */
21
class QuizQuestion implements InputFilterAwareInterface
22
{
23
    protected $inputFilter;
24
25
    /**
26
     * @ORM\Id
27
     * @ORM\Column(type="integer");
28
     * @ORM\GeneratedValue(strategy="AUTO")
29
     */
30
    protected $id;
31
32
    /**
33
     * @ORM\ManyToOne(targetEntity="Quiz", inversedBy="questions", cascade={"persist"})
34
     * @ORM\JoinColumn(name="quiz_id", referencedColumnName="id", onDelete="CASCADE")
35
     */
36
    protected $quiz;
37
38
    /**
39
     * @ORM\OneToMany(targetEntity="QuizAnswer", mappedBy="question", cascade={"persist","remove"})
40
     */
41
    private $answers;
42
43
    /**
44
     * values :
45
     *          0 : closed (you can select only one answer)
46
     *          1 : opened (you can select many answers),
47
     *          2: No answer to select. You write a text in a textarea
48
     *
49
     * @ORM\Column(type="integer", nullable=false)
50
     */
51
    protected $type = 0;
52
53
    /**
54
     * @Gedmo\Translatable
55
     * @ORM\Column(type="text", nullable=false)
56
     */
57
    protected $question;
58
59
    /**
60
     * @ORM\Column(type="integer", nullable=false)
61
     */
62
    protected $position = 0;
63
64
    /**
65
     * @Gedmo\Translatable
66
     * @ORM\Column(type="string", nullable=true)
67
     */
68
    protected $video;
69
70
    /**
71
     * @ORM\Column(type="string", nullable=true)
72
     */
73
    protected $image;
74
75
    /**
76
     * @Gedmo\Translatable
77
     * @ORM\Column(type="integer", nullable=true)
78
     */
79
    protected $audio = 0;
80
81
    /**
82
     * @ORM\Column(type="boolean", nullable=true)
83
     */
84
    protected $autoplay = 0;
85
86
    /**
87
     * @Gedmo\Translatable
88
     * @ORM\Column(type="text", nullable=true)
89
     */
90
    protected $hint;
91
92
    /**
93
     * @Gedmo\Translatable
94
     * @ORM\Column(name="json_data", type="text", nullable=true)
95
     */
96
    protected $jsonData;
97
98
    /**
99
     * @ORM\Column(type="boolean", nullable=true)
100
     */
101
    protected $prediction = 0;
102
103
    /**
104
     * @ORM\Column(type="boolean", nullable=true)
105
     */
106
    protected $timer = 0;
107
108
    /**
109
     * @ORM\Column(type="integer", nullable=true)
110
     */
111
    protected $timer_duration = 0;
112
113
    /**
114
     * The question weight in the game
115
     * @ORM\Column(type="integer", nullable=false)
116
     */
117
    protected $weight = 1;
118
119
    /**
120
     * @ORM\Column(type="integer", nullable=true)
121
     */
122
    protected $max_points = 0;
123
124
    /**
125
     * @ORM\Column(type="integer", nullable=true)
126
     */
127
    protected $max_correct_answers = 0;
128
129
    /**
130
     * @ORM\Column(type="datetime")
131
     */
132
    protected $created_at;
133
134
    /**
135
     * @ORM\Column(type="datetime")
136
     */
137
    protected $updated_at;
138
139
    public function __construct()
140
    {
141
        $this->answers = new ArrayCollection();
142
    }
143
144
    /**
145
     * @PrePersist
146
     */
147
    public function createChrono()
148
    {
149
        $this->created_at = new \DateTime("now");
150
        $this->updated_at = new \DateTime("now");
151
    }
152
153
    /**
154
     * @PreUpdate
155
     */
156
    public function updateChrono()
157
    {
158
        $this->updated_at = new \DateTime("now");
159
    }
160
161
    /**
162
     * @return the unknown_type
163
     */
164
    public function getId()
165
    {
166
        return $this->id;
167
    }
168
169
    /**
170
     * @param unknown_type $id
171
     */
172
    public function setId($id)
173
    {
174
        $this->id = $id;
175
176
        return $this;
177
    }
178
179
    /**
180
     * @return the unknown_type
181
     */
182
    public function getQuiz()
183
    {
184
        return $this->quiz;
185
    }
186
187
    /**
188
     * @param unknown_type $quiz
189
     */
190
    public function setQuiz($quiz)
191
    {
192
        $quiz->addQuestion($this);
193
        $this->quiz = $quiz;
194
195
        return $this;
196
    }
197
198
    /**
199
     * @return ArrayCollection unknown_type
200
     */
201
    public function getAnswers()
202
    {
203
        return $this->answers;
204
    }
205
206
    /**
207
     * frm collection solution
208
     * @param ArrayCollection $answers
209
     */
210
    public function setAnswers(ArrayCollection $answers)
211
    {
212
        $this->answers = $answers;
213
214
        return $this;
215
    }
216
217
    public function addAnswers(ArrayCollection $answers)
218
    {
219
        foreach ($answers as $answer) {
220
            $answer->setQuestion($this);
221
            $this->answers->add($answer);
222
        }
223
    }
224
225
    public function removeAnswers(ArrayCollection $answers)
226
    {
227
        foreach ($answers as $answer) {
228
            $answer->setQuestion(null);
229
            $this->answers->removeElement($answer);
230
        }
231
    }
232
233
    /**
234
     * Add an answer to the quiz.
235
     *
236
     * @param QuizAnswer $answer
237
     *
238
     * @return void
239
     */
240
    public function addAnswer($answer)
241
    {
242
        $this->answers[] = $answer;
243
    }
244
245
    /**
246
     * @return integer unknown_type
247
     */
248
    public function getType()
249
    {
250
        return $this->type;
251
    }
252
253
    /**
254
     * @param unknown_type $type
255
     */
256
    public function setType($type)
257
    {
258
        $this->type = $type;
0 ignored issues
show
Documentation Bug introduced by
It seems like $type of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $type.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
259
260
        return $this;
261
    }
262
263
    /**
264
     * @return the unknown_type
265
     */
266
    public function getVideo()
267
    {
268
        return $this->video;
269
    }
270
271
    /**
272
     * @param unknown_type $video
273
     */
274
    public function setVideo($video)
275
    {
276
        $this->video = $video;
277
278
        return $this;
279
    }
280
281
    /**
282
     * @return the unknown_type
283
     */
284
    public function getImage()
285
    {
286
        return $this->image;
287
    }
288
289
    /**
290
     * @param string $image
291
     */
292
    public function setImage($image)
293
    {
294
        $this->image = $image;
295
296
        return $this;
297
    }
298
299
    /**
300
     * @return integer unknown_type
301
     */
302
    public function getAudio()
303
    {
304
        return $this->audio;
305
    }
306
307
    /**
308
     * @param unknown_type audio
309
     */
310
    public function setAudio($audio)
311
    {
312
        $this->audio = $audio;
313
314
        return $this;
315
    }
316
317
    /**
318
     * @return boolean unknown_type
319
     */
320
    public function getAutoplay()
321
    {
322
        return $this->autoplay;
323
    }
324
325
    /**
326
     * @param unknown_type autoplay
327
     */
328
    public function setAutoplay($autoplay)
329
    {
330
        $this->autoplay = $autoplay;
331
332
        return $this;
333
    }
334
335
    /**
336
     * @return the unknown_type
337
     */
338
    public function getHint()
339
    {
340
        return $this->hint;
341
    }
342
343
    /**
344
     * @param unknown_type $hint
345
     */
346
    public function setHint($hint)
347
    {
348
        $this->hint = $hint;
349
350
        return $this;
351
    }
352
353
    /**
354
     * @return the string
355
     */
356
    public function getJsonData()
357
    {
358
        return $this->jsonData;
359
    }
360
361
    /**
362
     * @param string $hint
0 ignored issues
show
Bug introduced by
There is no parameter named $hint. 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...
363
     */
364
    public function setJsonData($jsonData)
365
    {
366
        $this->jsonData = $jsonData;
367
368
        return $this;
369
    }
370
    
371
    /**
372
     * @return boolean unknown_type
373
     */
374
    public function getTimer()
375
    {
376
        return $this->timer;
377
    }
378
379
    /**
380
     * @param unknown_type $timer
381
     */
382
    public function setTimer($timer)
383
    {
384
        $this->timer = $timer;
0 ignored issues
show
Documentation Bug introduced by
It seems like $timer of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $timer.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
385
386
        return $this;
387
    }
388
389
    /**
390
     * @return integer unknown_type
391
     */
392
    public function getPrediction()
393
    {
394
        return $this->prediction;
395
    }
396
397
    /**
398
     * @param unknown_type $prediction
399
     */
400
    public function setPrediction($prediction)
401
    {
402
        $this->prediction = $prediction;
0 ignored issues
show
Documentation Bug introduced by
It seems like $prediction of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $prediction.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
403
404
        return $this;
405
    }
406
407
    /**
408
     * @return integer unknown_type
409
     */
410
    public function getTimerDuration()
411
    {
412
        return $this->timer_duration;
413
    }
414
415
    /**
416
     * @param unknown_type $timer_duration
417
     */
418
    public function setTimerDuration($timer_duration)
419
    {
420
        $this->timer_duration = $timer_duration;
0 ignored issues
show
Documentation Bug introduced by
It seems like $timer_duration of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $timer_duration.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
421
422
        return $this;
423
    }
424
425
    /**
426
     * @return integer unknown_type
427
     */
428
    public function getWeight()
429
    {
430
        return $this->weight;
431
    }
432
433
    /**
434
     * @param unknown_type $weight
435
     */
436
    public function setWeight($weight)
437
    {
438
        $this->weight = $weight;
0 ignored issues
show
Documentation Bug introduced by
It seems like $weight of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $weight.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
439
440
        return $this;
441
    }
442
443
    /**
444
     * @return integer
445
     */
446
    public function getMaxPoints()
447
    {
448
        return $this->max_points;
449
    }
450
451
    /**
452
     * @param integer max_points
453
     */
454
    public function setMaxPoints($max_points)
455
    {
456
        $this->max_points = $max_points;
457
458
        return $this;
459
    }
460
461
    /**
462
     * @return integer
463
     */
464
    public function getMaxCorrectAnswers()
465
    {
466
        return $this->max_correct_answers;
467
    }
468
469
    /**
470
     * @param integer max_correct_answers
471
     */
472
    public function setMaxCorrectAnswers($max_correct_answers)
473
    {
474
        $this->max_correct_answers = $max_correct_answers;
475
476
        return $this;
477
    }
478
479
    /**
480
     * @return the unknown_type
481
     */
482
    public function getCreatedAt()
483
    {
484
        return $this->created_at;
485
    }
486
487
    /**
488
     * @param unknown_type $created_at
489
     */
490
    public function setCreatedAt($created_at)
491
    {
492
        $this->created_at = $created_at;
493
494
        return $this;
495
    }
496
497
    /**
498
     * @return the unknown_type
499
     */
500
    public function getUpdatedAt()
501
    {
502
        return $this->updated_at;
503
    }
504
505
    /**
506
     * @param unknown_type $updated_at
507
     */
508
    public function setUpdatedAt($updated_at)
509
    {
510
        $this->updated_at = $updated_at;
511
512
        return $this;
513
    }
514
515
    /**
516
     * @return string
517
     */
518
    public function getQuestion()
519
    {
520
        return $this->question;
521
    }
522
523
    /**
524
     * @param string $question
525
     */
526
    public function setQuestion($question)
527
    {
528
        $this->question = $question;
529
530
        return $this;
531
    }
532
533
    /**
534
     * @return integer
535
     */
536
    public function getPosition()
537
    {
538
        return $this->position;
539
    }
540
541
    /**
542
     * @param string $position
543
     */
544
    public function setPosition($position)
545
    {
546
        $this->position = $position;
0 ignored issues
show
Documentation Bug introduced by
The property $position was declared of type integer, but $position is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
547
548
        return $this;
549
    }
550
551
    /**
552
     * Convert the object to an array.
553
     *
554
     * @return array
555
     */
556
    public function getArrayCopy()
557
    {
558
        $obj_vars = get_object_vars($this);
559
560
        return $obj_vars;
561
    }
562
563
    /**
564
     * Populate from an array.
565
     *
566
     * @param array $data
567
     */
568
    public function populate($data = array())
569
    {
570
        if (isset($data['question']) && $data['question'] !== null) {
571
            $this->question = $data['question'];
572
        }
573
574 View Code Duplication
        if (isset($data['hint']) && $data['hint'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
575
            $this->hint = $data['hint'];
576
        }
577
578 View Code Duplication
        if (isset($data['jsonData']) && $data['jsonData'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
579
            $this->jsonData = $data['jsonData'];
580
        }
581
582 View Code Duplication
        if (isset($data['type']) && $data['type'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
583
            $this->type = $data['type'];
584
        }
585
586 View Code Duplication
        if (isset($data['position']) && $data['position'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
587
            $this->position = $data['position'];
588
        }
589
590
        if (isset($data['weight']) && $data['weight'] !== null) {
591
            $this->weight = $data['weight'];
592
        }
593
594 View Code Duplication
        if (isset($data['image']) && $data['image'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
595
            $this->image = $data['image'];
596
        }
597
598 View Code Duplication
        if (isset($data['video']) && $data['video'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
599
            $this->video = $data['video'];
600
        }
601
602
        if (isset($data['audio']) && $data['audio'] !== null) {
603
            $this->audio = $data['audio'];
604
        }
605
606
        if (isset($data['autoplay']) && $data['autoplay'] !== null) {
607
            $this->autoplay = $data['autoplay'];
608
        }
609
610 View Code Duplication
        if (isset($data['timer']) && $data['timer'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
611
            $this->timer = $data['timer'];
612
        }
613
614
        if (isset($data['timer_duration']) && $data['timer_duration'] !== null) {
615
            $this->timer_duration = $data['timer_duration'];
616
        }
617
618
        if (isset($data['max_points']) && $data['max_points'] !== null) {
619
            $this->max_points = $data['max_points'];
620
        }
621
622
        if (isset($data['max_correct_answers']) && $data['max_correct_answers'] !== null) {
623
            $this->max_correct_answers = $data['max_correct_answers'];
624
        }
625
    }
626
627
    public function setInputFilter(InputFilterInterface $inputFilter)
628
    {
629
        throw new \Exception("Not used");
630
    }
631
632
    public function getInputFilter()
633
    {
634
        if (!$this->inputFilter) {
635
            $inputFilter = new InputFilter();
636
            $factory = new InputFactory();
637
638
            $inputFilter->add($factory->createInput(array(
639
                'name'       => 'id',
640
                'required'   => false,
641
                'allowEmpty' => true,
642
                'filters'    => array(
643
                    array('name' => 'Int'),
644
                ),
645
            )));
646
647
            $inputFilter->add($factory->createInput(array(
648
                'name'     => 'prediction',
649
                'required' => false,
650
                'allowEmpty' => true,
651
                // 'filters'    => array(
652
                //     array('name' => 'Boolean'),
653
                // ),
654
            )));
655
656
            $inputFilter->add($factory->createInput(array(
657
                'name'     => 'question',
658
                'required' => true,
659
            )));
660
661
            $inputFilter->add($factory->createInput(array(
662
                'name'     => 'max_correct_answers',
663
                'required' => false,
664
                'allowEmpty' => true,
665
                'filters'  => array(
666
                    array('name' => 'Int'),
667
                ),
668
                'validators' => array(
669
                    array(
670
                        'name'    => 'Digits',
671
                    ),
672
                ),
673
            )));
674
675
            $inputFilter->add($factory->createInput(array(
676
                'name'     => 'hint',
677
                'required' => false,
678
                /*'filters'  => array(
679
                    array('name' => 'StringTrim'),
680
                ),
681
                'validators' => array(
682
                    array(
683
                        'name'    => 'StringLength',
684
                        'options' => array(
685
                            'encoding' => 'UTF-8',
686
                            'min'      => 1,
687
                            'max'      => 255,
688
                        ),
689
                    ),
690
                ),*/
691
            )));
692
693
            $inputFilter->add($factory->createInput(array(
694
                'name'       => 'timer',
695
                'required'   => false,
696
                'allowEmpty' => true,
697
                // 'filters'    => array(
698
                //     array('name' => 'Boolean'),
699
                // ),
700
            )));
701
702
            $inputFilter->add($factory->createInput(array(
703
                'name'     => 'jsonData',
704
                'required' => false,
705
                'allowEmpty' => true,
706
            )));
707
708
            $inputFilter->add($factory->createInput(array(
709
                'name'     => 'type',
710
                'required' => true,
711
                'validators' => array(
712
                    array(
713
                        'name'    => 'Between',
714
                        'options' => array(
715
                            'min'      => 0,
716
                            'max'      => 2,
717
                        ),
718
                    ),
719
                ),
720
            )));
721
722
            $inputFilter->add($factory->createInput(array(
723
                'name'     => 'image',
724
                'required' => false,
725
            )));
726
727
            $inputFilter->add($factory->createInput(array(
728
                'name'     => 'audio',
729
                'required' => false,
730
                'filters' => array(
731
                    array('name' => 'Int')
732
                ),
733
            )));
734
735
            $inputFilter->add($factory->createInput(array(
736
                'name'       => 'autoplay',
737
                'required'   => false,
738
                'allowEmpty' => true,
739
                // 'filters'    => array(
740
                //     array('name' => 'Boolean'),
741
                // ),
742
            )));
743
744
            $this->inputFilter = $inputFilter;
745
        }
746
747
        return $this->inputFilter;
748
    }
749
}
750