Skip to content

Commit

Permalink
Merge pull request #25 from Slamdunk/php_80_support_v2
Browse files Browse the repository at this point in the history
[v2] Support laminas-code:v4
  • Loading branch information
froschdesign authored Apr 16, 2021
2 parents e3a7e32 + ecb9587 commit e1fd685
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
},
"require": {
"php": "^7.3 || ~8.0.0",
"laminas/laminas-code": "^2.5 || ^3.0",
"laminas/laminas-stdlib": "^2.5 || ^3.0",
"laminas/laminas-zendframework-bridge": "^1.0"
"laminas/laminas-code": "^3.5.1 || ^4.0.0",
"laminas/laminas-stdlib": "^3.3.1",
"laminas/laminas-zendframework-bridge": "^1.2.0"
},
"require-dev": {
"laminas/laminas-coding-standard": "~1.0.0",
"phpunit/phpunit": "^9.3",
"psalm/plugin-phpunit": "^0.13.0",
"vimeo/psalm": "^4.2"
"phpunit/phpunit": "^9.5.4",
"psalm/plugin-phpunit": "^0.15.1",
"vimeo/psalm": "^4.6.4"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Method/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getClass()
*/
public function setFunction($function)
{
$this->function = is_callable($function) ? $function : (string) $function;
$this->function = $function;
$this->setType('function');
return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Method/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function setOptions(array $options)
*/
public function setName($name)
{
$this->name = (string) $name;
$this->name = $name;
return $this;
}

Expand Down Expand Up @@ -187,7 +187,7 @@ public function getPrototypes()
*/
public function setMethodHelp($methodHelp)
{
$this->methodHelp = (string) $methodHelp;
$this->methodHelp = $methodHelp;
return $this;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Method/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getDefaultValue()
/**
* Set description
*
* @param string $description
* @param mixed $description
* @return \Laminas\Server\Method\Parameter
*/
public function setDescription($description)
Expand All @@ -124,7 +124,7 @@ public function getDescription()
/**
* Set name
*
* @param string $name
* @param mixed $name
* @return \Laminas\Server\Method\Parameter
*/
public function setName($name)
Expand All @@ -146,7 +146,7 @@ public function getName()
/**
* Set optional flag
*
* @param bool $flag
* @param mixed $flag
* @return \Laminas\Server\Method\Parameter
*/
public function setOptional($flag)
Expand All @@ -168,7 +168,7 @@ public function isOptional()
/**
* Set parameter type
*
* @param string $type
* @param mixed $type
* @return \Laminas\Server\Method\Parameter
*/
public function setType($type)
Expand Down
2 changes: 1 addition & 1 deletion src/Method/Prototype.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function addParameter($parameter)
$this->parameterNameMap[$name] = count($this->parameters) - 1;
} else {
$parameter = new Parameter([
'type' => (string) $parameter,
'type' => $parameter,
]);
$this->parameters[] = $parameter;
}
Expand Down
10 changes: 7 additions & 3 deletions src/Reflection/AbstractFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,18 @@ abstract class AbstractFunction
*/
protected $docComment = '';

/**
* @var array
*/
/** @var array */
protected $return = [];

/** @var string */
protected $returnDesc;

protected $paramDesc;

/** @var array */
protected $sigParams;

/** @var int */
protected $sigParamsDepth;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/ReflectionParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function setDescription($description)
*/
public function setPosition($index)
{
$this->position = (int) $index;
$this->position = $index;
}

/**
Expand Down

0 comments on commit e1fd685

Please sign in to comment.