p2made / p2y2-startbootstrap-themes

Themes from Start Bootstrap (https://startbootstrap.com) as a UIs for Yii 2 Framework (http://www.yiiframework.com).
MIT License
4 stars 3 forks source link

PHP compile error #3

Closed paskuale75 closed 6 years ago

paskuale75 commented 6 years ago

I follow instructions, but it return this: "Access level to p2m\SB\assets\AgencyAsset::$resourceData must be protected (as in class p2m\assets\base\P2AssetBundle) or weaker"

paskuale75 commented 6 years ago

Any help for this ? Thanks

paskuale75 commented 6 years ago

!solved, mistake in repo version, I've removed "prefer-stable": true, from composer.json

zeejay09 commented 5 years ago

Hi, I have the same problem. I quite don't get what you mean by

I've removed "prefer-stable": true, from composer.json

I looked up in the composer.json but nothing there says "prefer-stable" true"

zeejay09 commented 5 years ago

TLDR; In the CreativeAsset.php or whateever theme you are using, i changed the $resourceData variable's access modifier from private to protected.

Solved. It is because due the variable $resourceData in CreativeAsset.php or whatever theme you are using being private. CreativeAsset.php extends from \p2m\assets\base\P2AssetBundle and P2AssetBundle extends from \p2m\base\assets\P2AssetBase which where the variable $resourceData is originally defined as protected.

So I guess the take-away from all this is that it is not a good idea to try to change visibility of base class instance/members vars in derived classes.