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

Fix BC break add missing method ProviderInterface::getHolidays #277

Merged
merged 1 commit into from Feb 2, 2022
Merged

Fix BC break add missing method ProviderInterface::getHolidays #277

merged 1 commit into from Feb 2, 2022

Conversation

ghost
Copy link

@ghost ghost commented Feb 2, 2022

In the previous version Yasumi\Yasumi::create was returning Yasumi\Provider\AbstractProvider now its return Yasumi\ProviderInterface without method getHolidays . Even tests expects that ProviderInterface::getHolidays exists for example Yasumi\tests\Base\YasumiTest::testRemoveHoliday

@stelgenhof
Copy link
Member

stelgenhof commented Feb 2, 2022

@jwojtyra-aterian Thank you very much for the PR. Could give me an example of how this would break things? All tests are successful (Unless the tests missed something :) )

@ghost
Copy link
Author

ghost commented Feb 2, 2022

Sure, an example from this repo, I run phpstan with current configuration but for some tests ./vendor/bin/phpstan analyse tests/Base here is part of the output. For the same reason I cannot upgrade yasumi in my project

 ------ -------------------------------------------------------------------------- 
  Line   YasumiTest.php                                                            
 ------ -------------------------------------------------------------------------- 
  138    Call to an undefined method Yasumi\ProviderInterface::count().            
  139    Call to an undefined method Yasumi\ProviderInterface::count().            
  140    Call to an undefined method Yasumi\ProviderInterface::count().            
  183    Call to an undefined method Yasumi\ProviderInterface::next().             
  199    Call to an undefined method Yasumi\ProviderInterface::next().             
  220    Call to an undefined method Yasumi\ProviderInterface::previous().         
  237    Call to an undefined method Yasumi\ProviderInterface::previous().         
  248    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  264    Call to an undefined method Yasumi\ProviderInterface::whenIs().           
  280    Call to an undefined method Yasumi\ProviderInterface::whenIs().           
  305    Call to an undefined method Yasumi\ProviderInterface::whatWeekDayIs().    
  321    Call to an undefined method Yasumi\ProviderInterface::whatWeekDayIs().    
  380    Call to an undefined method Yasumi\ProviderInterface::isHoliday().        
  385    Call to an undefined method Yasumi\ProviderInterface::isHoliday().        
  410    Call to an undefined method Yasumi\ProviderInterface::isHoliday().        
  415    Call to an undefined method Yasumi\ProviderInterface::isHoliday().    
    
  490    Call to an undefined method Yasumi\ProviderInterface::getHolidays().    
  
  508    Call to an undefined method Yasumi\ProviderInterface::removeHoliday().    
  509    Call to an undefined method Yasumi\ProviderInterface::removeHoliday().    
  510    Call to an undefined method Yasumi\ProviderInterface::removeHoliday().    
  512    Call to an undefined method Yasumi\ProviderInterface::getHolidays().      
  578    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  581    Call to an undefined method Yasumi\ProviderInterface::addHoliday().       
  582    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  583    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  588    Call to an undefined method Yasumi\ProviderInterface::addHoliday().       
  589    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  590    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  591    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  592    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
  593    Call to an undefined method Yasumi\ProviderInterface::getHolidayNames().  
 ------ -------------------------------------------------------------------------- 
 

@stelgenhof
Copy link
Member

@jwojtyra-aterian Indeed, the test classes are not yet following the checks as the base code (src) does. You should run phpstan with the provided phpstan config (phpstan.neon.dist) or use the included composer script composer phpstan.

Not sure I understand why you can't upgrade Yasumi in your project. PHPStan does not look at vendor packages when you use Yasumi as a composer package.

@ghost
Copy link
Author

ghost commented Feb 2, 2022

Yes but just like wrote at the beginning, I use method getHolidays and previously Yasumi::create returns AbstractProvider that have this method, now it returns ProviderInterface without this method. And PHPStan finds those errors in the codebase.

@stelgenhof
Copy link
Member

Ah, you mean when using PHPStan for your own project?

@ghost
Copy link
Author

ghost commented Feb 2, 2022

yes

@stelgenhof
Copy link
Member

I see, Sorry it wasn't immediately clear to me from your description. I'll make a fix for this.

@stelgenhof stelgenhof self-assigned this Feb 2, 2022
@stelgenhof stelgenhof merged commit ceeb8fd into azuyalabs:develop Feb 2, 2022
@ghost ghost deleted the fix-bc-break branch February 21, 2022 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant