Completed
Push — work-fleets ( f5fbda...1bdd41 )
by SuperNova.WS
06:04
created

affilates.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
classSupernova::<?php
2
3
/**
4
 * affilates.php
5
 *
6
 * v2 (c) copyright 2010 by Gorlum for http://supernova.ws
7
 *  [~] Complies with PCG1
8
 * v1 (c) copyright 2010 by Gorlum for http://supernova.ws
9
 */
10
11
include('common.' . substr(strrchr(__FILE__, '.'), 1));
12
13
lng_include('affilates');
14
15
$template = gettemplate('affilates', true);
16
17
$rpg_bonus_minimum = classSupernova::$config->rpg_bonus_minimum;
0 ignored issues
show
The property rpg_bonus_minimum does not exist on object<classConfig>. Since you implemented __set, maybe consider adding a @property annotation.

Since your code implements the magic setter _set, this function will be called for any write access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?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.");
        }
    }

}

Since the property has write access only, you can use the @property-write 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...
18
$rpg_bonus_divisor = classSupernova::$config->rpg_bonus_divisor ? classSupernova::$config->rpg_bonus_divisor : 10;
0 ignored issues
show
The property rpg_bonus_divisor does not exist on object<classConfig>. Since you implemented __get, maybe consider adding a @property annotation.

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 @property annotation to your class or interface to document the existence of this variable.

<?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...
19
20
$affilates = db_referrals_list_by_id($user['id']);
21
while ($affilate = db_fetch($affilates))
22
{
23
  $affilate_gain = $affilate['dark_matter'] >= $rpg_bonus_minimum ? floor($affilate['dark_matter'] / $rpg_bonus_divisor) : 0;
24
25
  $template->assign_block_vars('affilates', array(
26
    'REGISTERED'  => date(FMT_DATE_TIME, $affilate['register_time']),
27
    'USERNAME'    => $affilate['username'],
28
    'DARK_MATTER' => $affilate['dark_matter'],
29
    'GAINED'      => $affilate_gain,
30
  ));
31
32
  $gained += $affilate_gain;
33
}
34
35
$bannerURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_banner_URL;
0 ignored issues
show
The property int_banner_URL does not exist on object<classConfig>. Since you implemented __get, maybe consider adding a @property annotation.

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 @property annotation to your class or interface to document the existence of this variable.

<?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...
36
$bannerURL .= strpos($bannerURL, '?') ? '&' : '?';
37
$bannerURL .= "id={$user['id']}";
38
39
$userbarURL  = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_userbar_URL;
0 ignored issues
show
The property int_userbar_URL does not exist on object<classConfig>. Since you implemented __get, maybe consider adding a @property annotation.

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 @property annotation to your class or interface to document the existence of this variable.

<?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...
40
$userbarURL .= strpos($userbarURL, '?') ? '&' : '?';
41
$userbarURL .= "id={$user['id']}";
42
43
$template->assign_vars(array(
44
  'GAINED'     => $gained,
45
  'user_id'    => $user['id'],
46
  'bannerURL'  => $bannerURL,
47
  'userbarURL' => $userbarURL,
48
));
49
50
display(parsetemplate($template), classLocale::$lang['aff_title']);
51