* [misc] Use "static" keyword instead of "self".
This commit is contained in:
@@ -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();
|
||||
* }
|
||||
* }
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ class parsedown extends baseDelegate
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->instance = new self::$className();
|
||||
$this->instance = new static::$className();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ class phpword extends baseDelegate
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->instance = new self::$className();
|
||||
$this->instance = new static::$className();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ class spyc extends baseDelegate
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->instance = new self::$className();
|
||||
$this->instance = new static::$className();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user