mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
Implement PHP CS Fixer and a coding standard to follow (#471)
* Create PHP CS Fixer config and add to CI workflow * Run php cs fixer on project * Add newline at end of file * Update to use PHP CS Fixer v3 * Run v3 config on project * Run seperate config in CI
This commit is contained in:
@ -2,12 +2,12 @@
|
||||
|
||||
namespace Crater\Rules;
|
||||
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
class RelationNotExist implements Rule
|
||||
{
|
||||
public $class;
|
||||
|
||||
public $relation;
|
||||
|
||||
/**
|
||||
|
||||
@ -7,6 +7,7 @@ use Illuminate\Contracts\Validation\Rule;
|
||||
class UniqueNumber implements Rule
|
||||
{
|
||||
public $id;
|
||||
|
||||
public $class;
|
||||
|
||||
/**
|
||||
@ -31,7 +32,7 @@ class UniqueNumber implements Rule
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
if ($value && count(explode("-", $value)) > 2) {
|
||||
$number = explode("-",$value);
|
||||
$number = explode("-", $value);
|
||||
$uniqueNumber = $number[0].'-'.sprintf('%06d', intval($number[1]));
|
||||
} else {
|
||||
$uniqueNumber = $value;
|
||||
|
||||
Reference in New Issue
Block a user