Skip to content

Commit

Permalink
Fix PHPDoc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi authored and Frederic Delaunay committed Oct 29, 2018
1 parent ac1489e commit b9b29cc
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 178 deletions.
21 changes: 7 additions & 14 deletions src/PhpSpreadsheet/Calculation/Financial.php
Original file line number Diff line number Diff line change
Expand Up @@ -2018,12 +2018,9 @@ public static function RECEIVED($settlement, $maturity, $investment, $discount,
*
* Returns the straight-line depreciation of an asset for one period
*
* @param cost Initial cost of the asset
* @param salvage Value at the end of the depreciation
* @param life Number of periods over which the asset is depreciated
* @param mixed $cost
* @param mixed $salvage
* @param mixed $life
* @param mixed $cost Initial cost of the asset
* @param mixed $salvage Value at the end of the depreciation
* @param mixed $life Number of periods over which the asset is depreciated
*
* @return float
*/
Expand All @@ -2050,14 +2047,10 @@ public static function SLN($cost, $salvage, $life)
*
* Returns the sum-of-years' digits depreciation of an asset for a specified period.
*
* @param cost Initial cost of the asset
* @param salvage Value at the end of the depreciation
* @param life Number of periods over which the asset is depreciated
* @param period Period
* @param mixed $cost
* @param mixed $salvage
* @param mixed $life
* @param mixed $period
* @param mixed $cost Initial cost of the asset
* @param mixed $salvage Value at the end of the depreciation
* @param mixed $life Number of periods over which the asset is depreciated
* @param mixed $period Period
*
* @return float
*/
Expand Down
6 changes: 2 additions & 4 deletions src/PhpSpreadsheet/Calculation/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,7 @@ public static function isNonText($value = null)
*
* Returns a value converted to a number
*
* @param value The value you want converted
* @param null|mixed $value
* @param null|mixed $value The value you want converted
*
* @return number N converts values listed in the following table
* If value is or refers to N returns
Expand Down Expand Up @@ -515,8 +514,7 @@ public static function n($value = null)
*
* Returns a number that identifies the type of a value
*
* @param value The value you want tested
* @param null|mixed $value
* @param null|mixed $value The value you want tested
*
* @return number N converts values listed in the following table
* If value is or refers to N returns
Expand Down
93 changes: 33 additions & 60 deletions src/PhpSpreadsheet/Calculation/LookupRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@ class LookupRef
* Excel Function:
* =ADDRESS(row, column, [relativity], [referenceStyle], [sheetText])
*
* @param row Row number to use in the cell reference
* @param column Column number to use in the cell reference
* @param relativity Flag indicating the type of reference to return
* @param mixed $row Row number to use in the cell reference
* @param mixed $column Column number to use in the cell reference
* @param int $relativity Flag indicating the type of reference to return
* 1 or omitted Absolute
* 2 Absolute row; relative column
* 3 Relative row; absolute column
* 4 Relative
* @param referenceStyle A logical value that specifies the A1 or R1C1 reference style.
* @param bool $referenceStyle A logical value that specifies the A1 or R1C1 reference style.
* TRUE or omitted CELL_ADDRESS returns an A1-style reference
* FALSE CELL_ADDRESS returns an R1C1-style reference
* @param sheetText Optional Name of worksheet to use
* @param mixed $row
* @param mixed $column
* @param mixed $relativity
* @param mixed $referenceStyle
* @param mixed $sheetText
* @param string $sheetText Optional Name of worksheet to use
*
* @return string
*/
Expand Down Expand Up @@ -84,10 +79,9 @@ public static function cellAddress($row, $column, $relativity = 1, $referenceSty
* Excel Function:
* =COLUMN([cellAddress])
*
* @param cellAddress A reference to a range of cells for which you want the column numbers
* @param null|mixed $cellAddress
* @param null|array|string $cellAddress A reference to a range of cells for which you want the column numbers
*
* @return int or array of integer
* @return int|int[]
*/
public static function COLUMN($cellAddress = null)
{
Expand Down Expand Up @@ -130,8 +124,7 @@ public static function COLUMN($cellAddress = null)
* Excel Function:
* =COLUMNS(cellAddress)
*
* @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns
* @param null|mixed $cellAddress
* @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns
*
* @return int The number of columns in cellAddress
*/
Expand Down Expand Up @@ -165,8 +158,7 @@ public static function COLUMNS($cellAddress = null)
* Excel Function:
* =ROW([cellAddress])
*
* @param cellAddress A reference to a range of cells for which you want the row numbers
* @param null|mixed $cellAddress
* @param null|array|string $cellAddress A reference to a range of cells for which you want the row numbers
*
* @return int or array of integer
*/
Expand Down Expand Up @@ -211,7 +203,7 @@ public static function ROW($cellAddress = null)
* Excel Function:
* =ROWS(cellAddress)
*
* @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
* @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
* @param null|mixed $cellAddress
*
* @return int The number of rows in cellAddress
Expand Down Expand Up @@ -279,7 +271,7 @@ public static function HYPERLINK($linkURL = '', $displayName = null, Cell $pCell
*
* NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
*
* @param cellAddress $cellAddress The cell address of the current cell (containing this formula)
* @param null|array|string $cellAddress $cellAddress The cell address of the current cell (containing this formula)
* @param Cell $pCell The current cell (containing this formula)
*
* @return mixed The cells referenced by cellAddress
Expand Down Expand Up @@ -337,25 +329,20 @@ public static function INDIRECT($cellAddress = null, Cell $pCell = null)
* Excel Function:
* =OFFSET(cellAddress, rows, cols, [height], [width])
*
* @param cellAddress The reference from which you want to base the offset. Reference must refer to a cell or
* @param null|array|string $cellAddress The reference from which you want to base the offset. Reference must refer to a cell or
* range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
* @param rows The number of rows, up or down, that you want the upper-left cell to refer to.
* @param mixed $rows The number of rows, up or down, that you want the upper-left cell to refer to.
* Using 5 as the rows argument specifies that the upper-left cell in the reference is
* five rows below reference. Rows can be positive (which means below the starting reference)
* or negative (which means above the starting reference).
* @param cols The number of columns, to the left or right, that you want the upper-left cell of the result
* @param mixed $columns The number of columns, to the left or right, that you want the upper-left cell of the result
* to refer to. Using 5 as the cols argument specifies that the upper-left cell in the
* reference is five columns to the right of reference. Cols can be positive (which means
* to the right of the starting reference) or negative (which means to the left of the
* starting reference).
* @param height The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
* @param width The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
* @param null|mixed $cellAddress
* @param mixed $rows
* @param mixed $columns
* @param null|mixed $height
* @param null|mixed $width
* @param Cell $pCell
* @param mixed $height The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
* @param mixed $width The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
* @param null|Cell $pCell
*
* @return string A reference to a cell or range of cells
*/
Expand Down Expand Up @@ -435,10 +422,10 @@ public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $hei
* Excel Function:
* =CHOOSE(index_num, value1, [value2], ...)
*
* @param index_num Specifies which value argument is selected.
* @param mixed $index_num Specifies which value argument is selected.
* Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number
* between 1 and 254.
* @param value1... Value1 is required, subsequent values are optional.
* @param mixed $value1... Value1 is required, subsequent values are optional.
* Between 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on
* index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or
* text.
Expand Down Expand Up @@ -590,12 +577,9 @@ public static function MATCH($lookupValue, $lookupArray, $matchType = 1)
* Excel Function:
* =INDEX(range_array, row_num, [column_num])
*
* @param range_array A range of cells or an array constant
* @param row_num The row in array from which to return a value. If row_num is omitted, column_num is required.
* @param column_num The column in array from which to return a value. If column_num is omitted, row_num is required.
* @param mixed $arrayValues
* @param mixed $rowNum
* @param mixed $columnNum
* @param mixed $arrayValues A range of cells or an array constant
* @param mixed $rowNum The row in array from which to return a value. If row_num is omitted, column_num is required.
* @param mixed $columnNum The column in array from which to return a value. If column_num is omitted, row_num is required.
*
* @return mixed the value of a specified cell or array of cells
*/
Expand Down Expand Up @@ -692,14 +676,10 @@ private static function vlookupSort($a, $b)
* VLOOKUP
* The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.
*
* @param lookup_value The value that you want to match in lookup_array
* @param lookup_array The range of cells being searched
* @param index_number The column number in table_array from which the matching value must be returned. The first column is 1.
* @param not_exact_match determines if you are looking for an exact match based on lookup_value
* @param mixed $lookup_value
* @param mixed $lookup_array
* @param mixed $index_number
* @param mixed $not_exact_match
* @param mixed $lookup_value The value that you want to match in lookup_array
* @param mixed $lookup_array The range of cells being searched
* @param mixed $index_number The column number in table_array from which the matching value must be returned. The first column is 1.
* @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
*
* @return mixed The value of the found cell
*/
Expand Down Expand Up @@ -761,14 +741,10 @@ public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not
* HLOOKUP
* The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
*
* @param lookup_value The value that you want to match in lookup_array
* @param lookup_array The range of cells being searched
* @param index_number The row number in table_array from which the matching value must be returned. The first row is 1.
* @param not_exact_match determines if you are looking for an exact match based on lookup_value
* @param mixed $lookup_value
* @param mixed $lookup_array
* @param mixed $index_number
* @param mixed $not_exact_match
* @param mixed $lookup_value The value that you want to match in lookup_array
* @param mixed $lookup_array The range of cells being searched
* @param mixed $index_number The row number in table_array from which the matching value must be returned. The first row is 1.
* @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
*
* @return mixed The value of the found cell
*/
Expand Down Expand Up @@ -826,12 +802,9 @@ public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not
* LOOKUP
* The LOOKUP function searches for value either from a one-row or one-column range or from an array.
*
* @param lookup_value The value that you want to match in lookup_array
* @param lookup_vector The range of cells being searched
* @param result_vector The column from which the matching value must be returned
* @param mixed $lookup_value
* @param mixed $lookup_vector
* @param null|mixed $result_vector
* @param mixed $lookup_value The value that you want to match in lookup_array
* @param mixed $lookup_vector The range of cells being searched
* @param null|mixed $result_vector The column from which the matching value must be returned
*
* @return mixed The value of the found cell
*/
Expand Down
23 changes: 10 additions & 13 deletions src/PhpSpreadsheet/Calculation/Statistical.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ private static function checkTrendArrays(&$array1, &$array2)
*
* The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992).
*
* @param x require 0<=x<=1
* @param p require p>0
* @param q require q>0
* @param mixed $x
* @param mixed $p
* @param mixed $q
* @param mixed $x require 0<=x<=1
* @param mixed $p require p>0
* @param mixed $q require q>0
*
* @return 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
* @return float 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
*/
private static function incompleteBeta($x, $p, $q)
{
Expand All @@ -82,12 +79,10 @@ private static function incompleteBeta($x, $p, $q)
/**
* The natural logarithm of the beta function.
*
* @param p require p>0
* @param q require q>0
* @param mixed $p
* @param mixed $q
* @param mixed $p require p>0
* @param mixed $q require q>0
*
* @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
* @return float 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
*
* @author Jaco van Kooten
*/
Expand Down Expand Up @@ -115,6 +110,8 @@ private static function logBeta($p, $q)
* @param mixed $x
* @param mixed $p
* @param mixed $q
*
* @return float
*/
private static function betaFraction($x, $p, $q)
{
Expand Down Expand Up @@ -205,7 +202,7 @@ private static function betaFraction($x, $p, $q)
* The computation is believed to be free of underflow and overflow.
* </p>
*
* @return MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
* @return float MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
*/

// Function cache for logGamma
Expand Down
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Chart/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function getWidth()
/**
* Set Width.
*
* @param Width $value
* @param float $value
*
* @return Layout
*/
Expand All @@ -296,7 +296,7 @@ public function getHeight()
/**
* Set Height.
*
* @param Height $value
* @param float $value
*
* @return Layout
*/
Expand Down
36 changes: 18 additions & 18 deletions src/PhpSpreadsheet/Document/Properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,23 +168,23 @@ public function getCreated()
/**
* Set Created.
*
* @param datetime $pValue
* @param int|string $time
*
* @return Properties
*/
public function setCreated($pValue)
public function setCreated($time)
{
if ($pValue === null) {
$pValue = time();
} elseif (is_string($pValue)) {
if (is_numeric($pValue)) {
$pValue = (int) $pValue;
if ($time === null) {
$time = time();
} elseif (is_string($time)) {
if (is_numeric($time)) {
$time = (int) $time;
} else {
$pValue = strtotime($pValue);
$time = strtotime($time);
}
}

$this->created = $pValue;
$this->created = $time;

return $this;
}
Expand All @@ -202,23 +202,23 @@ public function getModified()
/**
* Set Modified.
*
* @param datetime $pValue
* @param int|string $time
*
* @return Properties
*/
public function setModified($pValue)
public function setModified($time)
{
if ($pValue === null) {
$pValue = time();
} elseif (is_string($pValue)) {
if (is_numeric($pValue)) {
$pValue = (int) $pValue;
if ($time === null) {
$time = time();
} elseif (is_string($time)) {
if (is_numeric($time)) {
$time = (int) $time;
} else {
$pValue = strtotime($pValue);
$time = strtotime($time);
}
}

$this->modified = $pValue;
$this->modified = $time;

return $this;
}
Expand Down
Loading

0 comments on commit b9b29cc

Please sign in to comment.