atk4 / core

Core Traits for Agile Toolkit
https://atk4-core.readthedocs.io
MIT License
19 stars 14 forks source link

ContainerTrait and TrackableTrait define the same property ($name) #10

Closed romaninsh closed 8 years ago

romaninsh commented 8 years ago

$ phpunit PHP Strict standards: atk4\core\ContainerTrait and atk4\core\TrackableTrait define the same property ($name) in the composition of atk4\core\tests\ContainerAppMock. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /home/travis/build/atk4/core/tests/ContainerTraitTest.php on line 188 PHP Stack trace: PHP 1. {main}() /home/travis/.phpenv/versions/5.6.23/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.6.23/bin/phpunit:569 PHP 3. PHPUnit_TextUI_Command->run() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/TextUI/Command.php:113 PHP 4. PHPUnit_TextUI_Command->handleArguments() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/TextUI/Command.php:124 PHP 5. PHPUnit_Util_Configuration->getTestSuiteConfiguration() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/TextUI/Command.php:745 PHP 6. PHPUnit_Util_Configuration->getTestSuite() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Util/Configuration.php:852 PHP 7. PHPUnit_Framework_TestSuite->addTestFiles() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Util/Configuration.php:941 PHP 8. PHPUnit_Framework_TestSuite->addTestFile() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Framework/TestSuite.php:413 PHP 9. PHPUnit_Util_Fileloader::checkAndLoad() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Framework/TestSuite.php:339 PHP 10. PHPUnit_Util_Fileloader::load() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Util/Fileloader.php:38 PHP 11. include_once() phar:///home/travis/.phpenv/versions/5.6.23/bin/phpunit/phpunit/Util/Fileloader.php:56 Strict standards: atk4\core\ContainerTrait and atk4\core\TrackableTrait define the same property ($name) in the composition of atk4\core\tests\ContainerAppMock. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /home/travis/build/atk4/core/tests/ContainerTraitTest.php on line 188

romaninsh commented 8 years ago

This issue is not there for PHP7, but older versions of PHP complain. I currently do not know how to resolve this. Both traits need the property.

http://stackoverflow.com/questions/24158392/traits-property-conflict-with-parent-class

Maybe we should ignore as it works OK on 7.x

DarkSide666 commented 8 years ago

Fixed in: https://github.com/atk4/core/commit/e7f96032931d6eab207425a47740f6e0f4873dd0 https://github.com/atk4/core/commit/0975b6f88d8c6f9120e46f386ef3ffa1e823f899