protected function checkValueObjectRequirements($className)
    {
        $methods = get_class_methods($className);
        if (in_array('__construct', $methods, true) === false) {
            throw new InvalidValueObjectException('A value object must have a constructor, "' . $className . '" does not have one.', 1268740874);
        }

        $setterMethods = array_filter($methods, function ($method) {
            return strpos($method, 'set') === 0;
        });

        if ($setterMethods !== []) {
            throw new InvalidValueObjectException('A value object must not have setters, "' . $className . '" does.', 1268740878);
        }
    }
protected function checkValueObjectRequirements($className)
    {
        $methods = get_class_methods($className);
        if (in_array('__construct', $methods, true) === false) {
            throw new InvalidValueObjectException('A value object must have a constructor, "' . $className . '" does not have one.', 1268740874);
        }

        $setterMethods = array_filter($methods, function ($method) {
            return strpos($method, 'set') === 0;
        });

        if ($setterMethods !== []) {
            throw new InvalidValueObjectException('A value object must not have setters, "' . $className . '" does.', 1268740878);
        }
    }
protected function checkValueObjectRequirements ( $ className ) { $ methods = get_class_methods ( $ className ) ; if ( in_array ( '__construct' , $ methods , true ) === false ) { throw new InvalidValueObjectException ( 'A value object must have a constructor, "' . $ className . '" does not have one.' , 1268740874 ) ; } $ setterMethods = array_filter ( $ methods , function ( $ method ) { return strpos ( $ method , 'set' ) === 0 ; } ) ; if ( $ setterMethods !== [ ] ) { throw new InvalidValueObjectException ( 'A value object must not have setters, "' . $ className . '" does.' , 1268740878 ) ; } }
Checks if the given class meets the requirements for a value object, i.e.
does have a constructor and does not have any setter methods.

@param string $className
@return void
@throws InvalidValueObjectException
Checks if the given class meets the requirements for a value object i . e . does have a constructor and does not have any setter methods .