Class Flux referenced with incorrect case: FLUX
15<div class="button-payment-stripe">
16 <stripe-buy-button
17 buy-button-id="<?php echo FLUX::config('StripeButtonId') ?>"
18 publishable-key="<?php echo FLUX::config('StripePublishableKey') ?>"19 client-reference-id="<?php echo $customDataEscaped ?>"
20 >
21 </stripe-buy-button>
Class Flux referenced with incorrect case: FLUX
14
15<div class="button-payment-stripe">
16 <stripe-buy-button
17 buy-button-id="<?php echo FLUX::config('StripeButtonId') ?>"18 publishable-key="<?php echo FLUX::config('StripePublishableKey') ?>"
19 client-reference-id="<?php echo $customDataEscaped ?>"
20 >
Description
Invalid call to a static method. This would lead to a run time error.
This issue can be raised for any of the following cases:
- There's a typo in either the method call or class name.
- The class on which the static method is called:
- might not exist
- might not be a
Class
- has not been imported into this scope
- The method you are trying to call is not a
static
method. - The method you are trying to call is a private static method from a parent class.
Bad practice
class Output
{
public static function writeMagic()
{
echo 'Magic!';
}
public function print()
{
return self::writeMaagic(); // typo, writeMaagic() doesn't exist
}
}
class Output
{
public static function writeMagic()
{
echo 'Magic!';
}
public function print()
{
return self::writemagic(); // typo
}
}
class PrettyLog
{
public static function log($data): void
{
}
}
class Log
{
public function print()
{
$logger = false;
return $logger::log('Something'); // $logger is not a class
}
}
function log() {
self::log(); // self/static can only be resolved inside a class
};
class Output
{
public function writeMagic()
{
echo 'Magic!';
}
public function print()
{
return self::writeMagic(); // writeMagic() is not a static method
}
}
class SuperOutput
{
private static function writeMagic()
{
echo 'Magic!';
}
}
class Output extends SuperOutput
{
public function print()
{
return static::writeMagic(); // writeMagic() is a private static method
}
}
Recommended
class Output
{
public static function writeMagic()
{
echo 'Magic!';
}
public function print()
{
return self::writeMagic();
}
}
class PrettyLog
{
public static function log($data): void
{
}
}
class Log
{
public function print()
{
$logger = 'PrettyLog';
return $logger::log('Something');
}
}
function log() {
PrettyLogger::log();
};
class SuperOutput
{
protected static function writeMagic()
{
echo 'Magic!';
}
}
class Output extends SuperOutput
{
public function print()
{
return static::writeMagic();
}
}