Skip to content
This repository was archived by the owner on Apr 15, 2020. It is now read-only.

CodelyTV/phpstorm-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages