Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation schema create error #23

Closed
albanR opened this issue Mar 29, 2013 · 16 comments
Closed

Installation schema create error #23

albanR opened this issue Mar 29, 2013 · 16 comments
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.

Comments

@albanR
Copy link
Contributor

albanR commented Mar 29, 2013

Hi,

I followed all the steps of installation successfully until command

php sylius/console doctrine:schema:create 

which gives the following error:

Fatal error: Can't inherit abstract function Sylius\Bundle\InventoryBundle\Model\StockableInterface::getSku() (previously declared abstract in Sylius\Bundle\AssortmentBundle\Model\Variant\VariantInterface) in /Applications/MAMP/htdocs/delicecook/sylius/vendor/sylius/core-bundle/Sylius/Bundle/CoreBundle/Model/VariantInterface.php on line 27

Has anyone encountered that error?
Thank your for your help,
Alban

@pjedrzejewski
Copy link
Member

Thanks for reporting, I'll check that!

@pjedrzejewski
Copy link
Member

Are you sure that you have correct vendor versions installed? Because the latest build has successfully created schema.

@albanR
Copy link
Contributor Author

albanR commented Mar 29, 2013

I installed everything via the command:

php composer.phar create-project sylius/sylius -s dev

I also downloaded the zip and made the install, only to get to the same error.

Also it says in the php manual that a class cannot implement two interfaces that share function names, since it would cause ambiguity. Isn't it what is done here though with the getSku() method?

@albanR
Copy link
Contributor Author

albanR commented Mar 30, 2013

Hello,

I am running php 5.3.6 on my local machine and still get this error. I found in a blog someone who said this problem disappeared with php 5.3.10. I tried on another server running php 5.3.21 and the error indeed disappeared. So it seems that php 5.3.3 is not enough for a successful build. I could not find anything in the php doc about this change of behaviour.

I am still wondering what are your thoughts about an interface implementing 2 different interfaces with a common method inside with php?

Thanks,
Alban

@winzou
Copy link
Contributor

winzou commented Apr 16, 2013

Hi,

Same here with a slightly different error:

PHP Fatal error:  Can't inherit abstract function
Sylius\Bundle\ShippingBundle\Model\ShipmentItemInterface::getId() (previously
declared abstract in Sylius\Bundle\InventoryBundle\Model\InventoryUnitInterface)
in /xx/vendor/sylius/core-bundle/Sylius/Bundle/CoreBundle/Model/InventoryUnitInterface.php
on line 25

Works fine on my local environment with PHP 5.4, but I encounter this error on my prod environment with PHP 5.3.3 (debian squeeze).

We should set the proper minimum version of PHP in the composer.json file, as the current 5.3.3 is not enough.

@pjedrzejewski
Copy link
Member

Ouch, not good, not good, we need to check that... Not sure how to deal with those interfaces. Thanks for reporting!

@albanR
Copy link
Contributor Author

albanR commented Apr 16, 2013

I'm definitely not an expert in that matter, but maybe we could try something like (source: http://stackoverflow.com/questions/5497613/cannot-implement-two-interfaces-that-have-the-same-method-name):

interface BaseInterface
{
    public function testMethod();
}

interface TestInterface extends BaseInterface
{
}

interface TestInterface2 extends BaseInterface
{
}

class TestClass implements TestInterface, TestInterface2
{
    public function testMethod()
    {
    }
}

replacing testMethod with id and sku properties and associated methods.

PS: thanks winzou for the amazing symfony2 tutorial!

@benboit
Copy link

benboit commented Apr 19, 2013

Fixed it with PR #22 on CoreBundle. Maybe have a look there...

@a-sane
Copy link

a-sane commented Apr 23, 2013

Same with PHP 5.3.6:

PHP Fatal error:  Can't inherit abstract function
Sylius\Bundle\ShippingBundle\Model\ShipmentItemInterface::getId() (previously
declared abstract in Sylius\Bundle\InventoryBundle\Model\InventoryUnitInterface)
in /xx/vendor/sylius/core-bundle/Sylius/Bundle/CoreBundle/Model/InventoryUnitInterface.php
on line 25

@smalot
Copy link

smalot commented May 19, 2013

Hi,
I still have the issue :

FatalErrorException: Compile Error: Can't inherit abstract function Sylius\Bundle\InventoryBundle\Model\StockableInterface::getSku() (previously declared abstract in Sylius\Bundle\AssortmentBundle\Model\Variant\VariantInterface) in /home/httpd/servers/devs/sylius/src/Sylius/Bundle/CoreBundle/Model/VariantInterface.php line 27

and

FatalErrorException: Compile Error: Can't inherit abstract function Sylius\Bundle\ShippingBundle\Model\ShipmentItemInterface::getId() (previously declared abstract in Sylius\Bundle\InventoryBundle\Model\InventoryUnitInterface) in /home/httpd/servers/fr/malot/devs/sylius/src/Sylius/Bundle/CoreBundle/Model/InventoryUnitInterface.php line 25

and

FatalErrorException: Compile Error: Can't inherit abstract function Sylius\Bundle\ShippingBundle\Model\ShipmentItemInterface::getCreatedAt() (previously declared abstract in Sylius\Bundle\InventoryBundle\Model\InventoryUnitInterface) in /home/httpd/servers/fr/malot/devs/sylius/src/Sylius/Bundle/CoreBundle/Model/InventoryUnitInterface.php line 25

and

FatalErrorException: Compile Error: Can't inherit abstract function Sylius\Bundle\ShippingBundle\Model\ShipmentItemInterface::getUpdatedAt() (previously declared abstract in Sylius\Bundle\InventoryBundle\Model\InventoryUnitInterface) in /home/httpd/servers/fr/malot/devs/sylius/src/Sylius/Bundle/CoreBundle/Model/InventoryUnitInterface.php line 25

Does someone found a fix, instead of hardly removing duplicate methods referenced in interfaces ?
(PHP Version : 5.3.3-7+squeeze15)

@albanR
Copy link
Contributor Author

albanR commented May 20, 2013

For me, it works with php 5.3.21 and php 5.4.13, and it doesn't with php 5.3.3.

@pjedrzejewski
Copy link
Member

Thanks to @stloyd, this issue should be fixed on next vendor update. I plan to finish it soon, together with Symfony 2.3 update.

@vm06007
Copy link

vm06007 commented Jun 9, 2013

is it fixed?

@umpirsky
Copy link
Contributor

It is fixed, please feel free to reopen if you can reproduce it with latest vendors.

@binabik
Copy link

binabik commented Jul 19, 2013

is this really fixed? i just tried installing sylius (multiple times) with the procedure documented in the README:

$ php composer.phar create-project sylius/sylius -s dev
$ cd sylius
$ php app/console sylius:install

after executing these steps to account for the ICU version i have on my centos 6.4 box:
http://stackoverflow.com/questions/17458978/how-do-i-install-sylius-on-bluehost-or-any-other-server-that-has-an-old-version
and applying this fix:
https://github.com/Sylius/Sylius/pull/216/files

php app/console sylius:install now succeeds. on accessing sylius/web/app_dev.php i get the above-mentioned error however.

php version: 5.4.17

@binabik
Copy link

binabik commented Jul 19, 2013

just for the archives:
@molchanoviv sent me a message [funnily enough i can't see in this comment thread], telling me to install the php-intl extension. it was already installed and active. however, no default-locale was set in php.ini. changing the intl.default_locale setting to 'en' in php.ini now allows me to access sylius.
consider my problem fixed for now. :) thanks, @molchanoviv!

pjedrzejewski pushed a commit that referenced this issue Aug 26, 2013
Adjust `composer.json`
pjedrzejewski pushed a commit that referenced this issue Aug 26, 2013
Change default behavior of dispatchEvent() shortcut in case when event is send as param
pjedrzejewski pushed a commit that referenced this issue Aug 27, 2013
pjedrzejewski pushed a commit that referenced this issue Aug 27, 2013
pjedrzejewski pushed a commit that referenced this issue Aug 27, 2013
Error in prototype model class
pjedrzejewski pushed a commit that referenced this issue Aug 27, 2013
pjedrzejewski pushed a commit that referenced this issue Aug 27, 2013
Initial operator refactoring, introduce factory
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
Adjust `composer.json`
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
Error in prototype model class
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
Initial operator refactoring, introduce factory
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
Change default behavior of dispatchEvent() shortcut in case when event is send as param
pjedrzejewski pushed a commit that referenced this issue Aug 29, 2013
pamil referenced this issue in pamil/Sylius Mar 21, 2016
CoderMaggie pushed a commit to CoderMaggie/Sylius that referenced this issue Jun 1, 2016
pamil referenced this issue in pamil/Sylius May 7, 2019
Error in prototype model class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.
Projects
None yet
Development

No branches or pull requests

9 participants