Cannot use yii\base\Object as Object because 'Object' is a special class name yii2 advance - yii2-advanced-app

I just bougth a stronger pc, installed composer and wanted to continue my project on it but when I use gii it give me this error.
How can I fix it ? Why am I getting it ? Thank you.

solved. since 2.0.13, the class name Object is invalid since PHP 7.2, use [[BaseObject]] instead. So in the vendor/yiisoft/yii2-gii/CodeFile.php just had to change Object to BaseObject.

solved. since 2.0.13, the class name Object is invalid in PHP 7.2,
//Replace
//class User extends \yii\base\Object implements \yii\web\IdentityInterface
class User extends \yii\base\BaseObject implements \yii\web\IdentityInterface
And Download the yii-basic-app-2.0.25 from https://www.yiiframework.com/download
after that copy the yiisoft folder from vendor and replace the yiisoft folder in your project in vendor folder
Now check your project will be working fine.
Its work for me hope it will work for you.

in my case i change file
/vendor/trntv/yii2-command-bus/src/middlewares/BackgroundCommandMiddleware.php
use yii\base\Object; to use yii\base\BaseObject;
and
class BackgroundCommandMiddleware extends Object implements Middleware
to ;
class BackgroundCommandMiddleware extends BaseObject implements Middleware

Related

Eclipse fails to auto-suggest Jackson class

What is causing Eclipse to NOT recognize and consequently not offer any suggestion on an import of JsonParser.Feature as shown in the picture below:
Manually adding the static import of com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES (commented in the picture above), however, works fine.
Would it be the case that something is eclipsing the file on the classpath, and if so - what is Eclipse's strategy on resolving those conflicts? Or is it something else?
Thank you in advance.
You cannot use JsonParser class to access Feature since it is not a static member of the class. Instead you can directly use the Feature class :
mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);
I can suggest 2 workarounds:
Use AutoComplete (Ctrl + Space) to suggest classes:
Add . to class Name (JsonParser.) and then remove it (JsonParser) it will suggest all JsonParser classes:

Is ReferentialJDOStateManager not used in DataNucleus 4.x?

I'm working with Apache Isis, attempting to update to DN 4.x but have a question about the ReferentialJDOStateManager in DataNucleus.
The JDOStateManager extended this class in DN 3.x but it is not present in DN 4.x
Affected class in Isis -
public class JDOStateManagerForIsis extends ReferentialJDOStateManager implements StateManager, ObjectProvider
I do see this class -
org.datanucleus.state.ReferentialStateManagerImpl
I thought this might be the appropriate replacement, but if I extend ReferentialStateManagerImpl, there are problems...
The problem I encounter when extending the new class -
ReferentialStateManagerImpl extends StateManagerImpl. Which extends
AbstractStateManager<Persistable>
The current JDOStateManagerForIsis is setup to handle PersistenceCapable objects rather than Persistable objects.
I'm not sure where to go from here.
PersistenceCapable is not used by DataNucleus v4.x AFAIK; that was the old JDO-specific bytecode enhancement contract that they no longer use, now using DN-own Persistable.
I also see that each StoreManager can define which StateManager/ObjectProvider it is using, and the RDBMS plugin specifies ReferentialStateManagerImpl

extending native session class codeigniter 1.7.2

I'm using native session library to replace the built in session library in CI. I need to extend the class but when I drop in MY_Session.php, CI reverts back to the old /system/libraries/Session.php.
How to I extend a class that's replaced a core CI class like Session.php?
Simply by naming your class files identically to a native library will
cause CodeIgniter to use it instead of the native one. To use this
feature you must name the file and the class declaration exactly the
same as the native library. For example, to replace the native Email
library you'll create a file named application/libraries/Email.php
-user guide
then call it
class MY_Email extends CI_Email {
public function __construct()
{
parent::__construct();
}
}
Loading Your Sub-class:
$this->load->library('email');
EDIT
Try this:
Just load your new library (the one doing the extending):
Then, let's say we have Session.php and Mysession.php
<?php
load_class('session', false);
class Mysession extends Session {
//your code
}
You don't need the MY_ name tag still, I think you want to reserve that for it's original intended purpose to avoid confusion.
.. else just use an include() or require() :P

Compiling .as file in Flex SDK that extends a base class

I am simply trying to compile a .as file that extends another .as file like this:
public class BigSquare extends Square{
...
}
I go to the command line and type:
mxmlc BigSquare.as
The error I get is "The definition of base class Square was not found."
Where do I need to place the base class Square.as in order for BigSquare.as to compile?
You should add to the command line parameters the "-source-path" with the path to the other files you use at compile time (i.e. Square.as). More information here: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_13.html . You call should look like this
mxmlxc -source-path "path/to/Square.as" BigSquare.as
Hope it helps.

Where do I place base action class in Symfony plugin?

I'm creating a plugin for my symfony project, which includes a base action class, i.e.:
<?php
// myActions.class.php
class myActions extends sfActions {
/* ... */
}
Where in my plugin folder (e.g.: plugins/sfMyPlugin/???) should I place this file?
The goal is to have actions that are NOT a part of this plugin extend this class, hopefully having the class be autoloaded (similar to if it were placed under apps/my_app/lib). If it can't be autoloaded, how do I get symfony to include my php file?
You typically put it in your plugin's lib directory. The general conventions is also to to name with Base in the name so given your example that would be BasemyActions. Then you would also make an empty concrete class called myActions and you would extend that within your plugin thus allowing other user to complety replace myActions with their own implementation (so long as it extends the base class) or to simply extend myActions.
you can place it in the lib directory of your plugin. This is what the generate:plugin-module task of the sfTaskExtraPlugin does.