src/Mutator/FunctionSignature/PublicVisibility.php
public function mutate(Node $node)
    {
        /* @var ClassMethod $node */
        return new ClassMethod(
            $node->name,
            [
                'flags' => ($node->flags & ~Class_::MODIFIER_PUBLIC) | Class_::MODIFIER_PROTECTED,
                'byRef' => $node->returnsByRef(),
                'params' => $node->getParams(),
                'returnType' => $node->getReturnType(),
                'stmts' => $node->getStmts(),
            ],
            $node->getAttributes()
        );
    }
public function mutate(Node $node)
    {
        /* @var ClassMethod $node */
        return new ClassMethod(
            $node->name,
            [
                'flags' => ($node->flags & ~Class_::MODIFIER_PUBLIC) | Class_::MODIFIER_PROTECTED,
                'byRef' => $node->returnsByRef(),
                'params' => $node->getParams(),
                'returnType' => $node->getReturnType(),
                'stmts' => $node->getStmts(),
            ],
            $node->getAttributes()
        );
    }
public function mutate ( Node $ node ) { /* @var ClassMethod $node */ return new ClassMethod ( $ node -> name , [ 'flags' => ( $ node -> flags & ~ Class_ :: MODIFIER_PUBLIC ) | Class_ :: MODIFIER_PROTECTED , 'byRef' => $ node -> returnsByRef ( ) , 'params' => $ node -> getParams ( ) , 'returnType' => $ node -> getReturnType ( ) , 'stmts' => $ node -> getStmts ( ) , ] , $ node -> getAttributes ( ) ) ; }
Replaces "public function..." with "protected function ..."


@return ClassMethod
Replaces public function ... with protected function ...