public function applyTransformation(TransformationInterface $transform)
    {
        // array_values for re-indexing
        $this->tokens = array_values(
            array_filter(
                array_map(
                    array($transform, 'transform'),
                    $this->tokens
                ),
                function ($token) {
                    return $token!==null;
                }
            )
        );
    }
public function applyTransformation(TransformationInterface $transform)
    {
        // array_values for re-indexing
        $this->tokens = array_values(
            array_filter(
                array_map(
                    array($transform, 'transform'),
                    $this->tokens
                ),
                function ($token) {
                    return $token!==null;
                }
            )
        );
    }
public function applyTransformation ( TransformationInterface $ transform ) { // array_values for re-indexing $ this -> tokens = array_values ( array_filter ( array_map ( array ( $ transform , 'transform' ) , $ this -> tokens ) , function ( $ token ) { return $ token !== null ; } ) ) ; }
Apply the transform to each token. Filter out the null tokens.

@param TransformationInterface $transform The transformation to be applied
Apply the transform to each token . Filter out the null tokens .