Skip to content

docs: fix BaseCommand $params @param#5927

Merged
kenjis merged 4 commits intocodeigniter4:developfrom
kenjis:fix-BaseCommand-params-type
Apr 28, 2022
Merged

docs: fix BaseCommand $params @param#5927
kenjis merged 4 commits intocodeigniter4:developfrom
kenjis:fix-BaseCommand-params-type

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Apr 27, 2022

Description
Fixes #5926

  • fix types in doc comments
  • update phpstan-baseline.neon.dist

I got the following errors, so I also fixed them.

Run vendor/bin/phpstan analyse
Note: Using configuration file /home/runner/work/CodeIgniter4/CodeIgniter4/phpstan.neon.dist.
   0/428 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
 360/428 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░]  84%
 428/428 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------- 
  Line   system/Autoloader/FileLocator.php                      
 ------ ------------------------------------------------------- 
  269    Offset 'prefix' does not exist on array{path: mixed}.  
 ------ ------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   system/Database/MySQLi/Connection.php                                  
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Cannot access property \$affected_rows on      
         bool\|object\|resource\.$# in path                                     
         /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/MySQLi/Co  
         nnection.php was not matched in reported errors.                       
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   system/Session/Handlers/DatabaseHandler.php                            
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Access to an undefined property                
         Config\\App\:\:\$sessionDBGroup\.$# in path                            
         /home/runner/work/CodeIgniter4/CodeIgniter4/system/Session/Handlers/D  
         atabaseHandler.php was not matched in reported errors.                 
 ------ ----------------------------------------------------------------------- 

https://github.com/codeigniter4/CodeIgniter4/runs/6201648310?check_suite_focus=true

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • [] Conforms to style guide

Comment thread system/CLI/BaseCommand.php Outdated
* Actually execute a command.
*
* @param array<string, mixed> $params
* @param array<int|string, string> $params
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if the option is used as a flag (i.e. without values)? php spark foo --sort
I think the value would be true or null? Not sure which one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. The true is when you use CLI::getOption() to get the value.

Copy link
Copy Markdown
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that PHPStan released 1.6.2 and it had a significant different set of detection where I was working on Myth:Auth - probably the same source here.

Thanks for the quick fix in the command types!

@kenjis kenjis merged commit 0055411 into codeigniter4:develop Apr 28, 2022
@kenjis kenjis deleted the fix-BaseCommand-params-type branch April 28, 2022 11:57
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.

Bug: BaseCommand $params Type

3 participants