Added @api tag for documentation

This commit is contained in:
Adrien Loison 2015-09-04 11:34:01 -07:00
parent 118810de22
commit f8c39287ad
30 changed files with 58 additions and 14 deletions

View File

@ -1,12 +0,0 @@
<?php
namespace Box\Spout\Common\Exception;
/**
* Class BadUsageException
*
* @package Box\Spout\Common\Exception
*/
class BadUsageException extends SpoutException
{
}

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Common\Exception;
/**
* Class EncodingConversionException
*
* @api
* @package Box\Spout\Common\Exception
*/
class EncodingConversionException extends SpoutException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Common\Exception;
/**
* Class IOException
*
* @api
* @package Box\Spout\Common\Exception
*/
class IOException extends SpoutException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Common\Exception;
/**
* Class InvalidArgumentException
*
* @api
* @package Box\Spout\Common\Exception
*/
class InvalidArgumentException extends SpoutException

View File

@ -6,6 +6,7 @@ namespace Box\Spout\Common\Exception;
* Class SpoutException
*
* @package Box\Spout\Common\Exception
* @abstract
*/
abstract class SpoutException extends \Exception
{

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Common\Exception;
/**
* Class UnsupportedTypeException
*
* @api
* @package Box\Spout\Common\Exception
*/
class UnsupportedTypeException extends SpoutException

View File

@ -5,6 +5,8 @@ namespace Box\Spout\Common;
/**
* Class Type
* This class references the supported types
*
* @api
*/
abstract class Type
{

View File

@ -55,6 +55,7 @@ abstract class AbstractReader implements ReaderInterface
* Prepares the reader to read the given file. It also makes sure
* that the file exists and is readable.
*
* @api
* @param string $filePath Path of the file to be read
* @return void
* @throws \Box\Spout\Common\Exception\IOException If the file at the given path does not exist, is not readable or is corrupted
@ -92,6 +93,7 @@ abstract class AbstractReader implements ReaderInterface
/**
* Returns an iterator to iterate over sheets.
*
* @api
* @return \Iterator To iterate over sheets
* @throws \Box\Spout\Reader\Exception\ReaderNotOpenedException If called before opening the reader
*/
@ -107,6 +109,7 @@ abstract class AbstractReader implements ReaderInterface
/**
* Closes the reader, preventing any additional reading
*
* @api
* @return void
*/
public function close()

View File

@ -27,6 +27,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return RowIterator
*/
public function getRowIterator()

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Reader\Exception;
/**
* Class IteratorNotRewindableException
*
* @api
* @package Box\Spout\Reader\Exception
*/
class IteratorNotRewindableException extends ReaderException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Reader\Exception;
/**
* Class NoSheetsFoundException
*
* @api
* @package Box\Spout\Reader\Exception
*/
class NoSheetsFoundException extends ReaderException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Reader\Exception;
/**
* Class ReaderNotOpenedException
*
* @api
* @package Box\Spout\Reader\Exception
*/
class ReaderNotOpenedException extends ReaderException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Reader\Exception;
/**
* Class SharedStringNotFoundException
*
* @api
* @package Box\Spout\Reader\Exception
*/
class SharedStringNotFoundException extends ReaderException

View File

@ -38,6 +38,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return RowIterator
*/
public function getRowIterator()
@ -46,6 +47,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return int Index of the sheet, based on order of creation (zero-based)
*/
public function getIndex()
@ -54,6 +56,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return string Name of the sheet
*/
public function getName()

View File

@ -18,6 +18,7 @@ class ReaderFactory
/**
* This creates an instance of the appropriate reader, given the type of the file to be read
*
* @api
* @param string $readerType Type of the reader to instantiate
* @return ReaderInterface
* @throws \Box\Spout\Common\Exception\UnsupportedTypeException

View File

@ -36,6 +36,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return RowIterator
*/
public function getRowIterator()
@ -44,6 +45,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return int Index of the sheet, based on order of creation (zero-based)
*/
public function getIndex()
@ -52,6 +54,7 @@ class Sheet implements SheetInterface
}
/**
* @api
* @return string Name of the sheet
*/
public function getName()

View File

@ -24,6 +24,7 @@ abstract class AbstractMultiSheetsWriter extends AbstractWriter
* Sets whether new sheets should be automatically created when the max rows limit per sheet is reached.
* This must be set before opening the writer.
*
* @api
* @param bool $shouldCreateNewSheetsAutomatically Whether new sheets should be automatically created when the max rows limit per sheet is reached
* @return AbstractMultiSheetsWriter
* @throws \Box\Spout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened
@ -39,6 +40,7 @@ abstract class AbstractMultiSheetsWriter extends AbstractWriter
/**
* Returns all the workbook's sheets
*
* @api
* @return Common\Sheet[] All the workbook's sheets
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet
*/
@ -60,6 +62,7 @@ abstract class AbstractMultiSheetsWriter extends AbstractWriter
/**
* Creates a new sheet and make it the current sheet. The data will now be written to this sheet.
*
* @api
* @return Common\Sheet The created sheet
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet
*/
@ -74,6 +77,7 @@ abstract class AbstractMultiSheetsWriter extends AbstractWriter
/**
* Returns the current sheet
*
* @api
* @return Common\Sheet The current sheet
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet
*/
@ -87,6 +91,7 @@ abstract class AbstractMultiSheetsWriter extends AbstractWriter
* Sets the given sheet as the current one. New data will be written to this sheet.
* The writing will resume where it stopped (i.e. data won't be truncated).
*
* @api
* @param Common\Sheet $sheet The sheet to set as current
* @return void
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If the writer has not been opened yet

View File

@ -85,6 +85,7 @@ abstract class AbstractWriter implements WriterInterface
* Inits the writer and opens it to accept data.
* By using this method, the data will be written to a file.
*
* @api
* @param string $outputFilePath Path of the output file that will contain the data
* @return AbstractWriter
* @throws \Box\Spout\Common\Exception\IOException If the writer cannot be opened or if the given path is not writable
@ -108,6 +109,7 @@ abstract class AbstractWriter implements WriterInterface
*
* @codeCoverageIgnore
*
* @api
* @param string $outputFileName Name of the output file that will contain the data. If a path is passed in, only the file name will be kept
* @return AbstractWriter
* @throws \Box\Spout\Common\Exception\IOException If the writer cannot be opened
@ -174,7 +176,7 @@ abstract class AbstractWriter implements WriterInterface
* @param array $dataRow Array containing data to be streamed.
* If empty, no data is added (i.e. not even as a blank row)
* Example: $dataRow = ['data1', 1234, null, '', 'data5', false];
*
* @api
* @return AbstractWriter
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If this function is called before opening the writer
* @throws \Box\Spout\Common\Exception\IOException If unable to write data
@ -197,6 +199,7 @@ abstract class AbstractWriter implements WriterInterface
* Write given data to the output and apply the given style.
* @see addRow
*
* @api
* @param array $dataRow Array of array containing data to be streamed.
* @param Style\Style $style Style to be applied to the row.
* @return AbstractWriter
@ -220,13 +223,13 @@ abstract class AbstractWriter implements WriterInterface
/**
* Write given data to the output. New data will be appended to end of stream.
*
* @api
* @param array $dataRows Array of array containing data to be streamed.
* If a row is empty, it won't be added (i.e. not even as a blank row)
* Example: $dataRows = [
* ['data11', 12, , '', 'data13'],
* ['data21', 'data22', null, false],
* ];
*
* @return AbstractWriter
* @throws \Box\Spout\Common\Exception\InvalidArgumentException If the input param is not valid
* @throws \Box\Spout\Writer\Exception\WriterNotOpenedException If this function is called before opening the writer
@ -251,6 +254,7 @@ abstract class AbstractWriter implements WriterInterface
* Write given data to the output and apply the given style.
* @see addRows
*
* @api
* @param array $dataRows Array of array containing data to be streamed.
* @param Style\Style $style Style to be applied to the rows.
* @return AbstractWriter
@ -309,6 +313,7 @@ abstract class AbstractWriter implements WriterInterface
* Closes the writer. This will close the streamer as well, preventing new data
* to be written to the file.
*
* @api
* @return void
*/
public function close()

View File

@ -32,6 +32,7 @@ class Writer extends AbstractWriter
/**
* Sets the field delimiter for the CSV
*
* @api
* @param string $fieldDelimiter Character that delimits fields
* @return Writer
*/
@ -44,6 +45,7 @@ class Writer extends AbstractWriter
/**
* Sets the field enclosure for the CSV
*
* @api
* @param string $fieldEnclosure Character that enclose fields
* @return Writer
*/

View File

@ -44,6 +44,7 @@ class Sheet
}
/**
* @api
* @return int Index of the sheet, based on order of creation (zero-based)
*/
public function getIndex()
@ -52,6 +53,7 @@ class Sheet
}
/**
* @api
* @return string Name of the sheet
*/
public function getName()
@ -66,6 +68,7 @@ class Sheet
* - it should not contain these characters: \ / ? * : [ or ]
* - it should be unique
*
* @api
* @param string $name Name of the sheet
* @return Sheet
* @throws \Box\Spout\Writer\Exception\InvalidSheetNameException If the sheet's name is invalid.

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Writer\Exception;
/**
* Class InvalidColorException
*
* @api
* @package Box\Spout\Writer\Exception
*/
class InvalidColorException extends WriterException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Writer\Exception;
/**
* Class InvalidSheetNameException
*
* @api
* @package Box\Spout\Writer\Exception
*/
class InvalidSheetNameException extends WriterException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Writer\Exception;
/**
* Class SheetNotFoundException
*
* @api
* @package Box\Spout\Writer\Exception
*/
class SheetNotFoundException extends WriterException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Writer\Exception;
/**
* Class WriterAlreadyOpenedException
*
* @api
* @package Box\Spout\Writer\Exception
*/
class WriterAlreadyOpenedException extends WriterException

View File

@ -5,6 +5,7 @@ namespace Box\Spout\Writer\Exception;
/**
* Class WriterNotOpenedException
*
* @api
* @package Box\Spout\Writer\Exception
*/
class WriterNotOpenedException extends WriterException

View File

@ -27,6 +27,7 @@ class Writer extends AbstractMultiSheetsWriter
* Sets a custom temporary folder for creating intermediate files/folders.
* This must be set before opening the writer.
*
* @api
* @param string $tempFolder Temporary folder where the files to create the ODS will be stored
* @return Writer
* @throws \Box\Spout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened

View File

@ -29,6 +29,7 @@ class Color
/**
* Returns an RGB color from R, G and B values
*
* @api
* @param int $red Red component, 0 - 255
* @param int $green Green component, 0 - 255
* @param int $blue Blue component, 0 - 255

View File

@ -24,6 +24,7 @@ class StyleBuilder
/**
* Makes the font bold.
*
* @api
* @return StyleBuilder
*/
public function setFontBold()
@ -35,6 +36,7 @@ class StyleBuilder
/**
* Makes the font italic.
*
* @api
* @return StyleBuilder
*/
public function setFontItalic()
@ -46,6 +48,7 @@ class StyleBuilder
/**
* Makes the font underlined.
*
* @api
* @return StyleBuilder
*/
public function setFontUnderline()
@ -57,6 +60,7 @@ class StyleBuilder
/**
* Makes the font struck through.
*
* @api
* @return StyleBuilder
*/
public function setFontStrikethrough()
@ -68,6 +72,7 @@ class StyleBuilder
/**
* Sets the font size.
*
* @api
* @param int $fontSize Font size, in pixels
* @return StyleBuilder
*/
@ -80,6 +85,7 @@ class StyleBuilder
/**
* Sets the font color.
*
* @api
* @param string $fontColor ARGB color (@see Color)
* @return StyleBuilder
*/
@ -92,6 +98,7 @@ class StyleBuilder
/**
* Sets the font name.
*
* @api
* @param string $fontName Name of the font to use
* @return StyleBuilder
*/
@ -105,6 +112,7 @@ class StyleBuilder
* Makes the text wrap in the cell if it's too long or
* on multiple lines.
*
* @api
* @return StyleBuilder
*/
public function setShouldWrapText()
@ -116,6 +124,7 @@ class StyleBuilder
/**
* Returns the configured style. The style is cached and can be reused.
*
* @api
* @return Style
*/
public function build()

View File

@ -18,6 +18,7 @@ class WriterFactory
/**
* This creates an instance of the appropriate writer, given the type of the file to be read
*
* @api
* @param string $writerType Type of the writer to instantiate
* @return WriterInterface
* @throws \Box\Spout\Common\Exception\UnsupportedTypeException

View File

@ -34,6 +34,7 @@ class Writer extends AbstractMultiSheetsWriter
* Sets a custom temporary folder for creating intermediate files/folders.
* This must be set before opening the writer.
*
* @api
* @param string $tempFolder Temporary folder where the files to create the XLSX will be stored
* @return Writer
* @throws \Box\Spout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened
@ -50,6 +51,7 @@ class Writer extends AbstractMultiSheetsWriter
* Use inline string to be more memory efficient. If set to false, it will use shared strings.
* This must be set before opening the writer.
*
* @api
* @param bool $shouldUseInlineStrings Whether inline or shared strings should be used
* @return Writer
* @throws \Box\Spout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened