symplify/coding-standard

PHP7 Sniffs

TomasVotruba opened this issue · 1 comments

Use return type when possible

/**
 * @return int
 */
public function getValue()
{
}

=>

public function getValue() : int
{
}

Use args type when possible

Same for args:

/**
 * @param int $amount
 */
public function count($amount)
{
}

=>

public function count(int $amount)
{
}

Unite return type format

// Class
public function getValue() : int

// Interface
public function getValue() : int;

Use strict_value when needed

When somewhere is some arg/return type, make this required.

<?php 

declare (strict_types = 1);