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

Install quality tools #11

Closed
ecourtial opened this issue Feb 12, 2020 · 3 comments
Closed

Install quality tools #11

ecourtial opened this issue Feb 12, 2020 · 3 comments

Comments

@ecourtial
Copy link
Collaborator

We should install and configure

  • PHP CS Fixer + a pass
  • PHP Stan with at least level 2, and note all the error we could fix.

This would be a first step to make this bundle to evolve :)

@mihaileu mihaileu mentioned this issue Feb 28, 2020
@mihaileu
Copy link
Collaborator

mihaileu commented Feb 28, 2020

These are the errors in order to pass phpstan level 2.


 ------ -----------------------------------------------------------------------------------------------------------------------
  Line   Command\RpcServerCommand.php                                                                                          
 ------ -----------------------------------------------------------------------------------------------------------------------
  44     Method OldSound\RabbitMqBundle\Command\RpcServerCommand::execute() should return int but return statement is missing.
 ------ -----------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------------
  Line   Command\StdInProducerCommand.php                                                                                          
 ------ ---------------------------------------------------------------------------------------------------------------------------
  62     Method OldSound\RabbitMqBundle\Command\StdInProducerCommand::execute() should return int but return statement is missing.
 ------ ---------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------
  Line   DependencyInjection\Configuration.php                                                                       
 ------ -------------------------------------------------------------------------------------------------------------
  34     Call to an undefined method Symfony\Component\Config\Definition\Builder\TreeBuilder::root().
  60     Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::children().
  95     Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  119    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::children().
  143    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  183    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  222    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  267    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  306    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  326    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::children().
  348    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::append().
  381    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeParentInterface::scalarNode().
  413    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::children().
  424    Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeParentInterface::booleanNode().
 ------ -------------------------------------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------------------------
  Line   DependencyInjection\OldSoundRabbitMqExtension.php                                                  
 ------ ----------------------------------------------------------------------------------------------------
  103    Call to an undefined method Symfony\Component\DependencyInjection\Definition::setFactoryService().
  104    Call to an undefined method Symfony\Component\DependencyInjection\Definition::setFactoryMethod().
 ------ ----------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------
  Line   MemoryChecker\MemoryConsumptionChecker.php                                
 ------ ---------------------------------------------------------------------------
  51     Binary operation "*=" between string and (float|int) results in an error.
  54     Binary operation "*=" between string and (float|int) results in an error.
  57     Binary operation "*=" between string and 1024 results in an error.
 ------ ---------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------
  Line   RabbitMq\BaseConsumer.php                                                                                 
 ------ -----------------------------------------------------------------------------------------------------------
  30     PHPDoc tag @param has invalid value ($callback): Unexpected token "$callback", expected type at offset 19
 ------ -----------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------
  Line   RabbitMq\DequeuerInterface.php                                                                                  
 ------ -----------------------------------------------------------------------------------------------------------------
  21     PHPDoc tag @param has invalid value ($idleTimeout): Unexpected token "$idleTimeout", expected type at offset 52
 ------ -----------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------
  Line   RabbitMq\MultipleConsumer.php                                                                                      
 ------ --------------------------------------------------------------------------------------------------------------------
  117    Method OldSound\RabbitMqBundle\Provider\QueuesProviderInterface::getQueues() invoked with 1 parameter, 0 required.
 ------ --------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\AMQPConnectionFactoryTest.php                                                                                                                                                
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  275    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  297    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  340    Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\AMQPConnectionFactoryTest::prepareConnectionParametersProvider() has invalid type PHPUnit_Framework_MockObject_MockObject.
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\BaseAmqpTest.php                                                                                
 ------ ----------------------------------------------------------------------------------------------------------------
  49     PHPDoc tag @var for variable $baseAmqpConsumer contains unknown class PHPUnit_Framework_MockObject_MockObject.
  61     Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  85     PHPDoc tag @param has invalid value ($name): Unexpected token "$name", expected type at offset 19
  85     PHPDoc tag @param has invalid value ($obj): Unexpected token "$obj", expected type at offset 40
  85     PHPDoc tag @param has invalid value ($params): Unexpected token "$params", expected type at offset 60
 ------ ----------------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\BindingTest.php                                                                                                                                  
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------
  20     Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\BindingTest::prepareAMQPConnection() has invalid type PHPUnit_Framework_MockObject_MockObject.
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\ConsumerTest.php                                                                   
 ------ ---------------------------------------------------------------------------------------------------
  154    PHPDoc tag @param has invalid value ($data): Unexpected token "$data", expected type at offset 65
 ------ ---------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\DynamicConsumerTest.php                                                                                                                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  19     Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\DynamicConsumerTest::prepareQueueOptionsProvider() has invalid type OldSound\RabbitMqBundle\Tests\RabbitMq\QueueOptionsProviderInterface.
  19     Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\DynamicConsumerTest::prepareQueueOptionsProvider() has invalid type PHPUnit_Framework_MockObject_MockObject.
  33     Call to method expects() on an unknown class OldSound\RabbitMqBundle\Tests\RabbitMq\QueueOptionsProviderInterface.
  33     Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\MultipleConsumerTest.php                                                                                                                                  
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  28     Property OldSound\RabbitMqBundle\Tests\RabbitMq\MultipleConsumerTest::$amqpChannel has unknown class PHPUnit_Framework_MockObject_MockObject as its type.
  35     Property OldSound\RabbitMqBundle\Tests\RabbitMq\MultipleConsumerTest::$amqpConnection has unknown class PHPUnit_Framework_MockObject_MockObject as its type.
  86     Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  124    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  157    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  207    Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\MultipleConsumerTest::prepareAMQPConnection() has invalid type PHPUnit_Framework_MockObject_MockObject.
  219    Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\MultipleConsumerTest::prepareAMQPChannel() has invalid type PHPUnit_Framework_MockObject_MockObject.
  231    Return typehint of method OldSound\RabbitMqBundle\Tests\RabbitMq\MultipleConsumerTest::prepareQueuesProvider() has invalid type PHPUnit_Framework_MockObject_MockObject.
  245    PHPDoc tag @param has invalid value ($expectedMethod): Unexpected token "$expectedMethod", expected type at offset 71
  245    PHPDoc tag @param has invalid value ($expectedRequeue): Unexpected token "$expectedRequeue", expected type at offset 102
  247    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  254    Call to method expects() on an unknown class PHPUnit_Framework_MockObject_MockObject.
  267    PHPDoc tag @param has invalid value ($processFlag): Unexpected token "$processFlag", expected type at offset 52
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\RpcClientTest.php                                                    
 ------ -------------------------------------------------------------------------------------
  29     Call to an undefined method PHPUnit\Framework\MockObject\MockObject::deserialize().
 ------ -------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------
  Line   Tests\RabbitMq\RpcServerTest.php                                                         
 ------ ------------------------------------------------------------------------------------------
  21     Access to an undefined property PHPUnit\Framework\MockObject\MockObject::$delivery_info.
  37     Call to an undefined method PHPUnit\Framework\MockObject\MockObject::serialize().
 ------ ------------------------------------------------------------------------------------------

@ecourtial
Copy link
Collaborator Author

OK, thanks.
Since you opened a PR to install PHPStan, I will create a new ticket to try to fix all these issues.

@ecourtial
Copy link
Collaborator Author

Done. The upgrading to level 2 will be done in another ticket.
Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants