@@ -29,20 +29,28 @@ public function processNode(Node $node, Scope $scope): array
2929 /** @var MethodCall $node */
3030 $ methodName = $ node ->name ;
3131 if (!$ methodName instanceof Identifier) {
32+ // @codeCoverageIgnoreStart
3233 return [];
34+ // @codeCoverageIgnoreEnd
3335 }
3436 $ calledOnType = $ scope ->getType ($ node ->var );
3537 $ methodReflection = $ scope ->getMethodReflection ($ calledOnType , $ methodName ->toString ());
3638 if (!$ methodReflection ) {
39+ // @codeCoverageIgnoreStart
3740 return [];
41+ // @codeCoverageIgnoreEnd
3842 }
3943 $ prototypeReflection = $ methodReflection ->getPrototype ();
4044 if (!$ prototypeReflection instanceof PhpMethodReflection) {
45+ // @codeCoverageIgnoreStart
4146 return [];
47+ // @codeCoverageIgnoreEnd
4248 }
4349 $ traitReflection = $ prototypeReflection ->getDeclaringTrait ();
4450 if (!$ traitReflection || $ traitReflection ->getName () !== HasMutator::class) {
51+ // @codeCoverageIgnoreStart
4552 return [];
53+ // @codeCoverageIgnoreEnd
4654 }
4755 $ classReflection = $ prototypeReflection ->getDeclaringClass ();
4856 $ aliases = array_change_key_case ($ classReflection ->getNativeReflection ()->getTraitAliases ());
@@ -51,18 +59,24 @@ public function processNode(Node $node, Scope $scope): array
5159 $ name = explode (':: ' , $ aliases [$ name ])[1 ];
5260 }
5361 if ($ name !== 'with ' && $ name !== 'without ' ) {
62+ // @codeCoverageIgnoreStart
5463 return [];
64+ // @codeCoverageIgnoreEnd
5565 }
5666 $ args = $ node ->getArgs ();
5767 if (!$ args ) {
68+ // @codeCoverageIgnoreStart
5869 return [];
70+ // @codeCoverageIgnoreEnd
5971 }
6072 $ propertyName = $ scope ->getType ($ args [0 ]->value );
6173 if (
6274 !$ propertyName ->isConstantScalarValue ()->yes ()
6375 || !$ propertyName ->isString ()->yes ()
6476 ) {
77+ // @codeCoverageIgnoreStart
6578 return [];
79+ // @codeCoverageIgnoreEnd
6680 }
6781 /** @var string */
6882 $ propertyName = $ propertyName ->getConstantScalarValues ()[0 ];
0 commit comments