Completed
Push — master ( 3dab41...181b76 )
by Peter
06:26
created

src/Logic/AndX.php (1 issue)

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
 * This file is part of the Happyr Doctrine Specification package.
5
 *
6
 * (c) Tobias Nyholm <[email protected]>
7
 *     Kacper Gunia <[email protected]>
8
 *     Peter Gribanov <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Happyr\DoctrineSpecification\Logic;
15
16
use Happyr\DoctrineSpecification\Filter\Filter;
17
use Happyr\DoctrineSpecification\Query\QueryModifier;
18
19
class AndX extends LogicX
0 ignored issues
show
Deprecated Code introduced by
The class Happyr\DoctrineSpecification\Logic\LogicX has been deprecated with message: This class will be marked as abstract in 2.0.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
20
{
21
    public function __construct()
22
    {
23
        // NEXT_MAJOR: use variable-length argument lists (...$children)
24
        parent::__construct(self::AND_X, func_get_args());
25
    }
26
27
    /**
28
     * Append an other specification with a logic AND.
29
     *
30
     * <code>
31
     * $spec = Spec::andX(A, B);
32
     * $spec->andX(C);
33
     *
34
     * // We be the same as
35
     * $spec = Spec::andX(A, B, C);
36
     * </code>
37
     *
38
     * @param Filter|QueryModifier $child
39
     */
40
    public function andX($child)
41
    {
42
        $this->append($child);
43
    }
44
}
45