Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Elements\Interactive withWidth - incorrect param types? #123

Closed
memarv opened this issue Jun 9, 2016 · 1 comment
Closed

Elements\Interactive withWidth - incorrect param types? #123

memarv opened this issue Jun 9, 2016 · 1 comment

Comments

@memarv
Copy link

memarv commented Jun 9, 2016

Method withWidth has enforceWithin [Interactive::NO_MARGIN, Interactive::COLUMN_WIDTH]
whether it should be Type::enforce($width, Type::INTEGER);
?

@everton-rosario
Copy link
Contributor

Hey @memarv, thanks for using Instant Articles.

Are you using the element class Interactive?

We have 2 methods:

    /**
     * Sets the width of your interactive graphic.
     *
     * @param int $width The height of your interactive graphic.
     *
     * @return $this
     */
    public function withWidth($width)
    {
        Type::enforce($width, Type::INTEGER);
        $this->width = $width;

        return $this;
    }

and

/**
     * Sets the margin setting of your interactive graphic.
     *
     * @param string $margin The margin setting of your interactive graphic.
     *
     * @see Interactive::NO_MARGIN
     * @see Interactive::COLUMN_WIDTH
     *
     * @return $this
     */
    public function withMargin($margin)
    {
        Type::enforceWithin(
            $margin,
            [
                Interactive::NO_MARGIN,
                Interactive::COLUMN_WIDTH
            ]
        );
        $this->margin = $margin;

        return $this;
    }

The withMargin method, must be compliant with the NO_MARGIN and COLUMN_WIDTH.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants