Completed
Push — master ( a209a4...fff73d )
by Thierry
02:29
created

src/Request/Traits/Factory.php (5 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Factory.php - Trait for Jaxon Request Factory
5
 *
6
 * Make functions of the Jaxon Request Factory class available to Jaxon classes.
7
 *
8
 * @package jaxon-core
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2016 Thierry Feuzeu <[email protected]>
11
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
12
 * @link https://github.com/jaxon-php/jaxon-core
13
 */
14
15
namespace Jaxon\Request\Traits;
16
17
trait Factory
18
{
19
    /**
20
     * Return the javascript call to an Jaxon object method
21
     *
22
     * @param string         $sMethod           The method (without class) name
23
     * @param ...            $xParams           The parameters of the method
24
     *
25
     * @return object
26
     */
27
    public function call($sMethod)
0 ignored issues
show
The parameter $sMethod is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        $aArgs = func_get_args();
30
        // Make the request
31
        return call_user_func_array([rq(get_class()), 'call'], $aArgs);
32
    }
33
34
    /**
35
     * Make the pagination links for a registered Jaxon class method
36
     *
37
     * @param integer $nItemsTotal the total number of items
38
     * @param integer $nItemsPerPage the number of items per page
39
     * @param integer $nCurrentPage the current page
40
     * @param string  $sMethod the name of the method
41
     * @param ... $parameters the parameters of the method
42
     *
43
     * @return string the pagination links
44
     */
45
    public function paginate($nItemsTotal, $nItemsPerPage, $nCurrentPage, $sMethod)
0 ignored issues
show
The parameter $nItemsTotal is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $nItemsPerPage is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $nCurrentPage is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $sMethod is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
    {
47
        $aArgs = func_get_args();
48
        // Make the request
49
        return call_user_func_array([rq(get_class()), 'paginate'], $aArgs);
50
    }
51
}
52