Skip to content

Enable array destructuring of Size::class with width & height #1480

@olivervogel

Description

@olivervogel

Describe the feature you'd like

Destructure a Size::class and be able to get width & height.

[$width, $height] = $image->size(); // (int) $width, (int) $height

Is your feature request related to a problem? Please describe.

Currently, a Size::class can be destructured, but you end up with individual points because the class is extended from Polygon::class. It would be better if only the width and height were destructured for this class like described above.

// width & height are both Intervention\Image\Geometry\Point first two points of the four rectangle points
[$width, $height] = $image->size(); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions