Intervention / Intervention/image

Standardized create() Methods

Open
#1,477 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

major-release
Dominant language
PHP
Stars
14.4k
Forks
1.5k
Avg merge
17h 51m
Merged PRs (30d)
11

Description

The create() method is typically a static constructor with the same parameters. Some classes deviate from this standard and also accept variable parameters. This should be standardized by ensuring that the create() method always reflects the constructor's parameters. Other parameters should be handled in dedicated static methods.

The following methods need change:

  • Intervention\Image\Format::create()
  • Intervention\Image\FileExtension::create()
  • Intervention\Image\MediaType::create()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the constructors and create() methods in Intervention\Image\Format, Intervention\Image\FileExtension, and Intervention\Image\MediaType. Compare each create() signature with its constructor and identify the variable parameters that need dedicated static methods. Done means all three create() methods consistently reflect their constructor parameters and alternate inputs have separate methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.