catfan / Medoo

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

IDE error with count, max, min, ... #703

Closed froozeify closed 6 years ago

froozeify commented 6 years ago

Hi since version 1.5, my ide give me that error

Method 'count' not found in Referenced method is not found in subject class.

Even if it's work since it's call through the __call function. The IDE autocompletion don't work too.

I'd like to know if you have a way to fix it ? (using a plugin, adding some comment in the code so the IDE understood it exist)

froozeify commented 6 years ago

I've fixed this error by adding some comment just above the class.

It will be great to add it in the next release ?

/**
 * Class Medoo
 * @package Medoo
 * @version 1.5.4
 * @link https://medoo.in
 *
 * @method int avg(String $table, Array|String $join, Array|String $column = null, Array $where = null) Get the average value for the column
 *
 * @method int count(String $table, Array|String $join, Array|String $column = null, Array $where = null) Counts the number of rows
 *
 * @method int max(String $table, Array|String $join, Array|String $column = null, Array $where = null) Get the maximum value for the column
 *
 * @method int min(String $table, Array|String $join, Array|String $column = null, Array $where = null) Get the minimum value for the column
 *
 * @method int sum(String $table, Array|String $join, Array|String $column = null, Array $where = null) Get the total value for the column
 */
class Medoo
{

Based on stackoverflow post and phpDocumentor

Skyost commented 6 years ago

Totally agree.

:+1:

catfan commented 6 years ago

I rolled it back without magic call on d7c9cf59447.

Will be available on next release.