Skip to content

Commit

Permalink
Adjusted mixin generator to comply with current coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jan 19, 2021
1 parent 4317d26 commit 349e997
Show file tree
Hide file tree
Showing 3 changed files with 374 additions and 189 deletions.
9 changes: 5 additions & 4 deletions bin/src/MixinGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private function trait(ReflectionClass $assert): string
*/
trait Mixin
{
%s
%s
}
PHP
,
Expand Down Expand Up @@ -336,11 +336,11 @@ private function staticMethod(string $name, array $parameters, array $defaultVal
$staticFunction .= $indentation.'public static function '.$name.$this->functionParameters($parameters, $defaultValues)."\n"
.$indentation."{\n"
.$indentation.$indentation.'static::__callStatic('
.'\'' . $name . '\', ['
.'\'' . $name . '\', array('
.implode(', ', \array_map(static function (string $parameter): string {
return '$'. $parameter;
}, $parameters))
."]);\n"
."));\n"
.$indentation.'}';

return $staticFunction;
Expand Down Expand Up @@ -394,7 +394,8 @@ private function phpdoc(array $lines, int $indent): string
$phpdoc .= "\n".$indentation.rtrim(' * '.$line);
}

$phpdoc .= "\n".$indentation.' * @return void'
$phpdoc .= "\n".$indentation.' *'
. "\n".$indentation.' * @return void'
. "\n".$indentation.' */';

return $phpdoc;
Expand Down
2 changes: 1 addition & 1 deletion src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function integerish($value, $message = '')
*/
public static function positiveInteger($value, $message = '')
{
if (! (\is_int($value) && $value > 0)) {
if (!(\is_int($value) && $value > 0)) {
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected a positive integer. Got: %s',
static::valueToString($value)
Expand Down
Loading

0 comments on commit 349e997

Please sign in to comment.