Skip to content

Commit

Permalink
ready for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
segy committed Jun 1, 2022
1 parent 0717301 commit 0ea3de6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Install the latest version using `composer require --dev rshop/php-cs-fixer-conf

## Usage

Create a configuration file *.php_cs* in the root of your project:
Create a configuration file *.php-cs-fixer.dist.php* in the root of your project:

```php
<?php
Expand Down
36 changes: 5 additions & 31 deletions src/Rshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@

class Rshop extends Config
{
/** @var string */
private $header;

/** @var bool */
private $strict = false;

/** @var array */
private $rules = [
'@Symfony' => true,
'array_indentation' => true,
'@PhpCsFixer' => true,
'array_syntax' => [
'syntax' => 'short'
],
Expand All @@ -29,26 +25,19 @@ class Rshop extends Config
'compact_nullable_typehint' => true,
'echo_tag_syntax' => false,
'explicit_indirect_variable' => true,
'hash_to_slash_comment' => false,
'is_null' => [
'use_yoda_style' => false
],
'logical_operators' => true,
'method_chaining_indentation' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => false,
'native_function_invocation' => ['include' => ['@all']],
'no_useless_return' => true,
'ordered_class_elements' => [
'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'method_public', 'method_protected', 'method_private', 'magic', 'phpunit']
'order' => ['use_trait', 'case', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'method_public', 'method_protected', 'method_private', 'magic', 'phpunit']
],
'ordered_imports' => [
'sortAlgorithm' => 'alpha'
],
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => false
],
'phpdoc_order' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last'
Expand All @@ -64,10 +53,7 @@ class Rshop extends Config
]
];

/**
* @param string $header
*/
public function __construct($header = null)
public function __construct(string $header = null)
{
$this->header = $header;

Expand All @@ -76,32 +62,20 @@ public function __construct($header = null)
$this->setRiskyAllowed(true);
}

/**
* @param string $rule
* @param mixed $value
*
* @return $this
*/
public function setRule(string $rule, $value)
{
$this->rules[$rule] = $value;

return $this;
}

/**
* @return $this
*/
public function setStrict()
{
$this->strict = true;

return $this;
}

/**
* @return array
*/
public function getRules()
{
$this->rules['declare_strict_types'] = $this->strict;
Expand All @@ -116,7 +90,7 @@ public function getRules()
'commentType' => 'PHPDoc',
'header' => $this->header,
'location' => 'after_open',
'separate' => 'bottom'
'separate' => 'none'
];
}

Expand Down

0 comments on commit 0ea3de6

Please sign in to comment.