catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Addition of array typing in defining parameters of methods that use data of type array. #621

Closed efrj closed 3 years ago

efrj commented 7 years ago

@catfan , I did a pull request without first opening a new issue. I added the array typing in the call of the parameters of the methods that request data of type array. I think the code should be compatible with PHP 7 to the max.

Example:

<?php
class Medoo
{
    public function __construct(array $options = null)
    {
    }

    public function query($query, array $map = [])
    {
    }
}

The Pull request ID is #620.

catfan commented 7 years ago

I don't think this is really need for this case right now. There is no great improvement if provided the type definition, and some parameter type of Medoo are changeable that like get($table, $columns, $where), the $columns can be array or string.

This is a good suggestion, but I think it need more time to be tested, reviewed and considered.