src/Kunstmaan/FixturesBundle/Populator/Methods/ArrayAdd.php
private function findAdderMethod($object, $property)
    {
        if (is_callable([$object, $method = 'add' . $property])) {
            return $method;
        }
        if (class_exists('Symfony\Component\PropertyAccess\StringUtil') && method_exists('Symfony\Component\PropertyAccess\StringUtil', 'singularify')) {
            foreach ((array) Inflector::singularize($property) as $singularForm) {
                if (is_callable([$object, $method = 'add' . $singularForm])) {
                    return $method;
                }
            }
        }
        if (is_callable([$object, $method = 'add' . rtrim($property, 's')])) {
            return $method;
        }
        if (substr($property, -3) === 'ies' && is_callable([$object, $method = 'add' . substr($property, 0, -3) . 'y'])) {
            return $method;
        }

        return null;
    }
private function findAdderMethod($object, $property)
    {
        if (is_callable([$object, $method = 'add' . $property])) {
            return $method;
        }
        if (class_exists('Symfony\Component\PropertyAccess\StringUtil') && method_exists('Symfony\Component\PropertyAccess\StringUtil', 'singularify')) {
            foreach ((array) Inflector::singularize($property) as $singularForm) {
                if (is_callable([$object, $method = 'add' . $singularForm])) {
                    return $method;
                }
            }
        }
        if (is_callable([$object, $method = 'add' . rtrim($property, 's')])) {
            return $method;
        }
        if (substr($property, -3) === 'ies' && is_callable([$object, $method = 'add' . substr($property, 0, -3) . 'y'])) {
            return $method;
        }

        return null;
    }
private function findAdderMethod ( $ object , $ property ) { if ( is_callable ( [ $ object , $ method = 'add' . $ property ] ) ) { return $ method ; } if ( class_exists ( 'Symfony\Component\PropertyAccess\StringUtil' ) && method_exists ( 'Symfony\Component\PropertyAccess\StringUtil' , 'singularify' ) ) { foreach ( ( array ) Inflector :: singularize ( $ property ) as $ singularForm ) { if ( is_callable ( [ $ object , $ method = 'add' . $ singularForm ] ) ) { return $ method ; } } } if ( is_callable ( [ $ object , $ method = 'add' . rtrim ( $ property , 's' ) ] ) ) { return $ method ; } if ( substr ( $ property , - 3 ) === 'ies' && is_callable ( [ $ object , $ method = 'add' . substr ( $ property , 0 , - 3 ) . 'y' ] ) ) { return $ method ; } return null ; }
finds the method used to append values to the named property

@param mixed  $object
@param string $property

@return string|null
finds the method used to append values to the named property