// Code generated by counterfeiter. DO NOT EDIT.
package parsleyfakes

import (
	"sync"

	"github.com/conflowio/parsley/parsley"
)

type FakeStaticChecker struct {
	StaticCheckStub        func(interface{}, parsley.NonTerminalNode) (interface{}, parsley.Error)
	staticCheckMutex       sync.RWMutex
	staticCheckArgsForCall []struct {
		arg1 interface{}
		arg2 parsley.NonTerminalNode
	}
	staticCheckReturns struct {
		result1 interface{}
		result2 parsley.Error
	}
	staticCheckReturnsOnCall map[int]struct {
		result1 interface{}
		result2 parsley.Error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStaticChecker) StaticCheck(arg1 interface{}, arg2 parsley.NonTerminalNode) (interface{}, parsley.Error) {
	fake.staticCheckMutex.Lock()
	ret, specificReturn := fake.staticCheckReturnsOnCall[len(fake.staticCheckArgsForCall)]
	fake.staticCheckArgsForCall = append(fake.staticCheckArgsForCall, struct {
		arg1 interface{}
		arg2 parsley.NonTerminalNode
	}{arg1, arg2})
	stub := fake.StaticCheckStub
	fakeReturns := fake.staticCheckReturns
	fake.recordInvocation("StaticCheck", []interface{}{arg1, arg2})
	fake.staticCheckMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeStaticChecker) StaticCheckCallCount() int {
	fake.staticCheckMutex.RLock()
	defer fake.staticCheckMutex.RUnlock()
	return len(fake.staticCheckArgsForCall)
}

func (fake *FakeStaticChecker) StaticCheckCalls(stub func(interface{}, parsley.NonTerminalNode) (interface{}, parsley.Error)) {
	fake.staticCheckMutex.Lock()
	defer fake.staticCheckMutex.Unlock()
	fake.StaticCheckStub = stub
}

func (fake *FakeStaticChecker) StaticCheckArgsForCall(i int) (interface{}, parsley.NonTerminalNode) {
	fake.staticCheckMutex.RLock()
	defer fake.staticCheckMutex.RUnlock()
	argsForCall := fake.staticCheckArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeStaticChecker) StaticCheckReturns(result1 interface{}, result2 parsley.Error) {
	fake.staticCheckMutex.Lock()
	defer fake.staticCheckMutex.Unlock()
	fake.StaticCheckStub = nil
	fake.staticCheckReturns = struct {
		result1 interface{}
		result2 parsley.Error
	}{result1, result2}
}

func (fake *FakeStaticChecker) StaticCheckReturnsOnCall(i int, result1 interface{}, result2 parsley.Error) {
	fake.staticCheckMutex.Lock()
	defer fake.staticCheckMutex.Unlock()
	fake.StaticCheckStub = nil
	if fake.staticCheckReturnsOnCall == nil {
		fake.staticCheckReturnsOnCall = make(map[int]struct {
			result1 interface{}
			result2 parsley.Error
		})
	}
	fake.staticCheckReturnsOnCall[i] = struct {
		result1 interface{}
		result2 parsley.Error
	}{result1, result2}
}

func (fake *FakeStaticChecker) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.staticCheckMutex.RLock()
	defer fake.staticCheckMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeStaticChecker) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ parsley.StaticChecker = new(FakeStaticChecker)
