@@ -18,7 +18,7 @@ final class AssertTag implements TypedTag
1818 /**
1919 * @param self::NULL|self::IF_TRUE|self::IF_FALSE $if
2020 */
21- public function __construct (private string $ if , private Type $ type , private AssertTagParameter $ parameter , private bool $ negated , private bool $ equality )
21+ public function __construct (private string $ if , private Type $ type , private AssertTagParameter $ parameter , private bool $ negated , private bool $ equality, private bool $ isExplicit )
2222 {
2323 }
2424
@@ -60,14 +60,14 @@ public function isEquality(): bool
6060 */
6161 public function withType (Type $ type ): TypedTag
6262 {
63- $ tag = new self ($ this ->if , $ type , $ this ->parameter , $ this ->negated , $ this ->equality );
63+ $ tag = new self ($ this ->if , $ type , $ this ->parameter , $ this ->negated , $ this ->equality , $ this -> isExplicit );
6464 $ tag ->originalType = $ this ->getOriginalType ();
6565 return $ tag ;
6666 }
6767
6868 public function withParameter (AssertTagParameter $ parameter ): self
6969 {
70- $ tag = new self ($ this ->if , $ this ->type , $ parameter , $ this ->negated , $ this ->equality );
70+ $ tag = new self ($ this ->if , $ this ->type , $ parameter , $ this ->negated , $ this ->equality , $ this -> isExplicit );
7171 $ tag ->originalType = $ this ->getOriginalType ();
7272 return $ tag ;
7373 }
@@ -78,9 +78,19 @@ public function negate(): self
7878 throw new ShouldNotHappenException ();
7979 }
8080
81- $ tag = new self ($ this ->if , $ this ->type , $ this ->parameter , !$ this ->negated , $ this ->equality );
81+ $ tag = new self ($ this ->if , $ this ->type , $ this ->parameter , !$ this ->negated , $ this ->equality , $ this -> isExplicit );
8282 $ tag ->originalType = $ this ->getOriginalType ();
8383 return $ tag ;
8484 }
8585
86+ public function isExplicit (): bool
87+ {
88+ return $ this ->isExplicit ;
89+ }
90+
91+ public function toImplicit (): self
92+ {
93+ return new self ($ this ->if , $ this ->type , $ this ->parameter , $ this ->negated , $ this ->equality , false );
94+ }
95+
8696}
0 commit comments