GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 9cdac9...91f3a9 )
by Stuart
06:15
created

Browser   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 0
cbo 7
dl 0
loc 68
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A expectsBrowser() 0 4 1
A expectsForm() 0 4 1
A fromBrowser() 0 4 1
A fromForm() 0 4 1
A usingBrowser() 0 4 1
A usingForm() 0 4 1
1
<?php
2
3
/**
4
 * Copyright (c) 2011-present Mediasift Ltd
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms, with or without
8
 * modification, are permitted provided that the following conditions
9
 * are met:
10
 *
11
 *   * Redistributions of source code must retain the above copyright
12
 *     notice, this list of conditions and the following disclaimer.
13
 *
14
 *   * Redistributions in binary form must reproduce the above copyright
15
 *     notice, this list of conditions and the following disclaimer in
16
 *     the documentation and/or other materials provided with the
17
 *     distribution.
18
 *
19
 *   * Neither the names of the copyright holders nor the names of his
20
 *     contributors may be used to endorse or promote products derived
21
 *     from this software without specific prior written permission.
22
 *
23
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
 * POSSIBILITY OF SUCH DAMAGE.
35
 *
36
 * @category  Libraries
37
 * @package   Storyplayer
38
 * @author    Stuart Herbert <[email protected]>
39
 * @copyright 2011-present Mediasift Ltd www.datasift.com
40
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
41
 * @link      http://datasift.github.io/storyplayer
42
 */
43
44
namespace Storyplayer\SPv2\Modules;
45
46
use Storyplayer\SPv2\Modules\Browser\ExpectsBrowser;
47
use Storyplayer\SPv2\Modules\Browser\ExpectsForm;
48
use Storyplayer\SPv2\Modules\Browser\FromBrowser;
49
use Storyplayer\SPv2\Modules\Browser\FromForm;
50
use Storyplayer\SPv2\Modules\Browser\UsingBrowser;
51
use Storyplayer\SPv2\Modules\Browser\UsingForm;
52
53
use DataSift\Storyplayer\PlayerLib\StoryTeller;
54
55
class Browser
56
{
57
    /**
58
     * returns the ExpectsBrowser submodule
59
     *
60
     * @return Storyplayer\SPv2\Modules\Browser\ExpectsBrowser;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\ExpectsBrowser; could not be parsed: Expected "|" or "end of type", but got ";" at position 47. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
61
     */
62
    public static function expectsBrowser()
63
    {
64
        return new ExpectsBrowser(StoryTeller::instance());
65
    }
66
67
    /**
68
     * returns the ExpectsForm submodule
69
     *
70
     * @param int $formId
71
     *        the value of the form's 'id' attribute
72
     * @return Storyplayer\SPv2\Modules\Browser\ExpectsForm;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\ExpectsForm; could not be parsed: Expected "|" or "end of type", but got ";" at position 44. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
73
     */
74
    public static function expectsForm($formId)
75
    {
76
        return new ExpectsForm(StoryTeller::instance(), [$formId]);
77
    }
78
79
    /**
80
     * returns the FromBrowser submodule
81
     *
82
     * @return Storyplayer\SPv2\Modules\Browser\FromBrowser;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\FromBrowser; could not be parsed: Expected "|" or "end of type", but got ";" at position 44. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
83
     */
84
    public static function fromBrowser()
85
    {
86
        return new FromBrowser(StoryTeller::instance());
87
    }
88
89
    /**
90
     * returns the FromForm submodule
91
     *
92
     * @param int $formId
93
     *        the value of the form's 'id' attribute
94
     * @return Storyplayer\SPv2\Modules\Browser\FromForm;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\FromForm; could not be parsed: Expected "|" or "end of type", but got ";" at position 41. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
95
     */
96
    public static function fromForm($formId)
97
    {
98
        return new FromForm(StoryTeller::instance(), [$formId]);
99
    }
100
101
    /**
102
     * returns the UsingBrowser submodule
103
     *
104
     * @return Storyplayer\SPv2\Modules\Browser\UsingBrowser;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\UsingBrowser; could not be parsed: Expected "|" or "end of type", but got ";" at position 45. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
105
     */
106
    public static function usingBrowser()
107
    {
108
        return new UsingBrowser(StoryTeller::instance());
109
    }
110
111
    /**
112
     * returns the UsingForm submodule
113
     *
114
     * @param int $formId
115
     *        the value of the form's 'id' attribute
116
     * @return Storyplayer\SPv2\Modules\Browser\UsingForm;
0 ignored issues
show
Documentation introduced by
The doc-type Storyplayer\SPv2\Modules\Browser\UsingForm; could not be parsed: Expected "|" or "end of type", but got ";" at position 42. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
117
     */
118
    public static function usingForm($formId)
119
    {
120
        return new UsingForm(StoryTeller::instance(), $formId);
0 ignored issues
show
Documentation introduced by
$formId is of type integer, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
121
    }
122
}
123