Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.md

Codely.tv PhpStorm Settings

PhpStorm or IntelliJ settings following the Codely.tv conventions.

Code and File Templates

Example

Class attributes example:

    /** @var Email */
    private $email;

    /** @var string */
    private $password;

    /** @var \DateTimeImmutable */
    private $birth_day;

    /** @var boolean */
    private $is_active;

    /** @var array */
    private $all_friends;

Generated constructor:

  • "a" / "an" prefix for simple variables
  • "some" -> "all" convention for arrays or Collections
  • Type hinting (already supported by PhpStorm by default)
    public function __construct(
        Email $an_email,
        $a_password,
        \DateTimeImmutable $a_birth_day,
        $is_active,
        array $some_friends
    )
    {
        $this->email       = $an_email;
        $this->password    = $a_password;
        $this->birth_day   = $a_birth_day;
        $this->is_active   = $is_active;
        $this->all_friends = $some_friends;
    }

Generated getter:

  • No "get" prefix
    /**
     * @return Email
     */
    public function email()
    {
        return $this->email;
    }

Generated setter:

  • "a" / "an" prefix for simple variables
  • "some" -> "all" convention for arrays or Collections
  • Type hinting (not supported by PhpStorm by default)
    /**
     * @param Email $an_email
     */
    public function setEmail(Email $an_email)
    {
        $this->email = $an_email;
    }

About

Code and File Templates for PhpStorm following the PHP ecosystem conventions

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.