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 the phpdoc blocks #9808

Merged
merged 1 commit into from Jan 13, 2021
Merged

Fix the phpdoc blocks #9808

merged 1 commit into from Jan 13, 2021

Conversation

williamdes
Copy link
Contributor

Here are the unfixed/unfixable errors

|  ------ ----------------------------------------------------------------- 
|   Line   src/Core/Manifest/Module.php                                     
|  ------ ----------------------------------------------------------------- 
|   287    The method "requireFile" has "1" @param tags but only "0" where  
|          expected. on "SilverStripe\Core\Manifest\requireFile"            
|  ------ ----------------------------------------------------------------- 
| 
|  ------ --------------------------------------------- 
|   Line   src/Forms/FormField.php                      
|  ------ --------------------------------------------- 
|   1038   "\FieldHolder.ss" is not a valid Fqsen. on   
|          "SilverStripe\Forms\FormField::FieldHolder"  
|   1301   "\{@link" is not a valid Fqsen. on           
|          "SilverStripe\Forms\FormField::Type"         
|  ------ --------------------------------------------- 
| 
|  ------ --------------------------------------------------------------------- 
|   Line   src/Forms/GridField/GridFieldFilterHeader.php                        
|  ------ --------------------------------------------------------------------- 
|   172    The "arguments" parameter of the method "handleAction" is missing a  
|          @param tag on                                                        
|          "SilverStripe\Forms\GridField\GridFieldFilterHeader::handleAction"   
|  ------ --------------------------------------------------------------------- 
| 
|  ------ ----------------------------------------------------------------------- 
|   Line   src/Forms/GridField/GridField_ActionMenuItem.php                       
|  ------ ----------------------------------------------------------------------- 
|   28     "\{@link" is not a valid Fqsen. on                                     
|          "SilverStripe\Forms\GridField\GridField_ActionMenuItem::getTitle"      
|   40     "\{@link" is not a valid Fqsen. on                                     
|          "SilverStripe\Forms\GridField\GridField_ActionMenuItem::getExtraData"  
|   53     "\{@link" is not a valid Fqsen. on                                     
|          "SilverStripe\Forms\GridField\GridField_ActionMenuItem::getGroup"      
|  ------ ----------------------------------------------------------------------- 
| 
|  ------ ----------------------------------------------------------------- 
|   Line   src/Forms/GridField/GridField_ActionMenuLink.php                 
|  ------ ----------------------------------------------------------------- 
|   20     "\{@link" is not a valid Fqsen. on                               
|          "SilverStripe\Forms\GridField\GridField_ActionMenuLink::getUrl"  
|  ------ ----------------------------------------------------------------- 
| 
|  ------ --------------------------------------------------------- 
|   Line   src/Forms/GridField/GridField_ActionProvider.php         
|  ------ --------------------------------------------------------- 
|   17     "\{@link" is not a valid Fqsen. on                       
|          "SilverStripe\Forms\GridField\GridField_ActionProvider"  
|  ------ --------------------------------------------------------- 
| 
|  ------ ----------------------------------------------------------------------- 
|   Line   src/Forms/GridField/GridField_ColumnProvider.php                       
|  ------ ----------------------------------------------------------------------- 
|   23     "\{@link" is not a valid Fqsen. on                                     
|          "SilverStripe\Forms\GridField\GridField_ColumnProvider::augmentColumn  
|          s"                                                                     
|  ------ ----------------------------------------------------------------------- 
| 
|  ------ -------------------------------------------------------------------- 
|   Line   src/Forms/UploadReceiver.php                                        
|  ------ -------------------------------------------------------------------- 
|   103    The method "setAllowedFileCategories" has "2" @param tags but only  
|          "1" where expected. on                                              
|          "SilverStripe\Forms\UploadReceiver::setAllowedFileCategories"       
|  ------ -------------------------------------------------------------------- 
| 
|  ------ --------------------------------------------------------------- 
|   Line   src/ORM/ArrayList.php                                          
|  ------ --------------------------------------------------------------- 
|   661    The method "filterAny" has "1" @param tags but only "0" where  
|          expected. on "SilverStripe\ORM\ArrayList::filterAny"           
|  ------ --------------------------------------------------------------- 
| 
|  ------ ----------------------------------------------------------------------- 
|   Line   src/ORM/DataList.php                                                   
|  ------ ----------------------------------------------------------------------- 
|   315    The method "sort" has "1" @param tags but only "0" where expected. on  
|          "SilverStripe\ORM\DataList::sort"                                      
|   386    The method "filter" has "1" @param tags but only "0" where expected.   
|          on "SilverStripe\ORM\DataList::filter"                                 
|   448    The method "filterAny" has "1" @param tags but only "0" where          
|          expected. on "SilverStripe\ORM\DataList::filterAny"                    
|   616    The method "exclude" has "2" @param tags but only "0" where expected.  
|          on "SilverStripe\ORM\DataList::exclude"                                
|   654    The method "excludeAny" has "2" @param tags but only "0" where         
|          expected. on "SilverStripe\ORM\DataList::excludeAny"                   
|   789    "\Generator&DataObject" is not a valid Fqsen. on                       
|          "SilverStripe\ORM\DataList::getGenerator"                              
|  ------ ----------------------------------------------------------------------- 
| 
|  ------ ----------------------------------------------------- 
|   Line   src/ORM/DataObject.php                               
|  ------ ----------------------------------------------------- 
|   1215   "\{@link" is not a valid Fqsen. on                   
|          "SilverStripe\ORM\DataObject::validate"              
|   3474   "\$sourceQueryParams" is not a valid Fqsen. on       
|          "SilverStripe\ORM\DataObject::getSourceQueryParams"  
|   3495   "\$sourceQueryParams" is not a valid Fqsen. on       
|          "SilverStripe\ORM\DataObject::setSourceQueryParams"  
|   3505   "\$sourceQueryParams" is not a valid Fqsen. on       
|          "SilverStripe\ORM\DataObject::setSourceQueryParam"   
|   3515   "\$sourceQueryParams" is not a valid Fqsen. on       
|          "SilverStripe\ORM\DataObject::getSourceQueryParam"   
|   3750   "\$field_labels" is not a valid Fqsen. on            
|          "SilverStripe\ORM\DataObject::fieldLabels"           
|  ------ ----------------------------------------------------- 
| 
|  ------ ---------------------------------------------------------------------- 
|   Line   src/ORM/FieldType/DBDate.php                                          
|  ------ ---------------------------------------------------------------------- 
|   268    The method "Format" has "2" @param tags but only "1" where expected.  
|          on "SilverStripe\ORM\FieldType\DBDate::Format"                        
|  ------ ---------------------------------------------------------------------- 
| 
|  ------ --------------------------------------------------------------- 
|   Line   src/ORM/Filterable.php                                         
|  ------ --------------------------------------------------------------- 
|   61     The method "filterAny" has "1" @param tags but only "0" where  
|          expected. on "SilverStripe\ORM\Filterable::filterAny"          
|  ------ --------------------------------------------------------------- 
| 
|  ------ --------------------------------------------------------------- 
|   Line   src/ORM/ListDecorator.php                                      
|  ------ --------------------------------------------------------------- 
|   219    The method "filterAny" has "1" @param tags but only "0" where  
|          expected. on "SilverStripe\ORM\ListDecorator::filterAny"       
|  ------ --------------------------------------------------------------- 
| 
|  [ERROR] Found 27 errors                                                        
| 

@sminnee
Copy link
Member

sminnee commented Dec 22, 2020

One of the core issues we have here is that some of the methods in question make use of func_get_args to handle arguments. Our doc blocks in such cases have attempted to document the behaviour implemented by those.

Is it possible to ignore the errors & warnings only for a specific list of functions? That would be better than an across the board "ignore all errors" setting.

Note that amending these to use the new-ish variadic syntax would be nice, but it's a breaking change as it causes errors in overridden methods.

@williamdes
Copy link
Contributor Author

but it's a breaking change

Do you mean changing the actual php method declaration ?

I agree that I need to find a way to have ignore lines for "magic" codebases

@sminnee
Copy link
Member

sminnee commented Dec 22, 2020

Yeah, I meant for the actual code declaration. Tidying up semantics in the docblock for the messier parts of the real declaration is our trade off here... but it means that some docblocks may be an inexact match to the declaration, Hence the errors.

@williamdes
Copy link
Contributor Author

Do I have something to do here ?

chillu added a commit that referenced this pull request Jan 13, 2021
@chillu chillu merged commit c932d7e into silverstripe:4 Jan 13, 2021
@chillu
Copy link
Member

chillu commented Jan 13, 2021

Thanks William! I've fixed a build failure that you couldn't have predicted or really known how to fix: We've got this *.peg parser thing that generates a PHP file, and the build checks if they're the same (git diff is empty) to ensure we don't forget to commit the resulting generated file. Since you changed the PHPDoc in that generated file, it triggered the build error.

@williamdes williamdes deleted the phpdoc-fixes branch January 13, 2021 22:12
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

Successfully merging this pull request may close these issues.

None yet

3 participants