22
33namespace Tanigami \Specification ;
44
5+ /**
6+ * @template T
7+ * @extends Specification<T>
8+ */
59class AndSpecification extends Specification
610{
711 /**
8- * @var Specification
12+ * @var Specification<T>
913 */
1014 private $ one ;
1115
1216 /**
13- * @var Specification
17+ * @var Specification<T>
1418 */
1519 private $ other ;
1620
1721 /**
18- * @param Specification $one
19- * @param Specification $other
22+ * @param Specification<T> $one
23+ * @param Specification<T> $other
2024 */
2125 public function __construct (Specification $ one , Specification $ other )
2226 {
@@ -25,37 +29,32 @@ public function __construct(Specification $one, Specification $other)
2529 }
2630
2731 /**
28- * {@inheritdoc}
32+ * @param T $object
2933 */
3034 public function isSatisfiedBy ($ object ): bool
3135 {
3236 return $ this ->one ->isSatisfiedBy ($ object ) && $ this ->other ->isSatisfiedBy ($ object );
3337 }
3438
35- /**
36- * {@inheritdoc}
37- */
3839 public function whereExpression (string $ alias ): string
3940 {
4041 return sprintf (
41- sprintf (
42- '(%s) AND (%s) ' ,
43- $ this ->one ()->whereExpression ($ alias ),
44- $ this ->other ()->whereExpression ($ alias )
45- )
42+ '(%s) AND (%s) ' ,
43+ $ this ->one ()->whereExpression ($ alias ),
44+ $ this ->other ()->whereExpression ($ alias )
4645 );
4746 }
4847
4948 /**
50- * @return Specification
49+ * @return Specification<T>
5150 */
5251 public function one (): Specification
5352 {
5453 return $ this ->one ;
5554 }
5655
5756 /**
58- * @return Specification
57+ * @return Specification<T>
5958 */
6059 public function other (): Specification
6160 {
0 commit comments