private function getMutatorMethods(\ReflectionClass $reflectionClass, $property, $propertyType)
    {
        $camelCaseName = ucfirst(Caser::camel($property));
        $setterName = 'set'.$camelCaseName;
        if (!$reflectionClass->hasMethod($setterName)) {
            $message = sprintf(
                'Missing %s() method in %s class. Add it, or change property to public.',
                $setterName,
                $reflectionClass->getName()
            );
            throw new \LogicException($message);
        }

        if ($reflectionClass->hasMethod('get'.$camelCaseName)) {
            return [
                'getter' => 'get' . $camelCaseName,
                'setter' => $setterName
            ];
        }

        if ($propertyType === 'boolean') {
            if ($reflectionClass->hasMethod('is' . $camelCaseName)) {
                return [
                    'getter' => 'is' . $camelCaseName,
                    'setter' => $setterName
                ];
            }

            $message = sprintf(
                'Missing %s() or %s() method in %s class. Add it, or change property to public.',
                'get'.$camelCaseName,
                'is'.$camelCaseName,
                $reflectionClass->getName()
            );
            throw new \LogicException($message);
        }

        $message = sprintf(
            'Missing %s() method in %s class. Add it, or change property to public.',
            'get'.$camelCaseName,
            $reflectionClass->getName()
        );
        throw new \LogicException($message);
    }
private function getMutatorMethods(\ReflectionClass $reflectionClass, $property, $propertyType)
    {
        $camelCaseName = ucfirst(Caser::camel($property));
        $setterName = 'set'.$camelCaseName;
        if (!$reflectionClass->hasMethod($setterName)) {
            $message = sprintf(
                'Missing %s() method in %s class. Add it, or change property to public.',
                $setterName,
                $reflectionClass->getName()
            );
            throw new \LogicException($message);
        }

        if ($reflectionClass->hasMethod('get'.$camelCaseName)) {
            return [
                'getter' => 'get' . $camelCaseName,
                'setter' => $setterName
            ];
        }

        if ($propertyType === 'boolean') {
            if ($reflectionClass->hasMethod('is' . $camelCaseName)) {
                return [
                    'getter' => 'is' . $camelCaseName,
                    'setter' => $setterName
                ];
            }

            $message = sprintf(
                'Missing %s() or %s() method in %s class. Add it, or change property to public.',
                'get'.$camelCaseName,
                'is'.$camelCaseName,
                $reflectionClass->getName()
            );
            throw new \LogicException($message);
        }

        $message = sprintf(
            'Missing %s() method in %s class. Add it, or change property to public.',
            'get'.$camelCaseName,
            $reflectionClass->getName()
        );
        throw new \LogicException($message);
    }
private function getMutatorMethods ( \ ReflectionClass $ reflectionClass , $ property , $ propertyType ) { $ camelCaseName = ucfirst ( Caser :: camel ( $ property ) ) ; $ setterName = 'set' . $ camelCaseName ; if ( ! $ reflectionClass -> hasMethod ( $ setterName ) ) { $ message = sprintf ( 'Missing %s() method in %s class. Add it, or change property to public.' , $ setterName , $ reflectionClass -> getName ( ) ) ; throw new \ LogicException ( $ message ) ; } if ( $ reflectionClass -> hasMethod ( 'get' . $ camelCaseName ) ) { return [ 'getter' => 'get' . $ camelCaseName , 'setter' => $ setterName ] ; } if ( $ propertyType === 'boolean' ) { if ( $ reflectionClass -> hasMethod ( 'is' . $ camelCaseName ) ) { return [ 'getter' => 'is' . $ camelCaseName , 'setter' => $ setterName ] ; } $ message = sprintf ( 'Missing %s() or %s() method in %s class. Add it, or change property to public.' , 'get' . $ camelCaseName , 'is' . $ camelCaseName , $ reflectionClass -> getName ( ) ) ; throw new \ LogicException ( $ message ) ; } $ message = sprintf ( 'Missing %s() method in %s class. Add it, or change property to public.' , 'get' . $ camelCaseName , $ reflectionClass -> getName ( ) ) ; throw new \ LogicException ( $ message ) ; }
Checks if class have setter and getter, and returns them in array.

@param \ReflectionClass $reflectionClass
@param string           $property

@return array
Checks if class have setter and getter and returns them in array .