From 0888d6967bec1961de594a4a692ca87b36e593db Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 1 May 2016 03:58:35 +0200 Subject: [PATCH] removed yii\base\Object::className() it is easy to upgrade existing code and it serves no purpose since ::class syntax is available. --- framework/CHANGELOG.md | 4 +++- framework/UPGRADE.md | 11 ++++++++++- framework/base/Object.php | 11 ----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 49cc96e..ae9a502 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -5,7 +5,9 @@ Yii Framework 2 Change Log ----------------------- - Removed methods marked as deprected in 2.0.x (samdark) -- Chg #11397: Minimum required version of PHP is 5.6.0 now (samdark) +- Chg #11397: Minimum required version of PHP is 5.5.0 now (samdark) +- Chg: Removed `yii\base\Object::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading (cebe) + 2.0.9 under development ----------------------- diff --git a/framework/UPGRADE.md b/framework/UPGRADE.md index 60bf944..86147cd 100644 --- a/framework/UPGRADE.md +++ b/framework/UPGRADE.md @@ -18,7 +18,16 @@ php composer.phar global require "fxp/composer-asset-plugin:~1.1.1" Upgrade to Yii 2.1.0 -------------------- -* 5.6.0 is the minimum required version of PHP now. +* The minimum required PHP version is 5.5.0 now. + +* `yii\base\Object::className()` has been removed in favor of the [native PHP syntax](http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class) + `::class`. When upgrading to Yii 2.1, You should do a global search and replace for `::className()` to `::class`. + All calls on objects via `->className()` should be replaced by a call to `get_class()`. + + You can make this change even before upgrading to Yii 2.1, Yii 2.0.x does work with it. + + `::class` does not trigger auto loading so you can even use it in config. + Upgrade from Yii 2.0.7 ---------------------- diff --git a/framework/base/Object.php b/framework/base/Object.php index 4484b4a..f70bc5d 100644 --- a/framework/base/Object.php +++ b/framework/base/Object.php @@ -77,17 +77,6 @@ use Yii; class Object implements Configurable { /** - * Returns the fully qualified name of this class. - * @return string the fully qualified name of this class. - * @deprecated since version 2.1. PHPs `::class` syntax should be used instead. - * For object instances, use `get_class()`. - */ - public static function className() - { - return get_called_class(); - } - - /** * Constructor. * The default implementation does two things: *