This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | class OpauthIdentityTest extends SapphireTest { |
||
0 ignored issues
–
show
|
|||
3 | |||
4 | protected $usesDatabase = true; |
||
5 | |||
6 | public function setUp() { |
||
7 | parent::setUp(); |
||
8 | |||
9 | Config::inst()->update('OpauthIdentity', 'member_mapper', array( |
||
10 | 'Facebook' => array( |
||
11 | 'FirstName' => 'info.first_name', |
||
12 | 'Surname' => 'info.last_name', |
||
13 | 'Email' => 'info.email', |
||
14 | ) |
||
15 | )); |
||
16 | } |
||
17 | |||
18 | public function testFindOrCreateMemberLinkOnMatch() { |
||
19 | $member = new Member(array('Email' => '[email protected]')); |
||
20 | $member->write(); |
||
21 | |||
22 | $identity = OpauthIdentity::factory(array( |
||
23 | 'auth' => array( |
||
24 | 'provider' => 'Facebook', |
||
25 | 'uid' => 999, |
||
26 | 'info' => array('email' => '[email protected]') |
||
27 | ) |
||
28 | )); |
||
29 | $identity->findOrCreateMember(array('linkOnMatch' => false)); |
||
30 | $this->assertEquals(0, $identity->MemberID, 'Does not link unless requested'); |
||
0 ignored issues
–
show
The property
MemberID does not exist on object<OpauthIdentity> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
31 | |||
32 | $identity = OpauthIdentity::factory(array( |
||
33 | 'auth' => array( |
||
34 | 'provider' => 'Facebook', |
||
35 | 'uid' => 999, |
||
36 | 'info' => array('email' => '[email protected]') |
||
37 | ) |
||
38 | )); |
||
39 | $identity->findOrCreateMember(array('linkOnMatch' => true)); |
||
40 | $this->assertEquals( |
||
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
41 | $member->ID, |
||
42 | $identity->MemberID, |
||
0 ignored issues
–
show
The property
MemberID does not exist on object<OpauthIdentity> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
43 | 'Links if requested and email matches' |
||
44 | ); |
||
45 | |||
46 | $identity = OpauthIdentity::factory(array( |
||
47 | 'auth' => array( |
||
48 | 'provider' => 'Facebook', |
||
49 | 'uid' => 999, |
||
50 | 'info' => array('email' => '[email protected]') |
||
51 | ) |
||
52 | )); |
||
53 | $identity->findOrCreateMember(array('linkOnMatch' => true)); |
||
54 | $this->assertEquals(0, $identity->MemberID, 'Does not link if requested but no member found'); |
||
0 ignored issues
–
show
The property
MemberID does not exist on object<OpauthIdentity> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
55 | } |
||
56 | |||
57 | public function testFindOrCreateMemberOverwriteExistingFields() { |
||
58 | $member = new Member(array( |
||
59 | 'Email' => '[email protected]', |
||
60 | 'FirstName' => 'Existing', |
||
61 | 'Surname' => 'Existing', |
||
62 | )); |
||
63 | $member->write(); |
||
64 | |||
65 | $identity = OpauthIdentity::factory(array( |
||
66 | 'auth' => array( |
||
67 | 'provider' => 'Facebook', |
||
68 | 'uid' => 999, |
||
69 | 'info' => array( |
||
70 | 'email' => '[email protected]', |
||
71 | 'first_name' => 'New', |
||
72 | 'last_name' => 'New' |
||
73 | ) |
||
74 | ) |
||
75 | )); |
||
76 | $member = $identity->findOrCreateMember(array('overwriteExistingFields' => false)); |
||
77 | $this->assertEquals( |
||
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
78 | 'Existing', |
||
79 | $member->FirstName, |
||
80 | 'Does not overwrite unless requested' |
||
81 | ); |
||
82 | |||
83 | $identity = OpauthIdentity::factory(array( |
||
84 | 'auth' => array( |
||
85 | 'provider' => 'Facebook', |
||
86 | 'uid' => 999, |
||
87 | 'info' => array( |
||
88 | 'email' => '[email protected]', |
||
89 | 'first_name' => 'New', |
||
90 | 'last_name' => 'New' |
||
91 | ) |
||
92 | ) |
||
93 | )); |
||
94 | $member = $identity->findOrCreateMember(array('overwriteExistingFields' => array( |
||
95 | 'FirstName' |
||
96 | ))); |
||
97 | $this->assertEquals( |
||
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
98 | 'New', |
||
99 | $member->FirstName, |
||
100 | 'Overwrites existing fields if requested' |
||
101 | ); |
||
102 | $this->assertEquals( |
||
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<OpauthIdentityTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
103 | 'Existing', |
||
104 | $member->Surname, |
||
105 | 'Does not overwrite fields if not present in whitelist' |
||
106 | ); |
||
107 | } |
||
108 | |||
109 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.