Skip to content

Commit

Permalink
Upgrade php-cs config
Browse files Browse the repository at this point in the history
Includes updated phpdoc comments due to new config.
  • Loading branch information
DerManoMann committed May 6, 2021
1 parent 983d9c0 commit d112331
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
build/
vendor/
.buildpath
.php_cs
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
.project
composer.lock
18 changes: 10 additions & 8 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

$finder = PhpCsFixer\Finder::create()
->path('src')->name('*.php')
->path('tests')->name('*.php')
->in(__DIR__)
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
Expand All @@ -15,18 +17,16 @@
'function_typehint_space' => true,
'lowercase_cast' => true,
'magic_constant_casing' => true,
'method_separation' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'single_blank_line_before_namespace' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'single_quote' => true,
'method_separation' => true,
'no_blank_lines_after_phpdoc' => true,
'no_extra_consecutive_blank_lines' => true,
'no_extra_blank_lines' => true,
'return_type_declaration' => ['space_before' => 'none'],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
Expand All @@ -35,14 +35,16 @@
'short_scalar_cast' => true,
'space_after_semicolon' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,

'no_empty_phpdoc' => true,
// 7.3 only 'no_superfluous_phpdoc_tags' => true,
'phpdoc_align' => true,
'phpdoc_inline_tag' => true,
'general_phpdoc_tag_rename' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_tag_type' => true,
'phpdoc_indent' => true,
'phpdoc_var_without_name' => true,
'phpdoc_types' => true,
Expand All @@ -57,4 +59,4 @@
'phpdoc_no_alias_tag' => true,
])
->setFinder($finder)
;
;
8 changes: 4 additions & 4 deletions src/Extractor/DocBlockMagicExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(?DocBlockCache $dockBlockCache = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getProperties($class, array $context = [])
{
Expand Down Expand Up @@ -70,7 +70,7 @@ public function getProperties($class, array $context = [])
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getTypes($class, $property, array $context = [])
{
Expand Down Expand Up @@ -150,15 +150,15 @@ protected function hasPrefixMethod($class, $property, array $prefixes, array $co
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isReadable($class, $property, array $context = [])
{
return $this->hasPrefixMethod($class, $property, $this->dockBlockCache->getAccessorPrefixes(), $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isWritable($class, $property, array $context = [])
{
Expand Down
8 changes: 4 additions & 4 deletions src/PropertyInfoExtraExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(iterable $listExtractors = [], iterable $typeExtract
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAllProperties($class, array $context = [])
{
Expand All @@ -68,7 +68,7 @@ public function getAllProperties($class, array $context = [])
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAllTypes($class, $property, array $context = [])
{
Expand Down Expand Up @@ -125,7 +125,7 @@ protected function refine(Type $current, Type $next, string $method)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isAllReadable($class, $property, array $context = [])
{
Expand All @@ -141,7 +141,7 @@ public function isAllReadable($class, $property, array $context = [])
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isAllWritable($class, $property, array $context = [])
{
Expand Down
22 changes: 11 additions & 11 deletions src/PropertyInfoExtraExtractorAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,87 +20,87 @@ public function __construct(PropertyInfoExtractor $adaptee)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAllProperties($class, array $context = [])
{
return $this->getProperties($class, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAllTypes($class, $property, array $context = [])
{
return $this->getTypes($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isAllReadable($class, $property, array $context = [])
{
return $this->isReadable($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isAllWritable($class, $property, array $context = [])
{
return $this->isWritable($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isReadable($class, $property, array $context = [])
{
return $this->adaptee->isReadable($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isWritable($class, $property, array $context = [])
{
return $this->adaptee->isWritable($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getShortDescription($class, $property, array $context = [])
{
return $this->adaptee->getShortDescription($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getLongDescription($class, $property, array $context = [])
{
return $this->adaptee->getLongDescription($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isInitializable(string $class, string $property, array $context = []): ?bool
{
return $this->adaptee->isInitializable($class, $property, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getProperties($class, array $context = [])
{
return $this->adaptee->getProperties($class, $context);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getTypes($class, $property, array $context = [])
{
Expand Down
28 changes: 14 additions & 14 deletions tests/Models/MagicPopo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
namespace Radebatz\PropertyInfoExtras\Tests\Models;

/**
* @method string getProString()
* @method void setProString(?string $proString)
* @method string getPriString()
* @method void setPriString(?string $priString)
* @method int getProInt()
* @method void setProInt(int $proInt)
* @method bool getProBool()
* @method void setProBool(bool $proBool)
* @method SimplePopo getSimplePopo()
* @method void setSimplePopo(SimplePopo $simplePopo)
* @method int[] getProIntArr()
* @method void setProIntArr(integer[] $proIntArr)
* @method string getProString()
* @method void setProString(?string $proString)
* @method string getPriString()
* @method void setPriString(?string $priString)
* @method int getProInt()
* @method void setProInt(int $proInt)
* @method bool getProBool()
* @method void setProBool(bool $proBool)
* @method SimplePopo getSimplePopo()
* @method void setSimplePopo(SimplePopo $simplePopo)
* @method int[] getProIntArr()
* @method void setProIntArr(integer[] $proIntArr)
* @method SimplePopo[] getSimplePopoArr()
* @method void setSimplePopoArr(SimplePopo[] $simplePopoArr)
* @method void setSimplePopoArr(SimplePopo[] $simplePopoArr)
*/
class MagicPopo implements \JsonSerializable
{
Expand Down Expand Up @@ -55,7 +55,7 @@ public function __call($method, $args)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function jsonSerialize()
{
Expand Down

0 comments on commit d112331

Please sign in to comment.