apply() публичный Метод

public apply ( Phpro\SoapClient\CodeGenerator\Context\ContextInterface $context )
$context Phpro\SoapClient\CodeGenerator\Context\ContextInterface
Пример #1
0
 /**
  * @param RuleInterface    $rule
  * @param ContextInterface $context
  */
 private function applyRule(RuleInterface $rule, ContextInterface $context)
 {
     if (!$rule->appliesToContext($context)) {
         return;
     }
     $rule->apply($context);
 }
Пример #2
0
 function it_can_apply_to_multiple_other_rules(RuleInterface $rule1, RuleInterface $rule2, ContextInterface $context)
 {
     $rule1->appliesToContext($context)->willReturn(false);
     $rule1->apply($context)->shouldNotBeCalled();
     $rule2->appliesToContext($context)->willReturn(true);
     $rule2->apply($context)->shouldBeCalled();
     $this->apply($context);
 }
Пример #3
0
 function it_appies_subrule_when_applied(RuleInterface $subRule, ContextInterface $context)
 {
     $subRule->apply($context)->shouldBeCalled();
     $this->apply($context);
 }
Пример #4
0
 function it_applies_the_default_rule_to_unknown_types(RuleInterface $defaultRule, TypeContext $context)
 {
     $context->getType()->willReturn(new Type('MyNamespace', 'UnknownType', []));
     $defaultRule->apply($context)->shouldBeCalled();
     $this->apply($context);
 }
Пример #5
0
 function it_can_skip_rules(RuleInterface $rule, ContextInterface $context)
 {
     $rule->appliesToContext($context)->willReturn(false);
     $rule->apply($context)->shouldNotBeCalled();
     $this->applyRules($context);
 }
Пример #6
0
 /**
  * @param ContextInterface $context
  */
 public function apply(ContextInterface $context)
 {
     $this->subRule->apply($context);
 }