* [misc] Use "static" keyword instead of "self".

This commit is contained in:
liugang
2025-11-18 14:38:18 +08:00
parent 6046750236
commit 48de97b681
15 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ require_once dirname(__FILE__, 3) . '/vendor/autoload.php';
* protected static $className = 'ThirdPartyClass';
* public function __construct()
* {
* $this->instance = new self::$className();
* $this->instance = new static::$className();
* }
* }
*
+1 -1
View File
@@ -19,6 +19,6 @@ class captcha extends baseDelegate
public function __construct($phrase = null, ?PhraseBuilderInterface $builder = null)
{
$this->instance = new self::$className($phrase, $builder);
$this->instance = new static::$className($phrase, $builder);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class crontab extends baseDelegate
public function __construct($expression, ?FieldFactory $fieldFactory = null)
{
$this->instance = new self::$className($expression, $fieldFactory);
$this->instance = new static::$className($expression, $fieldFactory);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class diff extends baseDelegate
public function __construct($from_text = '', $to_text = '', $granularityStack = null)
{
$this->instance = new self::$className($from_text, $to_text, $granularityStack);
$this->instance = new static::$className($from_text, $to_text, $granularityStack);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class mobile extends baseDelegate
public function __construct(?array $headers = null, $userAgent = null)
{
$this->instance = new self::$className($headers, $userAgent);
$this->instance = new static::$className($headers, $userAgent);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class parsedown extends baseDelegate
public function __construct()
{
$this->instance = new self::$className();
$this->instance = new static::$className();
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class pclzip extends baseDelegate
public function __construct($p_zipname)
{
$this->instance = new self::$className($p_zipname);
$this->instance = new static::$className($p_zipname);
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ class phpExcel extends baseDelegate
public function __construct()
{
$this->instance = new self::$className();
$this->instance = new static::$className();
}
public static function load($file)
+1 -1
View File
@@ -19,6 +19,6 @@ class phpmailer extends baseDelegate
public function __construct($exceptions = null)
{
$this->instance = new self::$className($exceptions);
$this->instance = new static::$className($exceptions);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class phpthumb extends baseDelegate
public function __construct($fileName, $options = array(), array $plugins = array())
{
$this->instance = new self::$className($fileName, $options, $plugins);
$this->instance = new static::$className($fileName, $options, $plugins);
}
}
+1 -1
View File
@@ -22,6 +22,6 @@ class phpword extends baseDelegate
public function __construct()
{
$this->instance = new self::$className();
$this->instance = new static::$className();
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class pinyin extends baseDelegate
public function __construct($loaderName = null)
{
$this->instance = new self::$className($loaderName);
$this->instance = new static::$className($loaderName);
}
}
+1 -1
View File
@@ -26,6 +26,6 @@ class purifier extends baseDelegate
foreach ($config as $key => $value) {
$purifierConfig->set($key, $value);
}
$this->instance = new self::$className($purifierConfig);
$this->instance = new static::$className($purifierConfig);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class spout extends baseDelegate
public function __construct($readerType = 'xlsx')
{
$this->instance = self::$className::createFromType($readerType);
$this->instance = static::$className::createFromType($readerType);
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ class spyc extends baseDelegate
public function __construct()
{
$this->instance = new self::$className();
$this->instance = new static::$className();
}
}