Skip to content

Commit

Permalink
update typehints for SPL + code style
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Jul 28, 2021
1 parent 4214fd6 commit 611b5e1
Show file tree
Hide file tree
Showing 17 changed files with 1,971 additions and 1,877 deletions.
32 changes: 16 additions & 16 deletions Ev/Ev.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@ final class EvIo extends EvWatcher
* @param int $priority
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $fd,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $events,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $callback,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $data = null,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $priority = 0
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0
) {}

/**
Expand All @@ -759,8 +759,8 @@ public function __construct(
* @param int $events Ev::READ and/or Ev::WRITE. See the bit masks.
*/
public function set(
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $fd,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $events
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events
) {}

/**
Expand Down Expand Up @@ -832,12 +832,12 @@ final class EvPeriodic extends EvWatcher
* @param int $priority
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'float'],default: '')] $offset,
#[LanguageLevelTypeAware(['8.0' => 'float'],default: '')] $interval,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $reschedule_cb,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $callback,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $data = null,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $priority = 0
#[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset,
#[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0
) {}

/**
Expand Down Expand Up @@ -889,9 +889,9 @@ final public static function createStopped(float $offset, float $interval, mixed
* @return void
*/
public function set(
#[LanguageLevelTypeAware(['8.0' => 'float'],default: '')] $offset,
#[LanguageLevelTypeAware(['8.0' => 'float'],default: '')] $interval,
#[LanguageLevelTypeAware(['8.0' => 'mixed'],default: '')] $reschedule_cb = null
#[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset,
#[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb = null
) {}
}

Expand Down
2 changes: 1 addition & 1 deletion PDO/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default:
* this way.
*/
public function quote(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $string,
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR
) {}

Expand Down
9 changes: 5 additions & 4 deletions Phar/Phar.php
Original file line number Diff line number Diff line change
Expand Up @@ -958,10 +958,11 @@ class PharData extends Phar
* </p>
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'string'],default: '')] $filename,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO,
#[LanguageLevelTypeAware(['8.0' => 'string|null'],default: '')] $alias = null,
#[LanguageLevelTypeAware(['8.0' => 'int'],default: '')] $format = Phar::TAR) {}
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO,
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = Phar::TAR
) {}

/**
* @param string $localName
Expand Down
5 changes: 4 additions & 1 deletion Reflection/ReflectionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ class ReflectionMethod extends ReflectionFunctionAbstract
* classname or an object.
* @throws \ReflectionException if the class or method does not exist.
*/
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'object|string'], default: '')] $objectOrMethod, $method = null) {}
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'object|string'], default: '')] $objectOrMethod,
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $method = null
) {}

/**
* Export a reflection method.
Expand Down
4 changes: 2 additions & 2 deletions Reflection/ReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class ReflectionProperty implements Reflector
* @throws \ReflectionException if the class or property does not exist.
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'object|string'] ,default: '')] $class,
#[LanguageLevelTypeAware(['8.0' => 'string'] ,default: '')] $property
#[LanguageLevelTypeAware(['8.0' => 'object|string'], default: '')] $class,
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $property
) {}

/**
Expand Down
2 changes: 1 addition & 1 deletion Reflection/ReflectionReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private function __construct() {}
*/
public static function fromArrayElement(
array $array,
#[LanguageLevelTypeAware(['8.0' => 'string|int'],default: '')] $key
#[LanguageLevelTypeAware(['8.0' => 'string|int'], default: '')] $key
) {}

/**
Expand Down
Loading

0 comments on commit 611b5e1

Please sign in to comment.