BurningFlipside /
CommonCode
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | namespace Flipside\Auth; |
||
| 3 | |||
| 4 | trait LDAPGettableObject |
||
| 5 | { |
||
| 6 | protected function getValueWithDefault($propName) |
||
| 7 | { |
||
| 8 | if(isset($this->valueDefaults[$propName])) |
||
|
0 ignored issues
–
show
|
|||
| 9 | { |
||
| 10 | $tmp = $this->getFieldSingleValue($propName); |
||
| 11 | if($tmp === false) |
||
| 12 | { |
||
| 13 | return $this->valueDefaults[$propName]; |
||
|
0 ignored issues
–
show
The property
valueDefaults does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 14 | } |
||
| 15 | return $tmp; |
||
| 16 | } |
||
| 17 | return false; |
||
| 18 | } |
||
| 19 | |||
| 20 | protected function getMultiValueProp($propName) |
||
| 21 | { |
||
| 22 | if(in_array($propName, $this->multiValueProps)) |
||
|
0 ignored issues
–
show
The property
multiValueProps does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 23 | { |
||
| 24 | $tmp = $this->getField($propName); |
||
| 25 | if(isset($tmp['count'])) |
||
| 26 | { |
||
| 27 | unset($tmp['count']); |
||
| 28 | } |
||
| 29 | return $tmp; |
||
| 30 | } |
||
| 31 | return false; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function __get($propName) |
||
| 35 | { |
||
| 36 | if(isset($this->labeleduri)) |
||
| 37 | { |
||
| 38 | //Have multiple emails |
||
| 39 | if($propName === 'mail') |
||
| 40 | { |
||
| 41 | return $this->getFieldSingleValue('labeleduri'); |
||
| 42 | } |
||
| 43 | if($propName === 'allMail') |
||
| 44 | { |
||
| 45 | $tmp = $this->getField('mail'); |
||
| 46 | if(isset($tmp['count'])) |
||
| 47 | { |
||
| 48 | unset($tmp['count']); |
||
| 49 | } |
||
| 50 | return $tmp; |
||
| 51 | } |
||
| 52 | } |
||
| 53 | $tmp = $this->getValueWithDefault($propName); |
||
| 54 | if($tmp !== false) |
||
| 55 | { |
||
| 56 | return $tmp; |
||
| 57 | } |
||
| 58 | $tmp = $this->getMultiValueProp($propName); |
||
| 59 | if($tmp !== false) |
||
| 60 | { |
||
| 61 | return $tmp; |
||
| 62 | } |
||
| 63 | return $this->getFieldSingleValue($propName); |
||
| 64 | } |
||
| 65 | |||
| 66 | public function __isset($propName) |
||
| 67 | { |
||
| 68 | if(isset($this->valueDefaults[$propName])) |
||
|
0 ignored issues
–
show
The property
valueDefaults does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 69 | { |
||
| 70 | return true; |
||
| 71 | } |
||
| 72 | if(in_array($propName, $this->multiValueProps)) |
||
|
0 ignored issues
–
show
The property
multiValueProps does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 73 | { |
||
| 74 | return true; |
||
| 75 | } |
||
| 76 | if(!is_object($this->ldapObj)) |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 77 | { |
||
| 78 | if(isset($this->ldapObj['labeleduri'])) |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 79 | { |
||
| 80 | if($propName === 'allMail') |
||
| 81 | { |
||
| 82 | return true; |
||
| 83 | } |
||
| 84 | } |
||
| 85 | return isset($this->ldapObj[$propName]); |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 86 | } |
||
| 87 | if(is_object($this->ldapObj)) |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 88 | { |
||
| 89 | $lowerName = strtolower($propName); |
||
| 90 | if(isset($this->ldapObj->labeleduri)) |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 91 | { |
||
| 92 | if($propName === 'allMail') |
||
| 93 | { |
||
| 94 | return true; |
||
| 95 | } |
||
| 96 | } |
||
| 97 | return isset($this->ldapObj->{$lowerName}); |
||
|
0 ignored issues
–
show
The property
ldapObj does not exist on object<Flipside\Auth\LDAPGettableObject>. 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. Loading history...
|
|||
| 98 | } |
||
| 99 | return false; |
||
| 100 | } |
||
| 101 | } |
||
| 102 | |||
| 103 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
||
| 104 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.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.