public function setPoints( $points )
    {
        if ( is_array($points) || $points instanceof \Traversable ) {
            array_walk(
                $points,
                function (&$point, $index) {
                    if ( !$point instanceof PointInterface ) {
                        if (is_array($point) && count($point) == 2) {
                            list($x, $y) = array_values($point);
                            $point = new Point($x, $y);
                        } else {
                            $msg = "Point at index #$index does not implement "
                                 . "PointReduction\\Common\\PointInterface";
                            throw new InvalidArgumentException($msg);
                        }
                    }
                }
            );
            $this->points = $points;
        } else {
            $msg = "All points must be a traversable object, or array. "
                 . gettype($points)
                 . " given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setPoints( $points )
    {
        if ( is_array($points) || $points instanceof \Traversable ) {
            array_walk(
                $points,
                function (&$point, $index) {
                    if ( !$point instanceof PointInterface ) {
                        if (is_array($point) && count($point) == 2) {
                            list($x, $y) = array_values($point);
                            $point = new Point($x, $y);
                        } else {
                            $msg = "Point at index #$index does not implement "
                                 . "PointReduction\\Common\\PointInterface";
                            throw new InvalidArgumentException($msg);
                        }
                    }
                }
            );
            $this->points = $points;
        } else {
            $msg = "All points must be a traversable object, or array. "
                 . gettype($points)
                 . " given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setPoints ( $ points ) { if ( is_array ( $ points ) || $ points instanceof \ Traversable ) { array_walk ( $ points , function ( & $ point , $ index ) { if ( ! $ point instanceof PointInterface ) { if ( is_array ( $ point ) && count ( $ point ) == 2 ) { list ( $ x , $ y ) = array_values ( $ point ) ; $ point = new Point ( $ x , $ y ) ; } else { $ msg = "Point at index #$index does not implement " . "PointReduction\\Common\\PointInterface" ; throw new InvalidArgumentException ( $ msg ) ; } } } ) ; $ this -> points = $ points ; } else { $ msg = "All points must be a traversable object, or array. " . gettype ( $ points ) . " given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set subject points

@param mixed $points Must be array or Traversable

@return null
@throws InvalidArgumentException
Set subject points