Skip to content

Commit

Permalink
Fix command
Browse files Browse the repository at this point in the history
  • Loading branch information
famoser committed Oct 5, 2021
1 parent fd62f28 commit 6a67761
Show file tree
Hide file tree
Showing 33 changed files with 95 additions and 114 deletions.
37 changes: 9 additions & 28 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,14 @@
COMMENT;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('config')
->exclude('var')
->exclude('public/bundles')
->exclude('public/build')
->in('src')
->in('tests')
;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
])
->setFinder($finder);
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"./vendor/bin/php-cs-fixer fix --config=.php_cs",
"./vendor/bin/php-cs-fixer fix",
"git update-index --again"
],
"post-merge": "composer install"
Expand Down
4 changes: 2 additions & 2 deletions src/Command/TransferDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/
class TransferDataCommand extends Command
{
const CURRENT = 1;
const OLD = 2;
public const CURRENT = 1;
public const OLD = 2;

private $dbPath;
private $dbPath2;
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/LoadClinic.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class LoadClinic extends BaseFixture
{
const ORDER = LoadDoctor::ORDER + 1;
public const ORDER = LoadDoctor::ORDER + 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/LoadDoctor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class LoadDoctor extends BaseFixture
{
const ORDER = 1;
public const ORDER = 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/LoadEventOffers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class LoadEventOffers extends BaseFixture
{
const ORDER = LoadClinic::ORDER + LoadDoctor::ORDER + LoadGeneration::ORDER + 1;
public const ORDER = LoadClinic::ORDER + LoadDoctor::ORDER + LoadGeneration::ORDER + 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/LoadGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class LoadGeneration extends BaseFixture
{
const ORDER = LoadSetting::ORDER + LoadClinic::ORDER + LoadDoctor::ORDER + LoadEventTag::ORDER + 1;
public const ORDER = LoadSetting::ORDER + LoadClinic::ORDER + LoadDoctor::ORDER + LoadEventTag::ORDER + 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/LoadSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class LoadSetting extends BaseFixture
{
const ORDER = 1;
public const ORDER = 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/Production/LoadAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class LoadAdmin extends LoadDoctor
{
const ORDER = 1;
public const ORDER = 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
2 changes: 1 addition & 1 deletion src/DataFixtures/Production/LoadEventTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class LoadEventTag extends BaseFixture
{
const ORDER = 1;
public const ORDER = 1;

/**
* Load data fixtures with the passed EntityManager.
Expand Down
14 changes: 7 additions & 7 deletions src/Entity/EventOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ public function acknowledge(Doctor $doctor)
return $this->changeStatus($doctor, [AuthorizationStatus::PENDING, AuthorizationStatus::ACCEPTED, AuthorizationStatus::DECLINED, AuthorizationStatus::WITHDRAWN], AuthorizationStatus::ACKNOWLEDGED);
}

const ACCEPT_DECLINE = 1;
const ACK_ACCEPTED = 2;
const ACK_DECLINED = 3;
const WITHDRAW = 4;
const ACK_WITHDRAWN = 5;
const ACK_INVALID = 6;
const NONE = 7;
public const ACCEPT_DECLINE = 1;
public const ACK_ACCEPTED = 2;
public const ACK_DECLINED = 3;
public const WITHDRAW = 4;
public const ACK_WITHDRAWN = 5;
public const ACK_INVALID = 6;
public const NONE = 7;

public function getPendingAction(Doctor $doctor)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Enum/AuthorizationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

class AuthorizationStatus extends BaseEnum
{
const PENDING = 0;
const ACCEPTED = 1;
const DECLINED = 2;
const ACKNOWLEDGED = 3;
const WITHDRAWN = 4;
public const PENDING = 0;
public const ACCEPTED = 1;
public const DECLINED = 2;
public const ACKNOWLEDGED = 3;
public const WITHDRAWN = 4;
}
4 changes: 2 additions & 2 deletions src/Enum/BooleanType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

class BooleanType extends BaseEnum
{
const YES = 1;
const NO = 2;
public const YES = 1;
public const NO = 2;
}
6 changes: 3 additions & 3 deletions src/Enum/EmailType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class EmailType extends BaseEnum
{
const TEXT_EMAIL = 1;
const PLAIN_EMAIL = 2;
const ACTION_EMAIL = 3;
public const TEXT_EMAIL = 1;
public const PLAIN_EMAIL = 2;
public const ACTION_EMAIL = 3;
}
14 changes: 7 additions & 7 deletions src/Enum/EventChangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

class EventChangeType extends BaseEnum
{
const CREATED = 1;
const GENERATED = 2;
const CHANGED = 3;
const REMOVED = 4;
const TRADED_TO_NEW_OWNER = 7;
const DOCTOR_ASSIGNED = 8;
const CONFIRMED = 9;
public const CREATED = 1;
public const GENERATED = 2;
public const CHANGED = 3;
public const REMOVED = 4;
public const TRADED_TO_NEW_OWNER = 7;
public const DOCTOR_ASSIGNED = 8;
public const CONFIRMED = 9;
}
8 changes: 4 additions & 4 deletions src/Enum/EventTagColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class EventTagColor extends BaseEnum
{
const RED = 1;
const YELLOW = 2;
const BLUE = 3;
const GREEN = 4;
public const RED = 1;
public const YELLOW = 2;
public const BLUE = 3;
public const GREEN = 4;
}
6 changes: 3 additions & 3 deletions src/Enum/EventTagType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class EventTagType extends BaseEnum
{
const CUSTOM = 0;
const BACKUP_SERVICE = 1;
const ACTIVE_SERVICE = 2;
public const CUSTOM = 0;
public const BACKUP_SERVICE = 1;
public const ACTIVE_SERVICE = 2;
}
10 changes: 5 additions & 5 deletions src/Enum/EventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

class EventType extends BaseEnum
{
const UNSPECIFIED = 0;
const WEEKDAY = 1;
const SATURDAY = 2;
const SUNDAY = 3;
const HOLIDAY = 4;
public const UNSPECIFIED = 0;
public const WEEKDAY = 1;
public const SATURDAY = 2;
public const SUNDAY = 3;
public const HOLIDAY = 4;
}
16 changes: 8 additions & 8 deletions src/Enum/GenerationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

class GenerationStatus extends BaseEnum
{
const STARTED = 0;
const SUCCESSFUL = 1;
const NO_MATCHING_TARGET = 2;
const NO_ALLOWED_TARGET_FOR_EVENT = 3;
const TIMEOUT = 4;
const PREDETERMINED_EVENT_CANT_BE_ASSIGNED = 5;
const NO_TARGET_CAN_ASSUME_RESPONSIBILITY = 6;
const UNKNOWN_ERROR = 10;
public const STARTED = 0;
public const SUCCESSFUL = 1;
public const NO_MATCHING_TARGET = 2;
public const NO_ALLOWED_TARGET_FOR_EVENT = 3;
public const TIMEOUT = 4;
public const PREDETERMINED_EVENT_CANT_BE_ASSIGNED = 5;
public const NO_TARGET_CAN_ASSUME_RESPONSIBILITY = 6;
public const UNKNOWN_ERROR = 10;
}
6 changes: 3 additions & 3 deletions src/Enum/GenerationStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class GenerationStep extends BaseEnum
{
const SET_START_END = 0;
const CHOOSE_TARGETS = 1;
const PREVIEW = 2;
public const SET_START_END = 0;
public const CHOOSE_TARGETS = 1;
public const PREVIEW = 2;
}
8 changes: 4 additions & 4 deletions src/Enum/MessageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class MessageType extends BaseEnum
{
const INFO = 0;
const WARNING = 1;
const ERROR = 2;
const FATAL = 3;
public const INFO = 0;
public const WARNING = 1;
public const ERROR = 2;
public const FATAL = 3;
}
4 changes: 2 additions & 2 deletions src/Enum/OfferStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

class OfferStatus extends BaseEnum
{
const OPEN = 1;
const CLOSED = 4;
public const OPEN = 1;
public const CLOSED = 4;
}
8 changes: 4 additions & 4 deletions src/Enum/TradeTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class TradeTag extends BaseEnum
{
const NO_TRADE = 1;
const MAYBE_TRADE = 2;
const WANT_TRADE = 3;
const MUST_TRADE = 4;
public const NO_TRADE = 1;
public const MAYBE_TRADE = 2;
public const WANT_TRADE = 3;
public const MUST_TRADE = 4;
}
2 changes: 1 addition & 1 deletion src/EventGeneration/EventTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class EventTarget
{
const NONE_IDENTIFIER = 0;
public const NONE_IDENTIFIER = 0;
private static $nextIdentifier = 1;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Model/ContactRequest/ContactRequestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

class ContactRequestType extends BaseAbstractType
{
const CHECK_DATA = null;
const CHECK2_DATA = 'some string';
public const CHECK_DATA = null;
public const CHECK2_DATA = 'some string';

public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/CsvFileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

class CsvFileHelper
{
const DELIMITER = ',';
public const DELIMITER = ',';
}
4 changes: 2 additions & 2 deletions src/Helper/DateTimeFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

class DateTimeFormatter
{
const DATE_TIME_FORMAT = 'd.m.Y H:i';
const DATE_FORMAT = 'd.m.Y';
public const DATE_TIME_FORMAT = 'd.m.Y H:i';
public const DATE_FORMAT = 'd.m.Y';
}
2 changes: 1 addition & 1 deletion src/Helper/SessionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

class SessionHelper
{
const ACTIVE_CLINIC_ID = 'active_clinic_id';
public const ACTIVE_CLINIC_ID = 'active_clinic_id';
}
10 changes: 5 additions & 5 deletions src/Helper/StaticMessageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

class StaticMessageHelper
{
const FLASH_ERROR = 'error';
const FLASH_SUCCESS = 'success';
const FLASH_INFO = 'info';
const FLASH_DANGER = 'danger';
public const FLASH_ERROR = 'error';
public const FLASH_SUCCESS = 'success';
public const FLASH_INFO = 'info';
public const FLASH_DANGER = 'danger';

const FORM_SUBMIT_BUTTON_TYPE_OPTION = 'submit_button_type_option';
public const FORM_SUBMIT_BUTTON_TYPE_OPTION = 'submit_button_type_option';
}
2 changes: 1 addition & 1 deletion src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Kernel extends BaseKernel
{
use MicroKernelTrait;

const CONFIG_EXTS = '.{php,xml,yaml,yml}';
public const CONFIG_EXTS = '.{php,xml,yaml,yml}';

public function getCacheDir()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Model/Event/SearchModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

class SearchModel
{
const NONE = 0;
const MONTH = 1;
const YEAR = 2;
public const NONE = 0;
public const MONTH = 1;
public const YEAR = 2;

/**
* @var \DateTime
Expand Down
4 changes: 2 additions & 2 deletions src/Security/Voter/Base/BaseVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

abstract class BaseVoter extends Voter
{
const MODIFY = 1;
const VIEW = 2;
public const MODIFY = 1;
public const VIEW = 2;

/**
* @param string $attribute
Expand Down
Loading

0 comments on commit 6a67761

Please sign in to comment.