diff --git a/.gitignore b/.gitignore
index 13c9e9b5..011328ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
-/build/PHPExcel.phar
/tests/codeCoverage
/analysis
/vendor/
-/composer.lock
/phpunit.xml
+/.php_cs.cache
## IDE support
*.buildpath
diff --git a/.php_cs b/.php_cs
deleted file mode 100644
index 2278ffb0..00000000
--- a/.php_cs
+++ /dev/null
@@ -1,109 +0,0 @@
-exclude('vendor')
- ->in('samples')
- ->in('src')
- ->in('tests');
-
-return Symfony\CS\Config\Config::create()
- ->level(Symfony\CS\FixerInterface::NONE_LEVEL)
- ->fixers([
- // 'align_double_arrow', // Waste of time
- // 'align_equals', // Waste of time
- 'array_element_no_space_before_comma',
- 'array_element_white_space_after_comma',
- 'blankline_after_open_tag',
- 'braces',
- // 'concat_without_spaces', // This make it less readable
- 'concat_with_spaces',
- 'double_arrow_multiline_whitespaces',
- 'duplicate_semicolon',
- // 'echo_to_print', // We prefer echo
- 'elseif',
- // 'empty_return', // even if technically useless, we prefer to be explicit with our intent to return null
- 'encoding',
- 'eof_ending',
- 'ereg_to_preg',
- 'extra_empty_lines',
- 'function_call_space',
- 'function_declaration',
- 'function_typehint_space',
- // 'header_comment', // We don't use common header in all our files
- 'include',
- 'indentation',
- 'join_function',
- 'line_after_namespace',
- 'linefeed',
- 'list_commas',
- // 'logical_not_operators_with_spaces', // No we prefer to keep "!" without spaces
- // 'logical_not_operators_with_successor_space', // idem
- // 'long_array_syntax', // We opted in for the short syntax
- 'lowercase_constants',
- 'lowercase_keywords',
- 'method_argument_space',
- 'multiline_array_trailing_comma',
- 'multiline_spaces_before_semicolon',
- 'multiple_use',
- 'namespace_no_leading_whitespace',
- 'newline_after_open_tag',
- 'new_with_braces',
- 'no_blank_lines_after_class_opening',
- // 'no_blank_lines_before_namespace', // we want 1 blank line before namespace
- 'no_empty_lines_after_phpdocs',
- 'object_operator',
- 'operators_spaces',
- 'ordered_use',
- 'parenthesis',
- 'php4_constructor',
- 'php_closing_tag',
- 'phpdoc_indent',
- 'phpdoc_inline_tag',
- 'phpdoc_no_access',
- 'phpdoc_no_empty_return',
- 'phpdoc_no_package',
- 'phpdoc_order',
- // 'phpdoc_params', // Waste of time
- 'phpdoc_scalar',
- // 'phpdoc_separation', // Nope, annotations are easy to read enough, no need to split them with blank lines
- // 'phpdoc_short_description', // We usually don't generate documentation so punctuation is not important
- 'phpdoc_to_comment',
- 'phpdoc_trim',
- 'phpdoc_types',
- 'phpdoc_type_to_var',
- // 'phpdoc_var_to_type', // This is not supported by phpDoc2 anymore
- 'phpdoc_var_without_name',
- 'php_unit_construct',
- // 'php_unit_strict', // We sometime actually need assertEquals
- 'pre_increment',
- 'print_to_echo',
- 'psr0',
- 'remove_leading_slash_use',
- 'remove_lines_between_uses',
- 'return',
- 'self_accessor',
- 'short_array_syntax',
- 'short_bool_cast',
- 'short_echo_tag',
- 'short_tag',
- 'single_array_no_trailing_comma',
- 'single_blank_line_before_namespace',
- 'single_line_after_imports',
- 'single_quote',
- 'spaces_before_semicolon',
- 'spaces_cast',
- 'standardize_not_equal',
- // 'strict', // No, too dangerous to change that
- // 'strict_param', // No, too dangerous to change that
- // 'ternary_spaces', // That would be nice, but NetBeans does not cooperate :-(
- 'trailing_spaces',
- 'trim_array_spaces',
- 'unalign_double_arrow',
- 'unalign_equals',
- 'unary_operators_spaces',
- 'unneeded_control_parentheses',
- 'unused_use',
- 'visibility',
- 'whitespacy_lines',
- ])
- ->finder($finder);
diff --git a/.php_cs.dist b/.php_cs.dist
new file mode 100644
index 00000000..a8a78a9a
--- /dev/null
+++ b/.php_cs.dist
@@ -0,0 +1,140 @@
+exclude('vendor')
+ ->in('samples')
+ ->in('src')
+ ->in('tests');
+
+return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setFinder($finder)
+ ->setRules([
+ 'array_syntax' => ['syntax' => 'short'],
+ 'binary_operator_spaces' => true,
+ 'blank_line_after_namespace' => true,
+ 'blank_line_after_opening_tag' => true,
+ 'blank_line_before_return' => true,
+ 'braces' => true,
+ 'cast_spaces' => true,
+ 'class_definition' => true,
+ 'class_keyword_remove' => false, // ::class keyword gives us beter support in IDE
+ 'combine_consecutive_unsets' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'declare_equal_normalize' => true,
+ 'declare_strict_types' => false, // Too early to adopt strict types
+ 'dir_constant' => true,
+ 'elseif' => true,
+ 'encoding' => true,
+ 'ereg_to_preg' => true,
+ 'full_opening_tag' => true,
+ 'function_declaration' => true,
+ 'function_typehint_space' => true,
+ 'general_phpdoc_annotation_remove' => false, // No use for that
+ 'hash_to_slash_comment' => true,
+ 'header_comment' => false, // We don't use common header in all our files
+ 'heredoc_to_nowdoc' => false, // Not sure about this one
+ 'include' => true,
+ 'indentation_type' => true,
+ 'line_ending' => true,
+ 'linebreak_after_opening_tag' => true,
+ 'lowercase_cast' => true,
+ 'lowercase_constants' => true,
+ 'lowercase_keywords' => true,
+ 'mb_str_functions' => false, // No, too dangerous to change that
+ 'method_argument_space' => true,
+ 'method_separation' => true,
+ 'modernize_types_casting' => true,
+ 'native_function_casing' => true,
+ 'new_with_braces' => true,
+ 'no_alias_functions' => true,
+ 'no_blank_lines_after_class_opening' => true,
+ 'no_blank_lines_after_phpdoc' => true,
+ 'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace
+ 'no_closing_tag' => true,
+ 'no_empty_comment' => true,
+ 'no_empty_phpdoc' => true,
+ 'no_empty_statement' => true,
+ 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'useTrait', 'curly_brace_block', 'parenthesis_brace_block', 'square_brace_block'],
+ 'no_leading_import_slash' => true,
+ 'no_leading_namespace_whitespace' => true,
+ 'no_mixed_echo_print' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_php4_constructor' => true,
+ 'no_short_bool_cast' => true,
+ 'no_short_echo_tag' => true,
+ 'no_singleline_whitespace_before_semicolons' => true,
+ 'no_spaces_after_function_name' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_spaces_inside_parenthesis' => true,
+ 'no_trailing_comma_in_list_call' => true,
+ 'no_trailing_comma_in_singleline_array' => true,
+ 'no_trailing_whitespace' => true,
+ 'no_trailing_whitespace_in_comment' => true,
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unreachable_default_argument_value' => true,
+ 'no_unused_imports' => true,
+ 'no_useless_else' => true,
+ 'no_useless_return' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'normalize_index_brace' => true,
+ 'not_operator_with_space' => false, // No we prefer to keep '!' without spaces
+ 'not_operator_with_successor_space' => false, // idem
+ 'object_operator_without_whitespace' => true,
+ 'ordered_class_elements' => false, // We prefer to keep some freedom
+ 'ordered_imports' => true,
+ 'php_unit_construct' => true,
+ 'php_unit_dedicate_assert' => true,
+ 'php_unit_fqcn_annotation' => true,
+ 'php_unit_strict' => false, // We sometime actually need assertEquals 'phpdoc_align' => false, // Waste of time
+ 'phpdoc_add_missing_param_annotation' => true,
+ 'phpdoc_align' => false, // Waste of time
+ 'phpdoc_annotation_without_dot' => true,
+ 'phpdoc_indent' => true,
+ 'phpdoc_inline_tag' => true,
+ 'phpdoc_no_access' => true,
+ 'phpdoc_no_alias_tag' => true,
+ 'phpdoc_no_empty_return' => true,
+ 'phpdoc_no_package' => true,
+ 'phpdoc_order' => true,
+ 'phpdoc_scalar' => true,
+ 'phpdoc_separation' => true,
+ 'phpdoc_single_line_var_spacing' => true,
+ 'phpdoc_summary' => true,
+ 'phpdoc_to_comment' => true,
+ 'phpdoc_trim' => true,
+ 'phpdoc_types' => true,
+ 'phpdoc_var_without_name' => true,
+ 'pow_to_exponentiation' => false,
+ 'pre_increment' => true,
+ 'protected_to_private' => true,
+ 'psr0' => true,
+ 'psr4' => true,
+ 'random_api_migration' => false, // This breaks our unit tests
+ 'return_type_declaration' => true,
+ 'self_accessor' => true,
+ 'semicolon_after_instruction' => false, // Buggy in `samples/index.php`
+ 'short_scalar_cast' => true,
+ 'silenced_deprecation_error' => true,
+ 'simplified_null_return' => false, // While technically correct we prefer to be explicit when returning null
+ 'single_blank_line_at_eof' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'single_import_per_statement' => true,
+ 'single_line_after_imports' => true,
+ 'single_quote' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'strict_comparison' => false, // No, too dangerous to change that
+ 'strict_param' => false, // No, too dangerous to change that
+ 'switch_case_semicolon_to_colon' => true,
+ 'switch_case_space' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'visibility_required' => true,
+ 'whitespace_after_comma_in_array' => true,
+ ]);
diff --git a/composer.json b/composer.json
index ad281332..95e570f8 100644
--- a/composer.json
+++ b/composer.json
@@ -33,7 +33,7 @@
"squizlabs/php_codesniffer": "2.*",
"phpunit/phpunit": "4.6.*",
"mikey179/vfsStream": "1.5.*",
- "friendsofphp/php-cs-fixer": "^1.11"
+ "friendsofphp/php-cs-fixer": "^2.0"
},
"suggest": {
"ext-zip": "Required to handle .xlsx .ods or .gnumeric files",
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 00000000..f409d70e
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1751 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "7244392042ac04174b9b0d5cf51129d0",
+ "content-hash": "230c3d270e3bfe7e52ffe59b6e65eaa7",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "doctrine/instantiator",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3,<8.0-DEV"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "~2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2015-06-14 21:17:01"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
+ "reference": "f3baf72eb2f58bf275b372540f5b47d25aed910f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/f3baf72eb2f58bf275b372540f5b47d25aed910f",
+ "reference": "f3baf72eb2f58bf275b372540f5b47d25aed910f",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": "^5.3.6 || >=7.0 <7.2",
+ "sebastian/diff": "^1.1",
+ "symfony/console": "^2.3 || ^3.0",
+ "symfony/event-dispatcher": "^2.1 || ^3.0",
+ "symfony/filesystem": "^2.4 || ^3.0",
+ "symfony/finder": "^2.2 || ^3.0",
+ "symfony/polyfill-php54": "^1.0",
+ "symfony/process": "^2.3 || ^3.0",
+ "symfony/stopwatch": "^2.5 || ^3.0"
+ },
+ "conflict": {
+ "hhvm": "<3.9"
+ },
+ "require-dev": {
+ "gecko-packages/gecko-php-unit": "^2.0",
+ "phpunit/phpunit": "^4.5|^5",
+ "satooshi/php-coveralls": "^1.0"
+ },
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "type": "application",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Dariusz RumiĆski",
+ "email": "dariusz.ruminski@gmail.com"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "A tool to automatically fix PHP code style",
+ "time": "2016-12-01 06:18:06"
+ },
+ {
+ "name": "mikey179/vfsStream",
+ "version": "v1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mikey179/vfsStream.git",
+ "reference": "4dc0d2f622412f561f5b242b19b98068bbbc883a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/4dc0d2f622412f561f5b242b19b98068bbbc883a",
+ "reference": "4dc0d2f622412f561f5b242b19b98068bbbc883a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "org\\bovigo\\vfs\\": "src/main/php"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Frank Kleine",
+ "homepage": "http://frankkleine.de/",
+ "role": "Developer"
+ }
+ ],
+ "description": "Virtual file system to mock the real file system in unit tests.",
+ "homepage": "http://vfs.bovigo.org/",
+ "time": "2015-03-29 11:19:49"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
+ "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "time": "2015-12-27 11:43:31"
+ },
+ {
+ "name": "phpdocumentor/reflection-docblock",
+ "version": "3.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+ "reference": "9270140b940ff02e58ec577c237274e92cd40cdd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd",
+ "reference": "9270140b940ff02e58ec577c237274e92cd40cdd",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5",
+ "phpdocumentor/reflection-common": "^1.0@dev",
+ "phpdocumentor/type-resolver": "^0.2.0",
+ "webmozart/assert": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^4.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "time": "2016-06-10 09:48:41"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443",
+ "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5",
+ "phpdocumentor/reflection-common": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^5.2||^4.8.24"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "time": "2016-06-10 07:14:17"
+ },
+ {
+ "name": "phpspec/prophecy",
+ "version": "v1.6.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy.git",
+ "reference": "58a8137754bc24b25740d4281399a4a3596058e0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0",
+ "reference": "58a8137754bc24b25740d4281399a4a3596058e0",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": "^5.3|^7.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
+ "sebastian/comparator": "^1.1",
+ "sebastian/recursion-context": "^1.0"
+ },
+ "require-dev": {
+ "phpspec/phpspec": "^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "homepage": "https://github.com/phpspec/prophecy",
+ "keywords": [
+ "Double",
+ "Dummy",
+ "fake",
+ "mock",
+ "spy",
+ "stub"
+ ],
+ "time": "2016-06-07 08:13:47"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "2.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-file-iterator": "~1.3",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-token-stream": "~1.3",
+ "sebastian/environment": "^1.3.2",
+ "sebastian/version": "~1.0"
+ },
+ "require-dev": {
+ "ext-xdebug": ">=2.1.4",
+ "phpunit/phpunit": "~4"
+ },
+ "suggest": {
+ "ext-dom": "*",
+ "ext-xdebug": ">=2.2.1",
+ "ext-xmlwriter": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2015-10-06 15:47:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2015-06-21 13:08:43"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2015-06-21 13:50:34"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4|~5"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2016-05-12 18:03:57"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "1.4.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
+ "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2015-09-15 10:49:45"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "4.6.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "7b5fe98b28302a8b25693b2298bca74463336975"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b5fe98b28302a8b25693b2298bca74463336975",
+ "reference": "7b5fe98b28302a8b25693b2298bca74463336975",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=5.3.3",
+ "phpspec/prophecy": "~1.3,>=1.3.1",
+ "phpunit/php-code-coverage": "~2.0,>=2.0.11",
+ "phpunit/php-file-iterator": "~1.4",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-timer": "~1.0",
+ "phpunit/phpunit-mock-objects": "~2.3",
+ "sebastian/comparator": "~1.1",
+ "sebastian/diff": "~1.2",
+ "sebastian/environment": "~1.2",
+ "sebastian/exporter": "~1.2",
+ "sebastian/global-state": "~1.0",
+ "sebastian/version": "~1.0",
+ "symfony/yaml": "~2.1|~3.0"
+ },
+ "suggest": {
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.6.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2015-06-03 05:03:30"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "2.3.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": ">=5.3.3",
+ "phpunit/php-text-template": "~1.2",
+ "sebastian/exporter": "~1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2015-10-02 06:51:40"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
+ "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "time": "2015-07-26 15:48:44"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "1.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2015-12-08 07:14:41"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "1.3.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
+ "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "time": "2016-05-17 03:18:57"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "1.2.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~1.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "time": "2016-06-17 09:04:28"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "time": "2015-10-12 03:26:01"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "time": "2015-11-11 19:50:13"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "1.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "shasum": ""
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2015-06-21 13:59:46"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "2.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83",
+ "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "bin": [
+ "scripts/phpcs",
+ "scripts/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "CodeSniffer.php",
+ "CodeSniffer/CLI.php",
+ "CodeSniffer/Exception.php",
+ "CodeSniffer/File.php",
+ "CodeSniffer/Fixer.php",
+ "CodeSniffer/Report.php",
+ "CodeSniffer/Reporting.php",
+ "CodeSniffer/Sniff.php",
+ "CodeSniffer/Tokens.php",
+ "CodeSniffer/Reports/",
+ "CodeSniffer/Tokenizers/",
+ "CodeSniffer/DocGenerators/",
+ "CodeSniffer/Standards/AbstractPatternSniff.php",
+ "CodeSniffer/Standards/AbstractScopeSniff.php",
+ "CodeSniffer/Standards/AbstractVariableSniff.php",
+ "CodeSniffer/Standards/IncorrectPatternException.php",
+ "CodeSniffer/Standards/Generic/Sniffs/",
+ "CodeSniffer/Standards/MySource/Sniffs/",
+ "CodeSniffer/Standards/PEAR/Sniffs/",
+ "CodeSniffer/Standards/PSR1/Sniffs/",
+ "CodeSniffer/Standards/PSR2/Sniffs/",
+ "CodeSniffer/Standards/Squiz/Sniffs/",
+ "CodeSniffer/Standards/Zend/Sniffs/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "time": "2016-07-13 23:29:13"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/f9e638e8149e9e41b570ff092f8007c477ef0ce5",
+ "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/process": "~2.8|~3.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-26 08:04:17"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
+ "reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/dependency-injection": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-19 10:45:57"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "bb29adceb552d202b6416ede373529338136e84f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb29adceb552d202b6416ede373529338136e84f",
+ "reference": "bb29adceb552d202b6416ede373529338136e84f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-20 05:44:26"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/8201978de88a9fa0923e18601bb17f1df9c721e7",
+ "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-06-29 05:41:56"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "dff51f72b0706335131b00a7f49606168c582594"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
+ "reference": "dff51f72b0706335131b00a7f49606168c582594",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2016-05-18 14:26:46"
+ },
+ {
+ "name": "symfony/polyfill-php54",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php54.git",
+ "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/90e085822963fdcc9d1c5b73deb3d2e5783b16a0",
+ "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php54\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2016-11-14 01:06:16"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/process.git",
+ "reference": "04c2dfaae4ec56a5c677b0c69fac34637d815758"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/process/zipball/04c2dfaae4ec56a5c677b0c69fac34637d815758",
+ "reference": "04c2dfaae4ec56a5c677b0c69fac34637d815758",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Process\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Process Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-28 11:13:48"
+ },
+ {
+ "name": "symfony/stopwatch",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/stopwatch.git",
+ "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/bb42806b12c5f89db4ebf64af6741afe6d8457e1",
+ "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Stopwatch\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Stopwatch Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-06-29 05:41:56"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "1819adf2066880c7967df7180f4f662b6f0567ac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac",
+ "reference": "1819adf2066880c7967df7180f4f662b6f0567ac",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-17 14:02:08"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozart/assert.git",
+ "reference": "bb2d123231c095735130cc8f6d31385a44c7b308"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308",
+ "reference": "bb2d123231c095735130cc8f6d31385a44c7b308",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3|^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6",
+ "sebastian/version": "^1.0.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "time": "2016-08-09 15:02:57"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": "^5.5|^7.0",
+ "ext-mbstring": "*",
+ "ext-iconv": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*"
+ },
+ "platform-dev": []
+}
diff --git a/src/Autoloader.php b/src/Autoloader.php
index 262d2e68..98af41d7 100644
--- a/src/Autoloader.php
+++ b/src/Autoloader.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet;
/**
- * Autoloader for PhpSpreadsheet classes
+ * Autoloader for PhpSpreadsheet classes.
*
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
@@ -22,13 +22,14 @@ namespace PhpOffice\PhpSpreadsheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Autoloader
{
/**
- * Register the Autoloader with SPL
+ * Register the Autoloader with SPL.
*/
public static function register()
{
@@ -41,7 +42,7 @@ class Autoloader
}
/**
- * Autoload a class identified by name
+ * Autoload a class identified by name.
*
* @param string $className Name of the object to load
*/
diff --git a/src/Bootstrap.php b/src/Bootstrap.php
index f4dfb928..e517dbda 100644
--- a/src/Bootstrap.php
+++ b/src/Bootstrap.php
@@ -1,7 +1,7 @@
currentObjectID, '%[A-Z]%d', $column, $row);
- return (integer) $row;
+ return (int) $row;
}
/**
- * Get highest worksheet column
+ * Get highest worksheet column.
*
* @param string $row Return the highest column for the specified row,
* or the highest column of any row if no row number is passed
+ *
* @return string Highest column name
*/
public function getHighestColumn($row = null)
@@ -268,10 +275,11 @@ abstract class CacheBase
}
/**
- * Get highest worksheet row
+ * Get highest worksheet row.
*
* @param string $column Return the highest row for the specified column,
* or the highest row of any column if no column letter is passed
+ *
* @return int Highest row number
*/
public function getHighestRow($column = null)
@@ -295,7 +303,7 @@ abstract class CacheBase
}
/**
- * Generate a unique ID for cache referencing
+ * Generate a unique ID for cache referencing.
*
* @return string Unique Reference
*/
@@ -311,7 +319,7 @@ abstract class CacheBase
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/
@@ -327,7 +335,7 @@ abstract class CacheBase
}
/**
- * Remove a row, deleting all cells in that row
+ * Remove a row, deleting all cells in that row.
*
* @param string $row Row number to remove
*/
@@ -342,7 +350,7 @@ abstract class CacheBase
}
/**
- * Remove a column, deleting all cells in that column
+ * Remove a column, deleting all cells in that column.
*
* @param string $column Column ID to remove
*/
@@ -358,7 +366,7 @@ abstract class CacheBase
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php
index 51d6d3b0..9bda9662 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,27 +20,28 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class DiscISAM extends CacheBase implements ICache
{
/**
- * Name of the file for this cache
+ * Name of the file for this cache.
*
* @var string
*/
private $fileName = null;
/**
- * File handle for this cache file
+ * File handle for this cache file.
*
* @var resource
*/
private $fileHandle = null;
/**
- * Directory/Folder where the cache file is located
+ * Directory/Folder where the cache file is located.
*
* @var string
*/
@@ -48,7 +49,7 @@ class DiscISAM extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -69,11 +70,13 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -90,10 +93,12 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -121,7 +126,7 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -135,7 +140,7 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/
@@ -153,7 +158,7 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -171,7 +176,7 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments
@@ -191,7 +196,7 @@ class DiscISAM extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php
index 37f23643..a39b9335 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,43 +20,51 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
interface ICache
{
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell);
/**
- * Add or Update a cell in cache
+ * Add or Update a cell in cache.
*
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function updateCacheData(\PhpOffice\PhpSpreadsheet\Cell $cell);
/**
- * Fetch a cell from cache identified by coordinate address
+ * Fetch a cell from cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to retrieve
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord);
/**
- * Delete a cell in cache identified by coordinate address
+ * Delete a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to delete
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord);
@@ -65,26 +73,27 @@ interface ICache
* Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
+ *
* @return bool
*/
public function isDataSet($pCoord);
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
public function getCellList();
/**
- * Get the list of all cell addresses currently held in cache sorted by column and row
+ * Get the list of all cell addresses currently held in cache sorted by column and row.
*
* @return string[]
*/
public function getSortedCellList();
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/
@@ -92,7 +101,7 @@ interface ICache
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Igbinary.php b/src/PhpSpreadsheet/CachedObjectStorage/Igbinary.php
index cfde6d03..dcd34d9b 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/Igbinary.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/Igbinary.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -27,7 +28,7 @@ class Igbinary extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -40,14 +41,18 @@ class Igbinary extends CacheBase implements ICache
$this->currentCellIsDirty = false;
}
$this->currentObjectID = $this->currentObject = null;
- } // function _storeData()
+ }
+
+ // function _storeData()
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -64,10 +69,12 @@ class Igbinary extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -91,10 +98,12 @@ class Igbinary extends CacheBase implements ICache
// Return requested entry
return $this->currentObject;
- } // function getCacheData()
+ }
+
+ // function getCacheData()
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -108,7 +117,7 @@ class Igbinary extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -120,11 +129,13 @@ class Igbinary extends CacheBase implements ICache
// detach ourself from the worksheet, so that it can then delete this object successfully
$this->parent = null;
- } // function unsetWorksheetCells()
+ }
+
+ // function unsetWorksheetCells()
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php
index b5e49737..b3323bb4 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,27 +20,28 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Memcache extends CacheBase implements ICache
{
/**
- * Prefix used to uniquely identify cache data for this worksheet
+ * Prefix used to uniquely identify cache data for this worksheet.
*
* @var string
*/
private $cachePrefix = null;
/**
- * Cache timeout
+ * Cache timeout.
*
* @var int
*/
private $cacheTime = 600;
/**
- * Memcache interface
+ * Memcache interface.
*
* @var resource
*/
@@ -48,7 +49,7 @@ class Memcache extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -70,11 +71,13 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -95,7 +98,9 @@ class Memcache extends CacheBase implements ICache
* Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function isDataSet($pCoord)
@@ -120,10 +125,12 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -157,7 +164,7 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -171,9 +178,10 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Delete a cell in cache identified by coordinate address
+ * Delete a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to delete
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
@@ -186,9 +194,10 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -216,7 +225,7 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -235,10 +244,11 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent, $arguments)
@@ -263,10 +273,11 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Memcache error handler
+ * Memcache error handler.
*
* @param string $host Memcache server
* @param int $port Memcache port
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function failureCallback($host, $port)
@@ -275,7 +286,7 @@ class Memcache extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
@@ -287,7 +298,7 @@ class Memcache extends CacheBase implements ICache
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php
index ac6b8622..3b776de0 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,24 +20,27 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Memory extends CacheBase implements ICache
{
/**
- * Dummy method callable from CacheBase, but unused by Memory cache
+ * Dummy method callable from CacheBase, but unused by Memory cache.
*/
protected function storeData()
{
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -51,10 +54,12 @@ class Memory extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -74,7 +79,7 @@ class Memory extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/
@@ -92,7 +97,7 @@ class Memory extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php
index 910da211..7266c2e3 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -27,7 +28,7 @@ class MemoryGZip extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -43,11 +44,13 @@ class MemoryGZip extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -64,10 +67,12 @@ class MemoryGZip extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -94,7 +99,7 @@ class MemoryGZip extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -108,7 +113,7 @@ class MemoryGZip extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php b/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php
index a348be4f..55048389 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -27,7 +28,7 @@ class MemorySerialized extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -43,11 +44,13 @@ class MemorySerialized extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -64,10 +67,12 @@ class MemorySerialized extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -94,7 +99,7 @@ class MemorySerialized extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -108,7 +113,7 @@ class MemorySerialized extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php b/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php
index 47242d60..7624e279 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class PHPTemp extends CacheBase implements ICache
{
/**
- * Name of the file for this cache
+ * Name of the file for this cache.
*
* @var string
*/
private $fileHandle = null;
/**
- * Memory limit to use before reverting to file cache
+ * Memory limit to use before reverting to file cache.
*
* @var int
*/
@@ -41,7 +42,7 @@ class PHPTemp extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -62,11 +63,13 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -83,10 +86,12 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -114,7 +119,7 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -128,7 +133,7 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/
@@ -146,7 +151,7 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -164,7 +169,7 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments
@@ -180,7 +185,7 @@ class PHPTemp extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php
index fdc9ab71..0f66ac82 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class SQLite extends CacheBase implements ICache
{
/**
- * Database table name
+ * Database table name.
*
* @var string
*/
private $TableName = null;
/**
- * Database handle
+ * Database handle.
*
* @var resource
*/
@@ -41,7 +42,7 @@ class SQLite extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -59,11 +60,13 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -80,10 +83,12 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -118,7 +123,9 @@ class SQLite extends CacheBase implements ICache
* Is a value set for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function isDataSet($pCoord)
@@ -141,9 +148,10 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Delete a cell in cache identified by coordinate address
+ * Delete a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to delete
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
@@ -163,11 +171,13 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Move a cell object from one address to another
+ * Move a cell object from one address to another.
*
* @param string $fromAddress Current address of the cell to move
* @param string $toAddress Destination address of the cell to move
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function moveCell($fromAddress, $toAddress)
@@ -192,9 +202,10 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return string[]
*/
public function getCellList()
@@ -218,9 +229,10 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -241,7 +253,7 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -257,9 +269,10 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -280,7 +293,7 @@ class SQLite extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
@@ -292,7 +305,7 @@ class SQLite extends CacheBase implements ICache
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php
index f140b932..f18516f8 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,48 +20,49 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class SQLite3 extends CacheBase implements ICache
{
/**
- * Database table name
+ * Database table name.
*
* @var string
*/
private $TableName = null;
/**
- * Database handle
+ * Database handle.
*
* @var resource
*/
private $DBHandle = null;
/**
- * Prepared statement for a SQLite3 select query
+ * Prepared statement for a SQLite3 select query.
*
* @var SQLite3Stmt
*/
private $selectQuery;
/**
- * Prepared statement for a SQLite3 insert query
+ * Prepared statement for a SQLite3 insert query.
*
* @var SQLite3Stmt
*/
private $insertQuery;
/**
- * Prepared statement for a SQLite3 update query
+ * Prepared statement for a SQLite3 update query.
*
* @var SQLite3Stmt
*/
private $updateQuery;
/**
- * Prepared statement for a SQLite3 delete query
+ * Prepared statement for a SQLite3 delete query.
*
* @var SQLite3Stmt
*/
@@ -69,7 +70,7 @@ class SQLite3 extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -90,11 +91,13 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -111,11 +114,13 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -151,7 +156,9 @@ class SQLite3 extends CacheBase implements ICache
* Is a value set for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function isDataSet($pCoord)
@@ -172,9 +179,10 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Delete a cell in cache identified by coordinate address
+ * Delete a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to delete
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
@@ -195,11 +203,13 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Move a cell object from one address to another
+ * Move a cell object from one address to another.
*
* @param string $fromAddress Current address of the cell to move
* @param string $toAddress Destination address of the cell to move
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function moveCell($fromAddress, $toAddress)
@@ -225,9 +235,10 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return string[]
*/
public function getCellList()
@@ -251,9 +262,10 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -274,7 +286,7 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -290,9 +302,10 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -318,7 +331,7 @@ class SQLite3 extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
@@ -331,7 +344,7 @@ class SQLite3 extends CacheBase implements ICache
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php
index 40a26a52..bec52f05 100644
--- a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php
+++ b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\CachedObjectStorage;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Wincache extends CacheBase implements ICache
{
/**
- * Prefix used to uniquely identify cache data for this worksheet
+ * Prefix used to uniquely identify cache data for this worksheet.
*
* @var string
*/
private $cachePrefix = null;
/**
- * Cache timeout
+ * Cache timeout.
*
* @var int
*/
@@ -41,7 +42,7 @@ class Wincache extends CacheBase implements ICache
/**
* Store cell data in cache for the current cell object if it's "dirty",
- * and the 'nullify' the current cell object
+ * and the 'nullify' the current cell object.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -69,11 +70,13 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Add or Update a cell in cache identified by coordinate address
+ * Add or Update a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell)
@@ -94,7 +97,9 @@ class Wincache extends CacheBase implements ICache
* Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function isDataSet($pCoord)
@@ -119,10 +124,12 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoord Coordinate of the cell
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
@@ -158,7 +165,7 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Get a list of all cell addresses currently held in cache
+ * Get a list of all cell addresses currently held in cache.
*
* @return string[]
*/
@@ -172,9 +179,10 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Delete a cell in cache identified by coordinate address
+ * Delete a cell in cache identified by coordinate address.
*
* @param string $pCoord Coordinate address of the cell to delete
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
@@ -187,9 +195,10 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Clone the cell collection
+ * Clone the cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent)
@@ -218,7 +227,7 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Clear the cell collection and disconnect from our parent
+ * Clear the cell collection and disconnect from our parent.
*/
public function unsetWorksheetCells()
{
@@ -237,7 +246,7 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Initialise this new cell collection
+ * Initialise this new cell collection.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments
@@ -256,7 +265,7 @@ class Wincache extends CacheBase implements ICache
}
/**
- * Destroy this cell collection
+ * Destroy this cell collection.
*/
public function __destruct()
{
@@ -268,7 +277,7 @@ class Wincache extends CacheBase implements ICache
/**
* Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
+ * Some methods are dependent on the availability of certain extensions being enabled in the PHP build.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/CachedObjectStorageFactory.php b/src/PhpSpreadsheet/CachedObjectStorageFactory.php
index 8dc37576..a8c1e4b5 100644
--- a/src/PhpSpreadsheet/CachedObjectStorageFactory.php
+++ b/src/PhpSpreadsheet/CachedObjectStorageFactory.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -38,21 +39,21 @@ class CachedObjectStorageFactory
const CACHE_TO_SQLITE3 = 'SQLite3';
/**
- * Name of the method used for cell cacheing
+ * Name of the method used for cell cacheing.
*
* @var string
*/
private static $cacheStorageMethod;
/**
- * Name of the class used for cell cacheing
+ * Name of the class used for cell cacheing.
*
* @var string
*/
private static $cacheStorageClass;
/**
- * List of all possible cache storage methods
+ * List of all possible cache storage methods.
*
* @var string[]
*/
@@ -71,7 +72,7 @@ class CachedObjectStorageFactory
];
/**
- * Default arguments for each cache storage method
+ * Default arguments for each cache storage method.
*
* @var array of mixed array
*/
@@ -102,14 +103,14 @@ class CachedObjectStorageFactory
];
/**
- * Arguments for the active cache storage method
+ * Arguments for the active cache storage method.
*
* @var mixed[]
*/
private static $storageMethodParameters = [];
/**
- * Return the current cache storage method
+ * Return the current cache storage method.
*
* @return string|null
**/
@@ -119,7 +120,7 @@ class CachedObjectStorageFactory
}
/**
- * Return the current cache storage class
+ * Return the current cache storage class.
*
* @return string
**/
@@ -129,7 +130,7 @@ class CachedObjectStorageFactory
}
/**
- * Return the list of all possible cache storage methods
+ * Return the list of all possible cache storage methods.
*
* @return string[]
**/
@@ -139,7 +140,7 @@ class CachedObjectStorageFactory
}
/**
- * Return the list of all available cache storage methods
+ * Return the list of all available cache storage methods.
*
* @return string[]
**/
@@ -157,11 +158,12 @@ class CachedObjectStorageFactory
}
/**
- * Identify the cache storage method to use
+ * Identify the cache storage method to use.
*
* @param string $method Name of the method to use for cell cacheing
* @param mixed[] $arguments Additional arguments to pass to the cell caching class
* when instantiating
+ *
* @return bool
**/
public static function initialize($method = self::CACHE_IN_MEMORY, $arguments = [])
@@ -191,9 +193,10 @@ class CachedObjectStorageFactory
}
/**
- * Initialise the cache storage
+ * Initialise the cache storage.
*
* @param Worksheet $parent Enable cell caching for this worksheet
+ *
* @return CachedObjectStorage\ICache
**/
public static function getInstance(Worksheet $parent)
@@ -217,7 +220,7 @@ class CachedObjectStorageFactory
}
/**
- * Clear the cache storage
+ * Clear the cache storage.
**/
public static function finalize()
{
diff --git a/src/PhpSpreadsheet/CalcEngine/CyclicReferenceStack.php b/src/PhpSpreadsheet/CalcEngine/CyclicReferenceStack.php
index 1d0eddf3..fad3e6b4 100644
--- a/src/PhpSpreadsheet/CalcEngine/CyclicReferenceStack.php
+++ b/src/PhpSpreadsheet/CalcEngine/CyclicReferenceStack.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CalcEngine;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\CalcEngine;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class CyclicReferenceStack
{
/**
- * The call stack for calculated cells
+ * The call stack for calculated cells.
*
* @var mixed[]
*/
private $stack = [];
/**
- * Return the number of entries on the stack
+ * Return the number of entries on the stack.
*
* @return int
*/
@@ -43,7 +44,7 @@ class CyclicReferenceStack
}
/**
- * Push a new entry onto the stack
+ * Push a new entry onto the stack.
*
* @param mixed $value
*/
@@ -53,7 +54,7 @@ class CyclicReferenceStack
}
/**
- * Pop the last entry from the stack
+ * Pop the last entry from the stack.
*
* @return mixed
*/
@@ -63,7 +64,7 @@ class CyclicReferenceStack
}
/**
- * Test to see if a specified entry exists on the stack
+ * Test to see if a specified entry exists on the stack.
*
* @param mixed $value The value to test
*/
@@ -73,7 +74,7 @@ class CyclicReferenceStack
}
/**
- * Clear the stack
+ * Clear the stack.
*/
public function clear()
{
@@ -81,7 +82,7 @@ class CyclicReferenceStack
}
/**
- * Return an array of all entries on the stack
+ * Return an array of all entries on the stack.
*
* @return mixed[]
*/
diff --git a/src/PhpSpreadsheet/CalcEngine/Logger.php b/src/PhpSpreadsheet/CalcEngine/Logger.php
index 865a6868..b81fd9ff 100644
--- a/src/PhpSpreadsheet/CalcEngine/Logger.php
+++ b/src/PhpSpreadsheet/CalcEngine/Logger.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\CalcEngine;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\CalcEngine;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -28,7 +29,7 @@ class Logger
/**
* Flag to determine whether a debug log should be generated by the calculation engine
* If true, then a debug log will be generated
- * If false, then a debug log will not be generated
+ * If false, then a debug log will not be generated.
*
* @var bool
*/
@@ -38,28 +39,28 @@ class Logger
* Flag to determine whether a debug log should be echoed by the calculation engine
* If true, then a debug log will be echoed
* If false, then a debug log will not be echoed
- * A debug log can only be echoed if it is generated
+ * A debug log can only be echoed if it is generated.
*
* @var bool
*/
private $echoDebugLog = false;
/**
- * The debug log generated by the calculation engine
+ * The debug log generated by the calculation engine.
*
* @var string[]
*/
private $debugLog = [];
/**
- * The calculation engine cell reference stack
+ * The calculation engine cell reference stack.
*
* @var CyclicReferenceStack
*/
private $cellStack;
/**
- * Instantiate a Calculation engine logger
+ * Instantiate a Calculation engine logger.
*
* @param CyclicReferenceStack $stack
*/
@@ -69,7 +70,7 @@ class Logger
}
/**
- * Enable/Disable Calculation engine logging
+ * Enable/Disable Calculation engine logging.
*
* @param bool $pValue
*/
@@ -79,7 +80,7 @@ class Logger
}
/**
- * Return whether calculation engine logging is enabled or disabled
+ * Return whether calculation engine logging is enabled or disabled.
*
* @return bool
*/
@@ -89,7 +90,7 @@ class Logger
}
/**
- * Enable/Disable echoing of debug log information
+ * Enable/Disable echoing of debug log information.
*
* @param bool $pValue
*/
@@ -99,7 +100,7 @@ class Logger
}
/**
- * Return whether echoing of debug log information is enabled or disabled
+ * Return whether echoing of debug log information is enabled or disabled.
*
* @return bool
*/
@@ -109,7 +110,7 @@ class Logger
}
/**
- * Write an entry to the calculation engine debug log
+ * Write an entry to the calculation engine debug log.
*/
public function writeDebugLog()
{
@@ -130,7 +131,7 @@ class Logger
}
/**
- * Clear the calculation engine debug log
+ * Clear the calculation engine debug log.
*/
public function clearLog()
{
@@ -138,7 +139,7 @@ class Logger
}
/**
- * Return the calculation engine debug log
+ * Return the calculation engine debug log.
*
* @return string[]
*/
diff --git a/src/PhpSpreadsheet/Calculation.php b/src/PhpSpreadsheet/Calculation.php
index 146a7348..9fcb0e41 100644
--- a/src/PhpSpreadsheet/Calculation.php
+++ b/src/PhpSpreadsheet/Calculation.php
@@ -20,7 +20,7 @@ if (!defined('CALCULATION_REGEXP_CELLREF')) {
}
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -37,13 +37,14 @@ if (!defined('CALCULATION_REGEXP_CELLREF')) {
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Calculation
{
/** Constants */
-/** Regular Expressions */
+ /** Regular Expressions */
// Numeric operand
const CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?';
// String operand
@@ -67,35 +68,35 @@ class Calculation
private static $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE;
/**
- * Instance of this class
+ * Instance of this class.
*
* @var \PhpOffice\PhpSpreadsheet\Calculation
*/
private static $instance;
/**
- * Instance of the spreadsheet this Calculation Engine is using
+ * Instance of the spreadsheet this Calculation Engine is using.
*
* @var PhpSpreadsheet
*/
private $spreadsheet;
/**
- * List of instances of the calculation engine that we've instantiated for individual spreadsheets
+ * List of instances of the calculation engine that we've instantiated for individual spreadsheets.
*
* @var \PhpOffice\PhpSpreadsheet\Calculation[]
*/
private static $spreadsheetSets;
/**
- * Calculation cache
+ * Calculation cache.
*
* @var array
*/
private $calculationCache = [];
/**
- * Calculation cache enabled
+ * Calculation cache enabled.
*
* @var bool
*/
@@ -103,7 +104,7 @@ class Calculation
/**
* List of operators that can be used within formulae
- * The true/false value indicates whether it is a binary operator or a unary operator
+ * The true/false value indicates whether it is a binary operator or a unary operator.
*
* @var array
*/
@@ -115,7 +116,7 @@ class Calculation
];
/**
- * List of binary operators (those that expect two operands)
+ * List of binary operators (those that expect two operands).
*
* @var array
*/
@@ -127,7 +128,7 @@ class Calculation
];
/**
- * The debug log generated by the calculation engine
+ * The debug log generated by the calculation engine.
*
* @var CalcEngine\Logger
*/
@@ -136,21 +137,21 @@ class Calculation
/**
* Flag to determine how formula errors should be handled
* If true, then a user error will be triggered
- * If false, then an exception will be thrown
+ * If false, then an exception will be thrown.
*
* @var bool
*/
public $suppressFormulaErrors = false;
/**
- * Error message for any error that was raised/thrown by the calculation engine
+ * Error message for any error that was raised/thrown by the calculation engine.
*
* @var string
*/
public $formulaError = null;
/**
- * An array of the nested cell references accessed by the calculation engine, used for the debug log
+ * An array of the nested cell references accessed by the calculation engine, used for the debug log.
*
* @var array of string
*/
@@ -161,7 +162,7 @@ class Calculation
/**
* Current iteration counter for cyclic formulae
* If the value is 0 (or less) then cyclic formulae will throw an exception,
- * otherwise they will iterate to the limit defined here before returning a result
+ * otherwise they will iterate to the limit defined here before returning a result.
*
* @var int
*/
@@ -170,21 +171,21 @@ class Calculation
private $cyclicFormulaCell = '';
/**
- * Number of iterations for cyclic formulae
+ * Number of iterations for cyclic formulae.
*
* @var int
*/
public $cyclicFormulaCount = 1;
/**
- * Epsilon Precision used for comparisons in calculations
+ * Epsilon Precision used for comparisons in calculations.
*
* @var float
*/
private $delta = 0.1e-12;
/**
- * The current locale setting
+ * The current locale setting.
*
* @var string
*/
@@ -192,7 +193,7 @@ class Calculation
/**
* List of available locale settings
- * Note that this is read for the locale subdirectory only when requested
+ * Note that this is read for the locale subdirectory only when requested.
*
* @var string[]
*/
@@ -201,7 +202,7 @@ class Calculation
];
/**
- * Locale-specific argument separator for function arguments
+ * Locale-specific argument separator for function arguments.
*
* @var string
*/
@@ -209,7 +210,7 @@ class Calculation
private static $localeFunctions = [];
/**
- * Locale-specific translations for Excel constants (True, False and Null)
+ * Locale-specific translations for Excel constants (True, False and Null).
*
* @var string[]
*/
@@ -221,7 +222,7 @@ class Calculation
/**
* Excel constant string translations to their PHP equivalents
- * Constant conversion from text name/value to actual (datatyped) value
+ * Constant conversion from text name/value to actual (datatyped) value.
*
* @var string[]
*/
@@ -2045,10 +2046,11 @@ class Calculation
}
/**
- * Get an instance of this class
+ * Get an instance of this class.
*
* @param Spreadsheet $spreadsheet Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object,
* or NULL to create a standalone claculation engine
+ *
* @return Calculation
*/
public static function getInstance(Spreadsheet $spreadsheet = null)
@@ -2068,7 +2070,7 @@ class Calculation
}
/**
- * Unset an instance of this class
+ * Unset an instance of this class.
*
* @param Spreadsheet $spreadsheet Injected spreadsheet identifying the instance to unset
*/
@@ -2079,7 +2081,7 @@ class Calculation
/**
* Flush the calculation cache for any existing instance of this class
- * but only if a \PhpOffice\PhpSpreadsheet\Calculation instance exists
+ * but only if a \PhpOffice\PhpSpreadsheet\Calculation instance exists.
*/
public function flushInstance()
{
@@ -2087,7 +2089,7 @@ class Calculation
}
/**
- * Get the debuglog for this claculation engine instance
+ * Get the debuglog for this claculation engine instance.
*
* @return CalcEngine\Logger
*/
@@ -2107,7 +2109,7 @@ class Calculation
}
/**
- * Return the locale-specific translation of TRUE
+ * Return the locale-specific translation of TRUE.
*
* @return string locale-specific translation of TRUE
*/
@@ -2117,7 +2119,7 @@ class Calculation
}
/**
- * Return the locale-specific translation of FALSE
+ * Return the locale-specific translation of FALSE.
*
* @return string locale-specific translation of FALSE
*/
@@ -2127,9 +2129,10 @@ class Calculation
}
/**
- * Set the Array Return Type (Array or Value of first element in the array)
+ * Set the Array Return Type (Array or Value of first element in the array).
*
* @param string $returnType Array return type
+ *
* @return bool Success or failure
*/
public static function setArrayReturnType($returnType)
@@ -2146,7 +2149,7 @@ class Calculation
}
/**
- * Return the Array Return Type (Array or Value of first element in the array)
+ * Return the Array Return Type (Array or Value of first element in the array).
*
* @return string $returnType Array return type
*/
@@ -2166,7 +2169,7 @@ class Calculation
}
/**
- * Enable/disable calculation cache
+ * Enable/disable calculation cache.
*
* @param bool $pValue
*/
@@ -2177,7 +2180,7 @@ class Calculation
}
/**
- * Enable calculation cache
+ * Enable calculation cache.
*/
public function enableCalculationCache()
{
@@ -2185,7 +2188,7 @@ class Calculation
}
/**
- * Disable calculation cache
+ * Disable calculation cache.
*/
public function disableCalculationCache()
{
@@ -2193,7 +2196,7 @@ class Calculation
}
/**
- * Clear calculation cache
+ * Clear calculation cache.
*/
public function clearCalculationCache()
{
@@ -2201,7 +2204,7 @@ class Calculation
}
/**
- * Clear calculation cache for a specified worksheet
+ * Clear calculation cache for a specified worksheet.
*
* @param string $worksheetName
*/
@@ -2213,7 +2216,7 @@ class Calculation
}
/**
- * Rename calculation cache for a specified worksheet
+ * Rename calculation cache for a specified worksheet.
*
* @param string $fromWorksheetName
* @param string $toWorksheetName
@@ -2227,7 +2230,7 @@ class Calculation
}
/**
- * Get the currently defined locale code
+ * Get the currently defined locale code.
*
* @return string
*/
@@ -2237,9 +2240,10 @@ class Calculation
}
/**
- * Set the locale code
+ * Set the locale code.
*
* @param string $locale The locale to use for formula translation
+ *
* @return bool
*/
public function setLocale($locale = 'en_us')
@@ -2347,6 +2351,9 @@ class Calculation
/**
* @param string $fromSeparator
* @param string $toSeparator
+ * @param mixed $from
+ * @param mixed $to
+ * @param mixed $formula
*/
private static function translateFormula($from, $to, $formula, $fromSeparator, $toSeparator)
{
@@ -2452,9 +2459,10 @@ class Calculation
}
/**
- * Wrap string values in quotes
+ * Wrap string values in quotes.
*
* @param mixed $value
+ *
* @return mixed
*/
public static function wrapResult($value)
@@ -2476,15 +2484,16 @@ class Calculation
}
/**
- * Remove quotes used as a wrapper to identify string values
+ * Remove quotes used as a wrapper to identify string values.
*
* @param mixed $value
+ *
* @return mixed
*/
public static function unwrapResult($value)
{
if (is_string($value)) {
- if ((isset($value{0})) && ($value{0} == '"') && (substr($value, -1) == '"')) {
+ if ((isset($value[0])) && ($value[0] == '"') && (substr($value, -1) == '"')) {
return substr($value, 1, -1);
}
// Convert numeric errors to NAN error
@@ -2497,10 +2506,12 @@ class Calculation
/**
* Calculate cell value (using formula from a cell ID)
- * Retained for backward compatibility
+ * Retained for backward compatibility.
*
* @param Cell $pCell Cell to calculate
+ *
* @throws Calculation\Exception
+ *
* @return mixed
*/
public function calculate(Cell $pCell = null)
@@ -2513,11 +2524,13 @@ class Calculation
}
/**
- * Calculate the value of a cell formula
+ * Calculate the value of a cell formula.
*
* @param Cell $pCell Cell to calculate
* @param bool $resetLog Flag indicating whether the debug log should be reset or not
+ *
* @throws Calculation\Exception
+ *
* @return mixed
*/
public function calculateCellValue(Cell $pCell = null, $resetLog = true)
@@ -2588,10 +2601,12 @@ class Calculation
}
/**
- * Validate and parse a formula string
+ * Validate and parse a formula string.
*
* @param string $formula Formula to parse
+ *
* @throws Calculation\Exception
+ *
* @return array
*/
public function parseFormula($formula)
@@ -2599,11 +2614,11 @@ class Calculation
// Basic validation that this is indeed a formula
// We return an empty array if not
$formula = trim($formula);
- if ((!isset($formula{0})) || ($formula{0} != '=')) {
+ if ((!isset($formula[0])) || ($formula[0] != '=')) {
return [];
}
$formula = ltrim(substr($formula, 1));
- if (!isset($formula{0})) {
+ if (!isset($formula[0])) {
return [];
}
@@ -2612,12 +2627,14 @@ class Calculation
}
/**
- * Calculate the value of a formula
+ * Calculate the value of a formula.
*
* @param string $formula Formula to parse
* @param string $cellID Address of the cell to calculate
* @param Cell $pCell Cell to calculate
+ *
* @throws Calculation\Exception
+ *
* @return mixed
*/
public function calculateFormula($formula, $cellID = null, Cell $pCell = null)
@@ -2670,6 +2687,7 @@ class Calculation
/**
* @param string $cellReference
+ * @param mixed $cellValue
*/
public function saveValueToCache($cellReference, $cellValue)
{
@@ -2679,12 +2697,14 @@ class Calculation
}
/**
- * Parse a cell formula and calculate its value
+ * Parse a cell formula and calculate its value.
*
* @param string $formula The formula to parse and calculate
* @param string $cellID The ID (e.g. A3) of the cell that we are calculating
* @param Cell $pCell Cell to calculate
+ *
* @throws Calculation\Exception
+ *
* @return mixed
*/
public function _calculateFormulaValue($formula, $cellID = null, Cell $pCell = null)
@@ -2694,11 +2714,11 @@ class Calculation
// Basic validation that this is indeed a formula
// We simply return the cell value if not
$formula = trim($formula);
- if ($formula{0} != '=') {
+ if ($formula[0] != '=') {
return self::wrapResult($formula);
}
$formula = ltrim(substr($formula, 1));
- if (!isset($formula{0})) {
+ if (!isset($formula[0])) {
return self::wrapResult($formula);
}
@@ -2710,7 +2730,7 @@ class Calculation
return $cellValue;
}
- if (($wsTitle{0} !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) {
+ if (($wsTitle[0] !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) {
if ($this->cyclicFormulaCount <= 0) {
$this->cyclicFormulaCell = '';
@@ -2745,7 +2765,7 @@ class Calculation
}
/**
- * Ensure that paired matrix operands are both matrices and of the same size
+ * Ensure that paired matrix operands are both matrices and of the same size.
*
* @param mixed &$operand1 First matrix operand
* @param mixed &$operand2 Second matrix operand
@@ -2788,9 +2808,10 @@ class Calculation
}
/**
- * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0
+ * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
*
* @param mixed &$matrix matrix operand
+ *
* @return int[] An array comprising the number of rows, and number of columns
*/
private static function getMatrixDimensions(&$matrix)
@@ -2811,7 +2832,7 @@ class Calculation
}
/**
- * Ensure that paired matrix operands are both matrices of the same size
+ * Ensure that paired matrix operands are both matrices of the same size.
*
* @param mixed &$matrix1 First matrix operand
* @param mixed &$matrix2 Second matrix operand
@@ -2854,7 +2875,7 @@ class Calculation
}
/**
- * Ensure that paired matrix operands are both matrices of the same size
+ * Ensure that paired matrix operands are both matrices of the same size.
*
* @param mixed &$matrix1 First matrix operand
* @param mixed &$matrix2 Second matrix operand
@@ -2901,9 +2922,10 @@ class Calculation
}
/**
- * Format details of an operand for display in the log (based on operand type)
+ * Format details of an operand for display in the log (based on operand type).
*
* @param mixed $value First matrix operand
+ *
* @return mixed
*/
private function showValue($value)
@@ -2938,9 +2960,10 @@ class Calculation
}
/**
- * Format type and details of an operand for display in the log (based on operand type)
+ * Format type and details of an operand for display in the log (based on operand type).
*
* @param mixed $value First matrix operand
+ *
* @return string|null
*/
private function showTypeDetails($value)
@@ -2964,11 +2987,10 @@ class Calculation
} else {
if ($value == '') {
return 'an empty string';
- } elseif ($value{0} == '#') {
+ } elseif ($value[0] == '#') {
return 'a ' . $value . ' error';
- } else {
- $typeString = 'a string';
}
+ $typeString = 'a string';
}
return $typeString . ' with a value of ' . $this->showValue($value);
@@ -3011,15 +3033,15 @@ class Calculation
if ($openCount < $closeCount) {
if ($openCount > 0) {
return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '}'");
- } else {
- return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered");
}
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered");
} elseif ($openCount > $closeCount) {
if ($closeCount > 0) {
return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '{'");
- } else {
- return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered");
}
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered");
}
}
@@ -3093,9 +3115,9 @@ class Calculation
// The guts of the lexical parser
// Loop through the formula extracting each operator and operand in turn
while (true) {
- $opCharacter = $formula{$index}; // Get the first character of the value at the current index position
- if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index + 1}]))) {
- $opCharacter .= $formula{++$index};
+ $opCharacter = $formula[$index]; // Get the first character of the value at the current index position
+ if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula[$index + 1]]))) {
+ $opCharacter .= $formula[++$index];
}
// Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
@@ -3126,9 +3148,8 @@ class Calculation
while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
if ($o2 === null) {
return $this->raiseFormulaError('Formula Error: Unexpected closing brace ")"');
- } else {
- $output[] = $o2;
}
+ $output[] = $o2;
}
$d = $stack->last(2);
if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
@@ -3192,9 +3213,8 @@ class Calculation
while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
if ($o2 === null) {
return $this->raiseFormulaError('Formula Error: Unexpected ,');
- } else {
- $output[] = $o2; // pop the argument expression stuff and push onto the output
}
+ $output[] = $o2; // pop the argument expression stuff and push onto the output
}
// If we've a comma when we're expecting an operand, then what we actually have is a null operand;
// so push a null onto the stack
@@ -3278,7 +3298,7 @@ class Calculation
if ($rangeWS2 != '') {
$rangeWS2 .= '!';
}
- if ((is_integer($startRowColRef)) && (ctype_digit($val)) &&
+ if ((is_int($startRowColRef)) && (ctype_digit($val)) &&
($startRowColRef <= 1048576) && ($val <= 1048576)) {
// Row range
$endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007
@@ -3301,7 +3321,7 @@ class Calculation
if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
$val = (float) $val;
} else {
- $val = (integer) $val;
+ $val = (int) $val;
}
} elseif (isset(self::$excelConstants[trim(strtoupper($val))])) {
$excelConstant = trim(strtoupper($val));
@@ -3337,16 +3357,15 @@ class Calculation
// Only valid for the % unary operator
if ((isset(self::$operators[$opCharacter])) && ($opCharacter != '%')) {
return $this->raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands");
- } else {
- break;
}
+ break;
}
// Ignore white space
- while (($formula{$index} == "\n") || ($formula{$index} == "\r")) {
+ while (($formula[$index] == "\n") || ($formula[$index] == "\r")) {
++$index;
}
- if ($formula{$index} == ' ') {
- while ($formula{$index} == ' ') {
+ if ($formula[$index] == ' ') {
+ while ($formula[$index] == ' ') {
++$index;
}
// If we're expecting an operator, but only have a space between the previous and next operands (and both are
@@ -3395,6 +3414,7 @@ class Calculation
/**
* @param string $cellID
+ * @param mixed $tokens
*/
private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
{
@@ -3734,7 +3754,7 @@ class Calculation
$excelConstant = strtoupper($token);
$stack->push('Constant Value', self::$excelConstants[$excelConstant]);
$this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant]));
- } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) {
+ } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == '"') || ($token[0] == '#')) {
$stack->push('Value', $token);
// if the token is a named range, push the named range name onto the stack
} elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) {
@@ -3775,13 +3795,13 @@ class Calculation
if (is_string($operand)) {
// We only need special validations for the operand if it is a string
// Start by stripping off the quotation marks we use to identify true excel string values internally
- if ($operand > '' && $operand{0} == '"') {
+ if ($operand > '' && $operand[0] == '"') {
$operand = self::unwrapResult($operand);
}
// If the string is a numeric value, we treat it as a numeric, so no further testing
if (!is_numeric($operand)) {
// If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
- if ($operand > '' && $operand{0} == '#') {
+ if ($operand > '' && $operand[0] == '#') {
$stack->push('Value', $operand);
$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($operand));
@@ -3839,10 +3859,10 @@ class Calculation
}
// Simple validate the two operands if they are string values
- if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') {
+ if (is_string($operand1) && $operand1 > '' && $operand1[0] == '"') {
$operand1 = self::unwrapResult($operand1);
}
- if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') {
+ if (is_string($operand2) && $operand2 > '' && $operand2[0] == '"') {
$operand2 = self::unwrapResult($operand2);
}
@@ -3923,9 +3943,11 @@ class Calculation
}
/**
- * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters
+ * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
+ *
* @param string $str1 First string value for the comparison
* @param string $str2 Second string value for the comparison
+ *
* @return int
*/
private function strcmpLowercaseFirst($str1, $str2)
@@ -3938,6 +3960,10 @@ class Calculation
/**
* @param string $matrixFunction
+ * @param mixed $cellID
+ * @param mixed $operand1
+ * @param mixed $operand2
+ * @param mixed $operation
*/
private function executeNumericBinaryOperation($cellID, $operand1, $operand2, $operation, $matrixFunction, &$stack)
{
@@ -3994,9 +4020,9 @@ class Calculation
$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails('#DIV/0!'));
return false;
- } else {
- $result = $operand1 / $operand2;
}
+ $result = $operand1 / $operand2;
+
break;
// Power
case '^':
@@ -4026,12 +4052,14 @@ class Calculation
}
/**
- * Extract range values
+ * Extract range values.
*
* @param string &$pRange String based range representation
* @param Worksheet $pSheet Worksheet
* @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
* @throws Calculation\Exception
+ *
* @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
*/
public function extractCellRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
@@ -4077,12 +4105,14 @@ class Calculation
}
/**
- * Extract range values
+ * Extract range values.
*
* @param string &$pRange String based range representation
* @param Worksheet $pSheet Worksheet
* @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
* @throws Calculation\Exception
+ *
* @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
*/
public function extractNamedRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
@@ -4146,6 +4176,7 @@ class Calculation
* Is a specific function implemented?
*
* @param string $pFunction Function Name
+ *
* @return bool
*/
public function isImplemented($pFunction = '')
@@ -4153,13 +4184,13 @@ class Calculation
$pFunction = strtoupper($pFunction);
if (isset(self::$phpSpreadsheetFunctions[$pFunction])) {
return self::$phpSpreadsheetFunctions[$pFunction]['functionCall'] !== '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Functions::DUMMY';
- } else {
- return false;
}
+
+ return false;
}
/**
- * Get a list of all implemented functions as an array of function objects
+ * Get a list of all implemented functions as an array of function objects.
*
* @return array of Calculation\Category
*/
@@ -4169,7 +4200,7 @@ class Calculation
}
/**
- * Get a list of implemented Excel function names
+ * Get a list of implemented Excel function names.
*
* @return array
*/
diff --git a/src/PhpSpreadsheet/Calculation/Category.php b/src/PhpSpreadsheet/Calculation/Category.php
index 75a977f2..ae876516 100644
--- a/src/PhpSpreadsheet/Calculation/Category.php
+++ b/src/PhpSpreadsheet/Calculation/Category.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
diff --git a/src/PhpSpreadsheet/Calculation/Database.php b/src/PhpSpreadsheet/Calculation/Database.php
index ea50c98c..90c97f25 100644
--- a/src/PhpSpreadsheet/Calculation/Database.php
+++ b/src/PhpSpreadsheet/Calculation/Database.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Database
{
/**
- * fieldExtract
+ * fieldExtract.
*
* Extracts the column ID to use for the data field.
*
@@ -39,6 +40,7 @@ class Database
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
+ *
* @return string|null
*/
private static function fieldExtract($database, $field)
@@ -57,7 +59,7 @@ class Database
}
/**
- * filter
+ * filter.
*
* Parses the selection criteria, extracts the database rows that match those criteria, and
* returns that subset of rows.
@@ -71,6 +73,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return array of mixed
*/
private static function filter($database, $criteria)
@@ -142,7 +145,7 @@ class Database
}
/**
- * DAVERAGE
+ * DAVERAGE.
*
* Averages the values in a column of a list or database that match conditions you specify.
*
@@ -150,6 +153,7 @@ class Database
* DAVERAGE(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -164,6 +168,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DAVERAGE($database, $field, $criteria)
@@ -180,7 +185,7 @@ class Database
}
/**
- * DCOUNT
+ * DCOUNT.
*
* Counts the cells that contain numbers in a column of a list or database that match conditions
* that you specify.
@@ -192,6 +197,7 @@ class Database
* DAVERAGE(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -206,6 +212,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return int
*
* @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the
@@ -225,7 +232,7 @@ class Database
}
/**
- * DCOUNTA
+ * DCOUNTA.
*
* Counts the nonblank cells in a column of a list or database that match conditions that you specify.
*
@@ -233,6 +240,7 @@ class Database
* DCOUNTA(database,[field],criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -247,6 +255,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return int
*
* @TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the
@@ -274,7 +283,7 @@ class Database
}
/**
- * DGET
+ * DGET.
*
* Extracts a single value from a column of a list or database that matches conditions that you
* specify.
@@ -283,6 +292,7 @@ class Database
* DGET(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -297,6 +307,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return mixed
*/
public static function DGET($database, $field, $criteria)
@@ -316,7 +327,7 @@ class Database
}
/**
- * DMAX
+ * DMAX.
*
* Returns the largest number in a column of a list or database that matches conditions you that
* specify.
@@ -325,6 +336,7 @@ class Database
* DMAX(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -339,6 +351,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DMAX($database, $field, $criteria)
@@ -355,7 +368,7 @@ class Database
}
/**
- * DMIN
+ * DMIN.
*
* Returns the smallest number in a column of a list or database that matches conditions you that
* specify.
@@ -364,6 +377,7 @@ class Database
* DMIN(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -378,6 +392,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DMIN($database, $field, $criteria)
@@ -394,7 +409,7 @@ class Database
}
/**
- * DPRODUCT
+ * DPRODUCT.
*
* Multiplies the values in a column of a list or database that match conditions that you specify.
*
@@ -402,6 +417,7 @@ class Database
* DPRODUCT(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -416,6 +432,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DPRODUCT($database, $field, $criteria)
@@ -432,7 +449,7 @@ class Database
}
/**
- * DSTDEV
+ * DSTDEV.
*
* Estimates the standard deviation of a population based on a sample by using the numbers in a
* column of a list or database that match conditions that you specify.
@@ -441,6 +458,7 @@ class Database
* DSTDEV(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -455,6 +473,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DSTDEV($database, $field, $criteria)
@@ -471,7 +490,7 @@ class Database
}
/**
- * DSTDEVP
+ * DSTDEVP.
*
* Calculates the standard deviation of a population based on the entire population by using the
* numbers in a column of a list or database that match conditions that you specify.
@@ -480,6 +499,7 @@ class Database
* DSTDEVP(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -494,6 +514,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DSTDEVP($database, $field, $criteria)
@@ -510,7 +531,7 @@ class Database
}
/**
- * DSUM
+ * DSUM.
*
* Adds the numbers in a column of a list or database that match conditions that you specify.
*
@@ -518,6 +539,7 @@ class Database
* DSUM(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -532,6 +554,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DSUM($database, $field, $criteria)
@@ -548,7 +571,7 @@ class Database
}
/**
- * DVAR
+ * DVAR.
*
* Estimates the variance of a population based on a sample by using the numbers in a column
* of a list or database that match conditions that you specify.
@@ -557,6 +580,7 @@ class Database
* DVAR(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -571,6 +595,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DVAR($database, $field, $criteria)
@@ -587,7 +612,7 @@ class Database
}
/**
- * DVARP
+ * DVARP.
*
* Calculates the variance of a population based on the entire population by using the numbers
* in a column of a list or database that match conditions that you specify.
@@ -596,6 +621,7 @@ class Database
* DVARP(database,field,criteria)
*
* @category Database Functions
+ *
* @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
@@ -610,6 +636,7 @@ class Database
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
+ *
* @return float
*/
public static function DVARP($database, $field, $criteria)
diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php
index 16164814..23f0d9e2 100644
--- a/src/PhpSpreadsheet/Calculation/DateTime.php
+++ b/src/PhpSpreadsheet/Calculation/DateTime.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,15 +20,17 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class DateTime
{
/**
- * Identify if a year is a leap year or not
+ * Identify if a year is a leap year or not.
*
* @param int $year The year to test
+ *
* @return bool TRUE if the year is a leap year, otherwise FALSE
*/
public static function isLeapYear($year)
@@ -37,7 +39,7 @@ class DateTime
}
/**
- * Return the number of days between two dates based on a 360 day calendar
+ * Return the number of days between two dates based on a 360 day calendar.
*
* @param int $startDay Day of month of the start date
* @param int $startMonth Month of the start date
@@ -46,6 +48,7 @@ class DateTime
* @param int $endMonth Month of the start date
* @param int $endYear Year of the start date
* @param bool $methodUS Whether to use the US method or the European method of calculation
+ *
* @return int Number of days between the start date and the end date
*/
private static function dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, $methodUS)
@@ -73,9 +76,10 @@ class DateTime
}
/**
- * getDateValue
+ * getDateValue.
*
* @param string $dateValue
+ *
* @return mixed Excel date/time serial value, or string if error
*/
public static function getDateValue($dateValue)
@@ -99,9 +103,10 @@ class DateTime
}
/**
- * getTimeValue
+ * getTimeValue.
*
* @param string $timeValue
+ *
* @return mixed Excel date/time serial value, or string if error
*/
private static function getTimeValue($timeValue)
@@ -142,7 +147,7 @@ class DateTime
}
/**
- * DATETIMENOW
+ * DATETIMENOW.
*
* Returns the current date and time.
* The NOW function is useful when you need to display the current date and time on a worksheet or
@@ -156,6 +161,7 @@ class DateTime
* NOW()
*
* @category Date/Time Functions
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -169,7 +175,7 @@ class DateTime
$retValue = (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(time());
break;
case Functions::RETURNDATE_PHP_NUMERIC:
- $retValue = (integer) time();
+ $retValue = (int) time();
break;
case Functions::RETURNDATE_PHP_OBJECT:
$retValue = new \DateTime();
@@ -181,7 +187,7 @@ class DateTime
}
/**
- * DATENOW
+ * DATENOW.
*
* Returns the current date.
* The NOW function is useful when you need to display the current date and time on a worksheet or
@@ -195,6 +201,7 @@ class DateTime
* TODAY()
*
* @category Date/Time Functions
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -209,7 +216,7 @@ class DateTime
$retValue = (float) $excelDateTime;
break;
case Functions::RETURNDATE_PHP_NUMERIC:
- $retValue = (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime);
+ $retValue = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime);
break;
case Functions::RETURNDATE_PHP_OBJECT:
$retValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime);
@@ -221,7 +228,7 @@ class DateTime
}
/**
- * DATE
+ * DATE.
*
* The DATE function returns a value that represents a particular date.
*
@@ -236,6 +243,7 @@ class DateTime
* as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.
*
* @category Date/Time Functions
+ *
* @param int $year The value of the year argument can include one to four digits.
* Excel interprets the year argument according to the configured
* date system: 1900 or 1904.
@@ -266,6 +274,7 @@ class DateTime
* days, plus one, from the first day of the month specified. For
* example, DATE(2008,1,-15) returns the serial number representing
* December 16, 2007.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -291,9 +300,9 @@ class DateTime
(!is_numeric($day))) {
return Functions::VALUE();
}
- $year = (integer) $year;
- $month = (integer) $month;
- $day = (integer) $day;
+ $year = (int) $year;
+ $month = (int) $month;
+ $day = (int) $day;
$baseYear = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar();
// Validate parameters
@@ -330,14 +339,14 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT:
return \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateValue);
}
}
/**
- * TIME
+ * TIME.
*
* The TIME function returns a value that represents a particular time.
*
@@ -348,6 +357,7 @@ class DateTime
* TIME(hour,minute,second)
*
* @category Date/Time Functions
+ *
* @param int $hour A number from 0 (zero) to 32767 representing the hour.
* Any value greater than 23 will be divided by 24 and the remainder
* will be treated as the hour value. For example, TIME(27,0,0) =
@@ -359,6 +369,7 @@ class DateTime
* Any value greater than 59 will be converted to hours, minutes,
* and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148
* or 12:33:20 AM
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -381,9 +392,9 @@ class DateTime
if ((!is_numeric($hour)) || (!is_numeric($minute)) || (!is_numeric($second))) {
return Functions::VALUE();
}
- $hour = (integer) $hour;
- $minute = (integer) $minute;
- $second = (integer) $second;
+ $hour = (int) $hour;
+ $minute = (int) $minute;
+ $second = (int) $second;
if ($second < 0) {
$minute += floor($second / 60);
@@ -423,7 +434,7 @@ class DateTime
return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
case Functions::RETURNDATE_PHP_OBJECT:
$dayAdjust = 0;
if ($hour < 0) {
@@ -446,7 +457,7 @@ class DateTime
}
/**
- * DATEVALUE
+ * DATEVALUE.
*
* Returns a value that represents a particular date.
* Use DATEVALUE to convert a date represented by a text string to an Excel or PHP date/time stamp
@@ -459,6 +470,7 @@ class DateTime
* DATEVALUE(dateValue)
*
* @category Date/Time Functions
+ *
* @param string $dateValue Text that represents a date in a Microsoft Excel date format.
* For example, "1/30/2008" or "30-Jan-2008" are text strings within
* quotation marks that represent dates. Using the default date
@@ -467,6 +479,7 @@ class DateTime
* system in Excel for the Macintosh, date_text must represent a date
* from January 1, 1904, to December 31, 9999. DATEVALUE returns the
* #VALUE! error value if date_text is out of this range.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -485,12 +498,11 @@ class DateTime
if ((is_numeric($t)) && ($t > 31)) {
if ($yearFound) {
return Functions::VALUE();
- } else {
- if ($t < 100) {
- $t += 1900;
- }
- $yearFound = true;
}
+ if ($t < 100) {
+ $t += 1900;
+ }
+ $yearFound = true;
}
}
if ((count($t1) == 1) && (strpos($t, ':') != false)) {
@@ -571,7 +583,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00');
}
@@ -581,7 +593,7 @@ class DateTime
}
/**
- * TIMEVALUE
+ * TIMEVALUE.
*
* Returns a value that represents a particular time.
* Use TIMEVALUE to convert a time represented by a text string to an Excel or PHP date/time stamp
@@ -594,10 +606,12 @@ class DateTime
* TIMEVALUE(timeValue)
*
* @category Date/Time Functions
+ *
* @param string $timeValue A text string that represents a time in any one of the Microsoft
* Excel time formats; for example, "6:45 PM" and "18:45" text strings
* within quotation marks that represent time.
* Date information in time_text is ignored.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -631,7 +645,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) $phpDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue + 25569) - 3600;
+ return (int) $phpDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue + 25569) - 3600;
case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']);
}
@@ -641,13 +655,14 @@ class DateTime
}
/**
- * DATEDIF
+ * DATEDIF.
*
* @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object
* or a standard date string
* @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object
* or a standard date string
* @param string $unit
+ *
* @return int Interval between the dates
*/
public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D')
@@ -684,17 +699,17 @@ class DateTime
$retVal = Functions::NAN();
switch ($unit) {
case 'D':
- $retVal = intval($difference);
+ $retVal = (int) $difference;
break;
case 'M':
- $retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12);
+ $retVal = (int) ($endMonths - $startMonths) + ((int) ($endYears - $startYears) * 12);
// We're only interested in full months
if ($endDays < $startDays) {
--$retVal;
}
break;
case 'Y':
- $retVal = intval($endYears - $startYears);
+ $retVal = (int) ($endYears - $startYears);
// We're only interested in full months
if ($endMonths < $startMonths) {
--$retVal;
@@ -716,7 +731,7 @@ class DateTime
}
break;
case 'YM':
- $retVal = intval($endMonths - $startMonths);
+ $retVal = (int) ($endMonths - $startMonths);
if ($retVal < 0) {
$retVal += 12;
}
@@ -726,7 +741,7 @@ class DateTime
}
break;
case 'YD':
- $retVal = intval($difference);
+ $retVal = (int) $difference;
if ($endYears > $startYears) {
$isLeapStartYear = $PHPStartDateObject->format('L');
$wasLeapEndYear = $PHPEndDateObject->format('L');
@@ -757,7 +772,7 @@ class DateTime
}
/**
- * DAYS360
+ * DAYS360.
*
* Returns the number of days between two dates based on a 360-day year (twelve 30-day months),
* which is used in some accounting calculations. Use this function to help compute payments if
@@ -767,6 +782,7 @@ class DateTime
* DAYS360(startDate,endDate[,method])
*
* @category Date/Time Functions
+ *
* @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
* @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
@@ -782,6 +798,7 @@ class DateTime
* TRUE: European method. Starting dates and ending dates that
* occur on the 31st of a month become equal to the 30th of the
* same month.
+ *
* @return int Number of days between start date and end date
*/
public static function DAYS360($startDate = 0, $endDate = 0, $method = false)
@@ -815,7 +832,7 @@ class DateTime
}
/**
- * YEARFRAC
+ * YEARFRAC.
*
* Calculates the fraction of the year represented by the number of whole days between two dates
* (the start_date and the end_date).
@@ -826,6 +843,7 @@ class DateTime
* YEARFRAC(startDate,endDate[,method])
*
* @category Date/Time Functions
+ *
* @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
* @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
@@ -836,6 +854,7 @@ class DateTime
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ *
* @return float fraction of the year
*/
public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0)
@@ -913,7 +932,7 @@ class DateTime
}
/**
- * NETWORKDAYS
+ * NETWORKDAYS.
*
* Returns the number of whole working days between start_date and end_date. Working days
* exclude weekends and any dates identified in holidays.
@@ -924,10 +943,12 @@ class DateTime
* NETWORKDAYS(startDate,endDate[,holidays[,holiday[,...]]])
*
* @category Date/Time Functions
+ *
* @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
* @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
+ *
* @return int Interval between the dates
*/
public static function NETWORKDAYS($startDate, $endDate)
@@ -993,7 +1014,7 @@ class DateTime
}
/**
- * WORKDAY
+ * WORKDAY.
*
* Returns the date that is the indicated number of working days before or after a date (the
* starting date). Working days exclude weekends and any dates identified as holidays.
@@ -1004,11 +1025,13 @@ class DateTime
* WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])
*
* @category Date/Time Functions
+ *
* @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
* @param int $endDays The number of nonweekend and nonholiday days before or after
* startDate. A positive value for days yields a future date; a
* negative value yields a past date.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -1043,7 +1066,7 @@ class DateTime
}
// Add endDays
- $endDate = (float) $startDate + (intval($endDays / 5) * 7) + ($endDays % 5);
+ $endDate = (float) $startDate + ((int) ($endDays / 5) * 7) + ($endDays % 5);
// Adjust the calculated end date if it falls over a weekend
$endDoW = self::WEEKDAY($endDate, 3);
@@ -1097,14 +1120,14 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $endDate;
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate);
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate);
case Functions::RETURNDATE_PHP_OBJECT:
return \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
}
}
/**
- * DAYOFMONTH
+ * DAYOFMONTH.
*
* Returns the day of the month, for a specified date. The day is given as an integer
* ranging from 1 to 31.
@@ -1114,6 +1137,7 @@ class DateTime
*
* @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
+ *
* @return int Day of the month
*/
public static function DAYOFMONTH($dateValue = 1)
@@ -1137,7 +1161,7 @@ class DateTime
}
/**
- * WEEKDAY
+ * WEEKDAY.
*
* Returns the day of the week for a specified date. The day is given as an integer
* ranging from 0 to 7 (dependent on the requested style).
@@ -1151,6 +1175,7 @@ class DateTime
* 1 or omitted Numbers 1 (Sunday) through 7 (Saturday).
* 2 Numbers 1 (Monday) through 7 (Sunday).
* 3 Numbers 0 (Monday) through 6 (Sunday).
+ *
* @return int Day of the week value
*/
public static function WEEKDAY($dateValue = 1, $style = 1)
@@ -1209,7 +1234,7 @@ class DateTime
}
/**
- * WEEKNUM
+ * WEEKNUM.
*
* Returns the week of the year for a specified date.
* The WEEKNUM function considers the week containing January 1 to be the first week of the year.
@@ -1226,6 +1251,7 @@ class DateTime
* @param int $method Week begins on Sunday or Monday
* 1 or omitted Week begins on Sunday.
* 2 Week begins on Monday.
+ *
* @return int Week Number
*/
public static function WEEKNUM($dateValue = 1, $method = 1)
@@ -1265,7 +1291,7 @@ class DateTime
}
/**
- * MONTHOFYEAR
+ * MONTHOFYEAR.
*
* Returns the month of a date represented by a serial number.
* The month is given as an integer, ranging from 1 (January) to 12 (December).
@@ -1275,6 +1301,7 @@ class DateTime
*
* @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
+ *
* @return int Month of the year
*/
public static function MONTHOFYEAR($dateValue = 1)
@@ -1297,7 +1324,7 @@ class DateTime
}
/**
- * YEAR
+ * YEAR.
*
* Returns the year corresponding to a date.
* The year is returned as an integer in the range 1900-9999.
@@ -1307,6 +1334,7 @@ class DateTime
*
* @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
+ *
* @return int Year
*/
public static function YEAR($dateValue = 1)
@@ -1328,7 +1356,7 @@ class DateTime
}
/**
- * HOUROFDAY
+ * HOUROFDAY.
*
* Returns the hour of a time value.
* The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).
@@ -1338,6 +1366,7 @@ class DateTime
*
* @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
+ *
* @return int Hour
*/
public static function HOUROFDAY($timeValue = 0)
@@ -1368,7 +1397,7 @@ class DateTime
}
/**
- * MINUTE
+ * MINUTE.
*
* Returns the minutes of a time value.
* The minute is given as an integer, ranging from 0 to 59.
@@ -1378,6 +1407,7 @@ class DateTime
*
* @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
+ *
* @return int Minute
*/
public static function MINUTE($timeValue = 0)
@@ -1408,7 +1438,7 @@ class DateTime
}
/**
- * SECOND
+ * SECOND.
*
* Returns the seconds of a time value.
* The second is given as an integer in the range 0 (zero) to 59.
@@ -1418,6 +1448,7 @@ class DateTime
*
* @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
+ *
* @return int Second
*/
public static function SECOND($timeValue = 0)
@@ -1448,7 +1479,7 @@ class DateTime
}
/**
- * EDATE
+ * EDATE.
*
* Returns the serial number that represents the date that is the indicated number of months
* before or after a specified date (the start_date).
@@ -1463,6 +1494,7 @@ class DateTime
* @param int $adjustmentMonths The number of months before or after start_date.
* A positive value for months yields a future date;
* a negative value yields a past date.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -1487,14 +1519,14 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject;
}
}
/**
- * EOMONTH
+ * EOMONTH.
*
* Returns the date value for the last day of the month that is the indicated number of months
* before or after start_date.
@@ -1508,6 +1540,7 @@ class DateTime
* @param int $adjustmentMonths The number of months before or after start_date.
* A positive value for months yields a future date;
* a negative value yields a past date.
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -1535,7 +1568,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
+ return (int) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject;
}
diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php
index ff598ab4..04fa6a1f 100644
--- a/src/PhpSpreadsheet/Calculation/Engineering.php
+++ b/src/PhpSpreadsheet/Calculation/Engineering.php
@@ -6,7 +6,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
define('EULER', 2.71828182845904523536);
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -23,13 +23,14 @@ define('EULER', 2.71828182845904523536);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Engineering
{
/**
- * Details of the Units of measure that can be used in CONVERTUOM()
+ * Details of the Units of measure that can be used in CONVERTUOM().
*
* @var mixed[]
*/
@@ -100,7 +101,7 @@ class Engineering
];
/**
- * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
+ * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
*
* @var mixed[]
*/
@@ -128,7 +129,7 @@ class Engineering
];
/**
- * Details of the Units of measure conversion factors, organised by group
+ * Details of the Units of measure conversion factors, organised by group.
*
* @var mixed[]
*/
@@ -733,11 +734,12 @@ class Engineering
];
/**
- * parseComplex
+ * parseComplex.
*
* Parses a complex number into its real and imaginary parts, and an I or J suffix
*
* @param string $complexNumber The complex number
+ *
* @return string[] Indexed on "real", "imaginary" and "suffix"
*/
public static function parseComplex($complexNumber)
@@ -756,7 +758,7 @@ class Engineering
// Split the input into its Real and Imaginary components
$leadingSign = 0;
if (strlen($workString) > 0) {
- $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
+ $leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0;
}
$power = '';
$realNumber = strtok($workString, '+-');
@@ -789,23 +791,24 @@ class Engineering
}
/**
- * Cleans the leading characters in a complex number string
+ * Cleans the leading characters in a complex number string.
*
* @param string $complexNumber The complex number to clean
+ *
* @return string The "cleaned" complex number
*/
private static function cleanComplex($complexNumber)
{
- if ($complexNumber{0} == '+') {
+ if ($complexNumber[0] == '+') {
$complexNumber = substr($complexNumber, 1);
}
- if ($complexNumber{0} == '0') {
+ if ($complexNumber[0] == '0') {
$complexNumber = substr($complexNumber, 1);
}
- if ($complexNumber{0} == '.') {
+ if ($complexNumber[0] == '.') {
$complexNumber = '0' . $complexNumber;
}
- if ($complexNumber{0} == '+') {
+ if ($complexNumber[0] == '+') {
$complexNumber = substr($complexNumber, 1);
}
@@ -813,10 +816,11 @@ class Engineering
}
/**
- * Formats a number base string value with leading zeroes
+ * Formats a number base string value with leading zeroes.
*
* @param string $xVal The "number" to pad
* @param int $places The length that we want to pad this value
+ *
* @return string The padded "number"
*/
private static function nbrConversionFormat($xVal, $places)
@@ -832,16 +836,16 @@ class Engineering
}
if (strlen($xVal) <= $places) {
return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
- } else {
- return Functions::NAN();
}
+
+ return Functions::NAN();
}
return substr($xVal, -10);
}
/**
- * BESSELI
+ * BESSELI.
*
* Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated
* for purely imaginary arguments
@@ -850,12 +854,14 @@ class Engineering
* BESSELI(x,ord)
*
* @category Engineering Functions
+ *
* @param float $x The value at which to evaluate the function.
* If x is nonnumeric, BESSELI returns the #VALUE! error value.
* @param int $ord The order of the Bessel function.
* If ord is not an integer, it is truncated.
* If $ord is nonnumeric, BESSELI returns the #VALUE! error value.
* If $ord < 0, BESSELI returns the #NUM! error value.
+ *
* @return float
*/
public static function BESSELI($x, $ord)
@@ -895,7 +901,7 @@ class Engineering
}
/**
- * BESSELJ
+ * BESSELJ.
*
* Returns the Bessel function
*
@@ -903,11 +909,13 @@ class Engineering
* BESSELJ(x,ord)
*
* @category Engineering Functions
+ *
* @param float $x The value at which to evaluate the function.
* If x is nonnumeric, BESSELJ returns the #VALUE! error value.
* @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
* If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
* If $ord < 0, BESSELJ returns the #NUM! error value.
+ *
* @return float
*/
public static function BESSELJ($x, $ord)
@@ -985,7 +993,7 @@ class Engineering
}
/**
- * BESSELK
+ * BESSELK.
*
* Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated
* for purely imaginary arguments.
@@ -994,11 +1002,13 @@ class Engineering
* BESSELK(x,ord)
*
* @category Engineering Functions
+ *
* @param float $x The value at which to evaluate the function.
* If x is nonnumeric, BESSELK returns the #VALUE! error value.
* @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
* If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
* If $ord < 0, BESSELK returns the #NUM! error value.
+ *
* @return float
*/
public static function BESSELK($x, $ord)
@@ -1071,7 +1081,7 @@ class Engineering
}
/**
- * BESSELY
+ * BESSELY.
*
* Returns the Bessel function, which is also called the Weber function or the Neumann function.
*
@@ -1079,6 +1089,7 @@ class Engineering
* BESSELY(x,ord)
*
* @category Engineering Functions
+ *
* @param float $x The value at which to evaluate the function.
* If x is nonnumeric, BESSELK returns the #VALUE! error value.
* @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
@@ -1122,7 +1133,7 @@ class Engineering
}
/**
- * BINTODEC
+ * BINTODEC.
*
* Return a binary value as decimal.
*
@@ -1130,12 +1141,14 @@ class Engineering
* BIN2DEC(x)
*
* @category Engineering Functions
+ *
* @param string $x The binary number (as a string) that you want to convert. The number
* cannot contain more than 10 characters (10 bits). The most significant
* bit of number is the sign bit. The remaining 9 bits are magnitude bits.
* Negative numbers are represented using two's-complement notation.
* If number is not a valid binary number, or if number contains more than
* 10 characters (10 bits), BIN2DEC returns the #NUM! error value.
+ *
* @return string
*/
public static function BINTODEC($x)
@@ -1169,7 +1182,7 @@ class Engineering
}
/**
- * BINTOHEX
+ * BINTOHEX.
*
* Return a binary value as hex.
*
@@ -1177,6 +1190,7 @@ class Engineering
* BIN2HEX(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The binary number (as a string) that you want to convert. The number
* cannot contain more than 10 characters (10 bits). The most significant
* bit of number is the sign bit. The remaining 9 bits are magnitude bits.
@@ -1189,6 +1203,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
* If places is negative, BIN2HEX returns the #NUM! error value.
+ *
* @return string
*/
public static function BINTOHEX($x, $places = null)
@@ -1223,7 +1238,7 @@ class Engineering
}
/**
- * BINTOOCT
+ * BINTOOCT.
*
* Return a binary value as octal.
*
@@ -1231,6 +1246,7 @@ class Engineering
* BIN2OCT(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The binary number (as a string) that you want to convert. The number
* cannot contain more than 10 characters (10 bits). The most significant
* bit of number is the sign bit. The remaining 9 bits are magnitude bits.
@@ -1243,6 +1259,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, BIN2OCT returns the #VALUE! error value.
* If places is negative, BIN2OCT returns the #NUM! error value.
+ *
* @return string
*/
public static function BINTOOCT($x, $places = null)
@@ -1276,7 +1293,7 @@ class Engineering
}
/**
- * DECTOBIN
+ * DECTOBIN.
*
* Return a decimal value as binary.
*
@@ -1284,6 +1301,7 @@ class Engineering
* DEC2BIN(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The decimal integer you want to convert. If number is negative,
* valid place values are ignored and DEC2BIN returns a 10-character
* (10-bit) binary number in which the most significant bit is the sign
@@ -1300,6 +1318,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
* If places is zero or negative, DEC2BIN returns the #NUM! error value.
+ *
* @return string
*/
public static function DECTOBIN($x, $places = null)
@@ -1335,7 +1354,7 @@ class Engineering
}
/**
- * DECTOHEX
+ * DECTOHEX.
*
* Return a decimal value as hex.
*
@@ -1343,6 +1362,7 @@ class Engineering
* DEC2HEX(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The decimal integer you want to convert. If number is negative,
* places is ignored and DEC2HEX returns a 10-character (40-bit)
* hexadecimal number in which the most significant bit is the sign
@@ -1359,6 +1379,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
* If places is zero or negative, DEC2HEX returns the #NUM! error value.
+ *
* @return string
*/
public static function DECTOHEX($x, $places = null)
@@ -1388,7 +1409,7 @@ class Engineering
}
/**
- * DECTOOCT
+ * DECTOOCT.
*
* Return an decimal value as octal.
*
@@ -1396,6 +1417,7 @@ class Engineering
* DEC2OCT(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The decimal integer you want to convert. If number is negative,
* places is ignored and DEC2OCT returns a 10-character (30-bit)
* octal number in which the most significant bit is the sign bit.
@@ -1412,6 +1434,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
* If places is zero or negative, DEC2OCT returns the #NUM! error value.
+ *
* @return string
*/
public static function DECTOOCT($x, $places = null)
@@ -1442,7 +1465,7 @@ class Engineering
}
/**
- * HEXTOBIN
+ * HEXTOBIN.
*
* Return a hex value as binary.
*
@@ -1450,6 +1473,7 @@ class Engineering
* HEX2BIN(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x the hexadecimal number you want to convert.
* Number cannot contain more than 10 characters.
* The most significant bit of number is the sign bit (40th bit from the right).
@@ -1466,6 +1490,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, HEX2BIN returns the #VALUE! error value.
* If places is negative, HEX2BIN returns the #NUM! error value.
+ *
* @return string
*/
public static function HEXTOBIN($x, $places = null)
@@ -1485,7 +1510,7 @@ class Engineering
}
/**
- * HEXTODEC
+ * HEXTODEC.
*
* Return a hex value as decimal.
*
@@ -1493,6 +1518,7 @@ class Engineering
* HEX2DEC(x)
*
* @category Engineering Functions
+ *
* @param string $x The hexadecimal number you want to convert. This number cannot
* contain more than 10 characters (40 bits). The most significant
* bit of number is the sign bit. The remaining 39 bits are magnitude
@@ -1500,6 +1526,7 @@ class Engineering
* notation.
* If number is not a valid hexadecimal number, HEX2DEC returns the
* #NUM! error value.
+ *
* @return string
*/
public static function HEXTODEC($x)
@@ -1534,7 +1561,7 @@ class Engineering
}
/**
- * HEXTOOCT
+ * HEXTOOCT.
*
* Return a hex value as octal.
*
@@ -1542,6 +1569,7 @@ class Engineering
* HEX2OCT(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The hexadecimal number you want to convert. Number cannot
* contain more than 10 characters. The most significant bit of
* number is the sign bit. The remaining 39 bits are magnitude
@@ -1562,6 +1590,7 @@ class Engineering
* If places is nonnumeric, HEX2OCT returns the #VALUE! error
* value.
* If places is negative, HEX2OCT returns the #NUM! error value.
+ *
* @return string
*/
public static function HEXTOOCT($x, $places = null)
@@ -1586,7 +1615,7 @@ class Engineering
}
/**
- * OCTTOBIN
+ * OCTTOBIN.
*
* Return an octal value as binary.
*
@@ -1594,6 +1623,7 @@ class Engineering
* OCT2BIN(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The octal number you want to convert. Number may not
* contain more than 10 characters. The most significant
* bit of number is the sign bit. The remaining 29 bits
@@ -1616,6 +1646,7 @@ class Engineering
* error value.
* If places is negative, OCT2BIN returns the #NUM! error
* value.
+ *
* @return string
*/
public static function OCTTOBIN($x, $places = null)
@@ -1635,7 +1666,7 @@ class Engineering
}
/**
- * OCTTODEC
+ * OCTTODEC.
*
* Return an octal value as decimal.
*
@@ -1643,6 +1674,7 @@ class Engineering
* OCT2DEC(x)
*
* @category Engineering Functions
+ *
* @param string $x The octal number you want to convert. Number may not contain
* more than 10 octal characters (30 bits). The most significant
* bit of number is the sign bit. The remaining 29 bits are
@@ -1650,6 +1682,7 @@ class Engineering
* two's-complement notation.
* If number is not a valid octal number, OCT2DEC returns the
* #NUM! error value.
+ *
* @return string
*/
public static function OCTTODEC($x)
@@ -1679,7 +1712,7 @@ class Engineering
}
/**
- * OCTTOHEX
+ * OCTTOHEX.
*
* Return an octal value as hex.
*
@@ -1687,6 +1720,7 @@ class Engineering
* OCT2HEX(x[,places])
*
* @category Engineering Functions
+ *
* @param string $x The octal number you want to convert. Number may not contain
* more than 10 octal characters (30 bits). The most significant
* bit of number is the sign bit. The remaining 29 bits are
@@ -1704,6 +1738,7 @@ class Engineering
* If places is not an integer, it is truncated.
* If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
* If places is negative, OCT2HEX returns the #NUM! error value.
+ *
* @return string
*/
public static function OCTTOHEX($x, $places = null)
@@ -1724,7 +1759,7 @@ class Engineering
}
/**
- * COMPLEX
+ * COMPLEX.
*
* Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.
*
@@ -1732,10 +1767,12 @@ class Engineering
* COMPLEX(realNumber,imaginary[,places])
*
* @category Engineering Functions
- * @param float $realNumber The real coefficient of the complex number.
- * @param float $imaginary The imaginary coefficient of the complex number.
+ *
+ * @param float $realNumber the real coefficient of the complex number
+ * @param float $imaginary the imaginary coefficient of the complex number
* @param string $suffix The suffix for the imaginary component of the complex number.
* If omitted, the suffix is assumed to be "i".
+ *
* @return string
*/
public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')
@@ -1781,7 +1818,7 @@ class Engineering
}
/**
- * IMAGINARY
+ * IMAGINARY.
*
* Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
*
@@ -1789,8 +1826,10 @@ class Engineering
* IMAGINARY(complexNumber)
*
* @category Engineering Functions
- * @param string $complexNumber The complex number for which you want the imaginary
- * coefficient.
+ *
+ * @param string $complexNumber the complex number for which you want the imaginary
+ * coefficient
+ *
* @return float
*/
public static function IMAGINARY($complexNumber)
@@ -1803,7 +1842,7 @@ class Engineering
}
/**
- * IMREAL
+ * IMREAL.
*
* Returns the real coefficient of a complex number in x + yi or x + yj text format.
*
@@ -1811,7 +1850,9 @@ class Engineering
* IMREAL(complexNumber)
*
* @category Engineering Functions
- * @param string $complexNumber The complex number for which you want the real coefficient.
+ *
+ * @param string $complexNumber the complex number for which you want the real coefficient
+ *
* @return float
*/
public static function IMREAL($complexNumber)
@@ -1824,14 +1865,15 @@ class Engineering
}
/**
- * IMABS
+ * IMABS.
*
* Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMABS(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the absolute value.
+ * @param string $complexNumber the complex number for which you want the absolute value
+ *
* @return float
*/
public static function IMABS($complexNumber)
@@ -1847,7 +1889,7 @@ class Engineering
}
/**
- * IMARGUMENT
+ * IMARGUMENT.
*
* Returns the argument theta of a complex number, i.e. the angle in radians from the real
* axis to the representation of the number in polar coordinates.
@@ -1855,7 +1897,8 @@ class Engineering
* Excel Function:
* IMARGUMENT(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the argument theta.
+ * @param string $complexNumber the complex number for which you want the argument theta
+ *
* @return float
*/
public static function IMARGUMENT($complexNumber)
@@ -1867,27 +1910,28 @@ class Engineering
return Functions::DIV0();
} elseif ($parsedComplex['imaginary'] < 0.0) {
return M_PI / -2;
- } else {
- return M_PI / 2;
}
+
+ return M_PI / 2;
} elseif ($parsedComplex['real'] > 0.0) {
return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
} elseif ($parsedComplex['imaginary'] < 0.0) {
return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
- } else {
- return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
}
+
+ return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
}
/**
- * IMCONJUGATE
+ * IMCONJUGATE.
*
* Returns the complex conjugate of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMCONJUGATE(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the conjugate.
+ * @param string $complexNumber the complex number for which you want the conjugate
+ *
* @return string
*/
public static function IMCONJUGATE($complexNumber)
@@ -1898,26 +1942,27 @@ class Engineering
if ($parsedComplex['imaginary'] == 0.0) {
return $parsedComplex['real'];
- } else {
- return self::cleanComplex(
+ }
+
+ return self::cleanComplex(
self::COMPLEX(
$parsedComplex['real'],
0 - $parsedComplex['imaginary'],
$parsedComplex['suffix']
)
);
- }
}
/**
- * IMCOS
+ * IMCOS.
*
* Returns the cosine of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMCOS(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the cosine.
+ * @param string $complexNumber the complex number for which you want the cosine
+ *
* @return string|float
*/
public static function IMCOS($complexNumber)
@@ -1928,26 +1973,27 @@ class Engineering
if ($parsedComplex['imaginary'] == 0.0) {
return cos($parsedComplex['real']);
- } else {
- return self::IMCONJUGATE(
+ }
+
+ return self::IMCONJUGATE(
self::COMPLEX(
cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
$parsedComplex['suffix']
)
);
- }
}
/**
- * IMSIN
+ * IMSIN.
*
* Returns the sine of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMSIN(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the sine.
+ * @param string $complexNumber the complex number for which you want the sine
+ *
* @return string|float
*/
public static function IMSIN($complexNumber)
@@ -1958,24 +2004,25 @@ class Engineering
if ($parsedComplex['imaginary'] == 0.0) {
return sin($parsedComplex['real']);
- } else {
- return self::COMPLEX(
+ }
+
+ return self::COMPLEX(
sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
$parsedComplex['suffix']
);
- }
}
/**
- * IMSQRT
+ * IMSQRT.
*
* Returns the square root of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMSQRT(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the square root.
+ * @param string $complexNumber the complex number for which you want the square root
+ *
* @return string
*/
public static function IMSQRT($complexNumber)
@@ -1995,20 +2042,21 @@ class Engineering
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($d1 * $r, $d2 * $r);
- } else {
- return self::COMPLEX($d1 * $r, $d2 * $r, $parsedComplex['suffix']);
}
+
+ return self::COMPLEX($d1 * $r, $d2 * $r, $parsedComplex['suffix']);
}
/**
- * IMLN
+ * IMLN.
*
* Returns the natural logarithm of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMLN(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the natural logarithm.
+ * @param string $complexNumber the complex number for which you want the natural logarithm
+ *
* @return string
*/
public static function IMLN($complexNumber)
@@ -2026,20 +2074,21 @@ class Engineering
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($logR, $t);
- } else {
- return self::COMPLEX($logR, $t, $parsedComplex['suffix']);
}
+
+ return self::COMPLEX($logR, $t, $parsedComplex['suffix']);
}
/**
- * IMLOG10
+ * IMLOG10.
*
* Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMLOG10(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the common logarithm.
+ * @param string $complexNumber the complex number for which you want the common logarithm
+ *
* @return string
*/
public static function IMLOG10($complexNumber)
@@ -2058,14 +2107,15 @@ class Engineering
}
/**
- * IMLOG2
+ * IMLOG2.
*
* Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMLOG2(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the base-2 logarithm.
+ * @param string $complexNumber the complex number for which you want the base-2 logarithm
+ *
* @return string
*/
public static function IMLOG2($complexNumber)
@@ -2084,14 +2134,15 @@ class Engineering
}
/**
- * IMEXP
+ * IMEXP.
*
* Returns the exponential of a complex number in x + yi or x + yj text format.
*
* Excel Function:
* IMEXP(complexNumber)
*
- * @param string $complexNumber The complex number for which you want the exponential.
+ * @param string $complexNumber the complex number for which you want the exponential
+ *
* @return string
*/
public static function IMEXP($complexNumber)
@@ -2110,21 +2161,22 @@ class Engineering
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($eX, $eY);
- } else {
- return self::COMPLEX($eX, $eY, $parsedComplex['suffix']);
}
+
+ return self::COMPLEX($eX, $eY, $parsedComplex['suffix']);
}
/**
- * IMPOWER
+ * IMPOWER.
*
* Returns a complex number in x + yi or x + yj text format raised to a power.
*
* Excel Function:
* IMPOWER(complexNumber,realNumber)
*
- * @param string $complexNumber The complex number you want to raise to a power.
- * @param float $realNumber The power to which you want to raise the complex number.
+ * @param string $complexNumber the complex number you want to raise to a power
+ * @param float $realNumber the power to which you want to raise the complex number
+ *
* @return string
*/
public static function IMPOWER($complexNumber, $realNumber)
@@ -2145,21 +2197,22 @@ class Engineering
return 1;
} elseif ($parsedComplex['imaginary'] == 0.0) {
return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']);
- } else {
- return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']);
}
+
+ return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']);
}
/**
- * IMDIV
+ * IMDIV.
*
* Returns the quotient of two complex numbers in x + yi or x + yj text format.
*
* Excel Function:
* IMDIV(complexDividend,complexDivisor)
*
- * @param string $complexDividend The complex numerator or dividend.
- * @param string $complexDivisor The complex denominator or divisor.
+ * @param string $complexDividend the complex numerator or dividend
+ * @param string $complexDivisor the complex denominator or divisor
+ *
* @return string
*/
public static function IMDIV($complexDividend, $complexDivisor)
@@ -2190,21 +2243,22 @@ class Engineering
return self::cleanComplex($r . '+' . $i . $parsedComplexDivisor['suffix']);
} elseif ($i < 0.0) {
return self::cleanComplex($r . $i . $parsedComplexDivisor['suffix']);
- } else {
- return $r;
}
+
+ return $r;
}
/**
- * IMSUB
+ * IMSUB.
*
* Returns the difference of two complex numbers in x + yi or x + yj text format.
*
* Excel Function:
* IMSUB(complexNumber1,complexNumber2)
*
- * @param string $complexNumber1 The complex number from which to subtract complexNumber2.
- * @param string $complexNumber2 The complex number to subtract from complexNumber1.
+ * @param string $complexNumber1 the complex number from which to subtract complexNumber2
+ * @param string $complexNumber2 the complex number to subtract from complexNumber1
+ *
* @return string
*/
public static function IMSUB($complexNumber1, $complexNumber2)
@@ -2230,7 +2284,7 @@ class Engineering
}
/**
- * IMSUM
+ * IMSUM.
*
* Returns the sum of two or more complex numbers in x + yi or x + yj text format.
*
@@ -2238,6 +2292,7 @@ class Engineering
* IMSUM(complexNumber[,complexNumber[,...]])
*
* @param string $complexNumber,... Series of complex numbers to add
+ *
* @return string
*/
public static function IMSUM()
@@ -2269,7 +2324,7 @@ class Engineering
}
/**
- * IMPRODUCT
+ * IMPRODUCT.
*
* Returns the product of two or more complex numbers in x + yi or x + yj text format.
*
@@ -2277,6 +2332,7 @@ class Engineering
* IMPRODUCT(complexNumber[,complexNumber[,...]])
*
* @param string $complexNumber,... Series of complex numbers to multiply
+ *
* @return string
*/
public static function IMPRODUCT()
@@ -2308,7 +2364,7 @@ class Engineering
}
/**
- * DELTA
+ * DELTA.
*
* Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.
* Use this function to filter a set of values. For example, by summing several DELTA
@@ -2318,8 +2374,9 @@ class Engineering
* Excel Function:
* DELTA(a[,b])
*
- * @param float $a The first number.
+ * @param float $a the first number
* @param float $b The second number. If omitted, b is assumed to be zero.
+ *
* @return int
*/
public static function DELTA($a, $b = 0)
@@ -2331,7 +2388,7 @@ class Engineering
}
/**
- * GESTEP
+ * GESTEP.
*
* Excel Function:
* GESTEP(number[,step])
@@ -2340,9 +2397,10 @@ class Engineering
* Use this function to filter a set of values. For example, by summing several GESTEP
* functions you calculate the count of values that exceed a threshold.
*
- * @param float $number The value to test against step.
+ * @param float $number the value to test against step
* @param float $step The threshold value.
* If you omit a value for step, GESTEP uses zero.
+ *
* @return int
*/
public static function GESTEP($number, $step = 0)
@@ -2382,7 +2440,7 @@ class Engineering
}
/**
- * ERF
+ * ERF.
*
* Returns the error function integrated between the lower and upper bound arguments.
*
@@ -2397,6 +2455,7 @@ class Engineering
* @param float $lower lower bound for integrating ERF
* @param float $upper upper bound for integrating ERF.
* If omitted, ERF integrates between zero and lower_limit
+ *
* @return float
*/
public static function ERF($lower, $upper = null)
@@ -2450,7 +2509,7 @@ class Engineering
}
/**
- * ERFC
+ * ERFC.
*
* Returns the complementary ERF function integrated between x and infinity
*
@@ -2463,6 +2522,7 @@ class Engineering
* ERFC(x)
*
* @param float $x The lower bound for integrating ERFC
+ *
* @return float
*/
public static function ERFC($x)
@@ -2478,7 +2538,7 @@ class Engineering
/**
* getConversionGroups
- * Returns a list of the different conversion groups for UOM conversions
+ * Returns a list of the different conversion groups for UOM conversions.
*
* @return array
*/
@@ -2494,9 +2554,10 @@ class Engineering
/**
* getConversionGroupUnits
- * Returns an array of units of measure, for a specified conversion group, or for all groups
+ * Returns an array of units of measure, for a specified conversion group, or for all groups.
*
* @param string $group The group whose units of measure you want to retrieve
+ *
* @return array
*/
public static function getConversionGroupUnits($group = null)
@@ -2512,9 +2573,10 @@ class Engineering
}
/**
- * getConversionGroupUnitDetails
+ * getConversionGroupUnitDetails.
*
* @param string $group The group whose units of measure you want to retrieve
+ *
* @return array
*/
public static function getConversionGroupUnitDetails($group = null)
@@ -2534,7 +2596,7 @@ class Engineering
/**
* getConversionMultipliers
- * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
+ * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
*
* @return array of mixed
*/
@@ -2544,7 +2606,7 @@ class Engineering
}
/**
- * CONVERTUOM
+ * CONVERTUOM.
*
* Converts a number from one measurement system to another.
* For example, CONVERT can translate a table of distances in miles to a table of distances
@@ -2553,9 +2615,9 @@ class Engineering
* Excel Function:
* CONVERT(value,fromUOM,toUOM)
*
- * @param float $value The value in fromUOM to convert.
- * @param string $fromUOM The units for value.
- * @param string $toUOM The units for the result.
+ * @param float $value the value in fromUOM to convert
+ * @param string $fromUOM the units for value
+ * @param string $toUOM the units for the result
*
* @return float
*/
@@ -2615,15 +2677,14 @@ class Engineering
} elseif ($unitGroup1 == 'Temperature') {
if (($fromUOM == 'F') || ($fromUOM == 'fah')) {
if (($toUOM == 'F') || ($toUOM == 'fah')) {
- return $value;
- } else {
- $value = (($value - 32) / 1.8);
- if (($toUOM == 'K') || ($toUOM == 'kel')) {
- $value += 273.15;
- }
-
return $value;
}
+ $value = (($value - 32) / 1.8);
+ if (($toUOM == 'K') || ($toUOM == 'kel')) {
+ $value += 273.15;
+ }
+
+ return $value;
} elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) &&
(($toUOM == 'K') || ($toUOM == 'kel'))
) {
diff --git a/src/PhpSpreadsheet/Calculation/Exception.php b/src/PhpSpreadsheet/Calculation/Exception.php
index 61ab2d4a..8674eb1e 100644
--- a/src/PhpSpreadsheet/Calculation/Exception.php
+++ b/src/PhpSpreadsheet/Calculation/Exception.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Exception extends \PhpOffice\PhpSpreadsheet\Exception
{
/**
- * Error handler callback
+ * Error handler callback.
*
* @param mixed $code
* @param mixed $string
diff --git a/src/PhpSpreadsheet/Calculation/ExceptionHandler.php b/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
index 0d606b47..918ae0eb 100644
--- a/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
+++ b/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class ExceptionHandler
{
/**
- * Register errorhandler
+ * Register errorhandler.
*/
public function __construct()
{
@@ -34,7 +35,7 @@ class ExceptionHandler
}
/**
- * Unregister errorhandler
+ * Unregister errorhandler.
*/
public function __destruct()
{
diff --git a/src/PhpSpreadsheet/Calculation/Financial.php b/src/PhpSpreadsheet/Calculation/Financial.php
index 850dd467..5f2ac445 100644
--- a/src/PhpSpreadsheet/Calculation/Financial.php
+++ b/src/PhpSpreadsheet/Calculation/Financial.php
@@ -9,7 +9,7 @@ define('FINANCIAL_MAX_ITERATIONS', 128);
define('FINANCIAL_PRECISION', 1.0e-08);
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,17 +26,19 @@ define('FINANCIAL_PRECISION', 1.0e-08);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Financial
{
/**
- * isLastDayOfMonth
+ * isLastDayOfMonth.
*
* Returns a boolean TRUE/FALSE indicating if this date is the last date of the month
*
* @param DateTime $testDate The date for testing
+ *
* @return bool
*/
private static function isLastDayOfMonth($testDate)
@@ -45,11 +47,12 @@ class Financial
}
/**
- * isFirstDayOfMonth
+ * isFirstDayOfMonth.
*
* Returns a boolean TRUE/FALSE indicating if this date is the first date of the month
*
* @param DateTime $testDate The date for testing
+ *
* @return bool
*/
private static function isFirstDayOfMonth($testDate)
@@ -92,7 +95,7 @@ class Financial
}
/**
- * daysPerYear
+ * daysPerYear.
*
* Returns the number of days in a specified year, as defined by the "basis" value
*
@@ -103,6 +106,7 @@ class Financial
* 2 360
* 3 365
* 4 European 360
+ *
* @return int
*/
private static function daysPerYear($year, $basis = 0)
@@ -140,7 +144,7 @@ class Financial
}
/**
- * ACCRINT
+ * ACCRINT.
*
* Returns the accrued interest for a security that pays periodic interest.
*
@@ -148,12 +152,13 @@ class Financial
* ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis])
*
* @category Financial Functions
- * @param mixed $issue The security's issue date.
- * @param mixed $firstinterest The security's first interest date.
+ *
+ * @param mixed $issue the security's issue date
+ * @param mixed $firstinterest the security's first interest date
* @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue date
* when the security is traded to the buyer.
- * @param float $rate The security's annual coupon rate.
+ * @param float $rate the security's annual coupon rate
* @param float $par The security's par value.
* If you omit par, ACCRINT uses $1,000.
* @param int $frequency the number of coupon payments per year.
@@ -171,6 +176,7 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ *
* @return float
*/
public static function ACCRINT($issue, $firstinterest, $settlement, $rate, $par = 1000, $frequency = 1, $basis = 0)
@@ -203,7 +209,7 @@ class Financial
}
/**
- * ACCRINTM
+ * ACCRINTM.
*
* Returns the accrued interest for a security that pays interest at maturity.
*
@@ -211,9 +217,10 @@ class Financial
* ACCRINTM(issue,settlement,rate[,par[,basis]])
*
* @category Financial Functions
- * @param mixed issue The security's issue date.
- * @param mixed settlement The security's settlement (or maturity) date.
- * @param float rate The security's annual coupon rate.
+ *
+ * @param mixed issue The security's issue date
+ * @param mixed settlement The security's settlement (or maturity) date
+ * @param float rate The security's annual coupon rate
* @param float par The security's par value.
* If you omit par, ACCRINT uses $1,000.
* @param int basis The type of day count to use.
@@ -222,6 +229,12 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $issue
+ * @param mixed $settlement
+ * @param mixed $rate
+ * @param mixed $par
+ * @param mixed $basis
+ *
* @return float
*/
public static function ACCRINTM($issue, $settlement, $rate, $par = 1000, $basis = 0)
@@ -252,7 +265,7 @@ class Financial
}
/**
- * AMORDEGRC
+ * AMORDEGRC.
*
* Returns the depreciation for each accounting period.
* This function is provided for the French accounting system. If an asset is purchased in
@@ -267,18 +280,27 @@ class Financial
* AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
*
* @category Financial Functions
- * @param float cost The cost of the asset.
- * @param mixed purchased Date of the purchase of the asset.
- * @param mixed firstPeriod Date of the end of the first period.
- * @param mixed salvage The salvage value at the end of the life of the asset.
- * @param float period The period.
- * @param float rate Rate of depreciation.
+ *
+ * @param float cost The cost of the asset
+ * @param mixed purchased Date of the purchase of the asset
+ * @param mixed firstPeriod Date of the end of the first period
+ * @param mixed salvage The salvage value at the end of the life of the asset
+ * @param float period The period
+ * @param float rate Rate of depreciation
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $cost
+ * @param mixed $purchased
+ * @param mixed $firstPeriod
+ * @param mixed $salvage
+ * @param mixed $period
+ * @param mixed $rate
+ * @param mixed $basis
+ *
* @return float
*/
public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
@@ -333,7 +355,7 @@ class Financial
}
/**
- * AMORLINC
+ * AMORLINC.
*
* Returns the depreciation for each accounting period.
* This function is provided for the French accounting system. If an asset is purchased in
@@ -343,18 +365,27 @@ class Financial
* AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
*
* @category Financial Functions
- * @param float cost The cost of the asset.
- * @param mixed purchased Date of the purchase of the asset.
- * @param mixed firstPeriod Date of the end of the first period.
- * @param mixed salvage The salvage value at the end of the life of the asset.
- * @param float period The period.
- * @param float rate Rate of depreciation.
+ *
+ * @param float cost The cost of the asset
+ * @param mixed purchased Date of the purchase of the asset
+ * @param mixed firstPeriod Date of the end of the first period
+ * @param mixed salvage The salvage value at the end of the life of the asset
+ * @param float period The period
+ * @param float rate Rate of depreciation
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $cost
+ * @param mixed $purchased
+ * @param mixed $firstPeriod
+ * @param mixed $salvage
+ * @param mixed $period
+ * @param mixed $rate
+ * @param mixed $basis
+ *
* @return float
*/
public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
@@ -378,7 +409,7 @@ class Financial
}
$f0Rate = $yearFrac * $rate * $cost;
- $nNumOfFullPeriods = intval(($cost - $salvage - $f0Rate) / $fOneRate);
+ $nNumOfFullPeriods = (int) (($cost - $salvage - $f0Rate) / $fOneRate);
if ($period == 0) {
return $f0Rate;
@@ -386,13 +417,13 @@ class Financial
return $fOneRate;
} elseif ($period == ($nNumOfFullPeriods + 1)) {
return $fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate;
- } else {
- return 0.0;
}
+
+ return 0.0;
}
/**
- * COUPDAYBS
+ * COUPDAYBS.
*
* Returns the number of days from the beginning of the coupon period to the settlement date.
*
@@ -400,6 +431,7 @@ class Financial
* COUPDAYBS(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -420,6 +452,11 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $frequency
+ * @param mixed $basis
+ *
* @return float
*/
public static function COUPDAYBS($settlement, $maturity, $frequency, $basis = 0)
@@ -449,7 +486,7 @@ class Financial
}
/**
- * COUPDAYS
+ * COUPDAYS.
*
* Returns the number of days in the coupon period that contains the settlement date.
*
@@ -457,6 +494,7 @@ class Financial
* COUPDAYS(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -478,6 +516,10 @@ class Financial
* 3 Actual/365
* 4 European 30/360
* @param int $frequency
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $basis
+ *
* @return float
*/
public static function COUPDAYS($settlement, $maturity, $frequency, $basis = 0)
@@ -524,7 +566,7 @@ class Financial
}
/**
- * COUPDAYSNC
+ * COUPDAYSNC.
*
* Returns the number of days from the settlement date to the next coupon date.
*
@@ -532,6 +574,7 @@ class Financial
* COUPDAYSNC(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -552,6 +595,11 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $frequency
+ * @param mixed $basis
+ *
* @return float
*/
public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis = 0)
@@ -581,7 +629,7 @@ class Financial
}
/**
- * COUPNCD
+ * COUPNCD.
*
* Returns the next coupon date after the settlement date.
*
@@ -589,6 +637,7 @@ class Financial
* COUPNCD(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -609,6 +658,11 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $frequency
+ * @param mixed $basis
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -636,7 +690,7 @@ class Financial
}
/**
- * COUPNUM
+ * COUPNUM.
*
* Returns the number of coupons payable between the settlement date and maturity date,
* rounded up to the nearest whole coupon.
@@ -645,6 +699,7 @@ class Financial
* COUPNUM(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -665,6 +720,11 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $frequency
+ * @param mixed $basis
+ *
* @return int
*/
public static function COUPNUM($settlement, $maturity, $frequency, $basis = 0)
@@ -707,7 +767,7 @@ class Financial
}
/**
- * COUPPCD
+ * COUPPCD.
*
* Returns the previous coupon date before the settlement date.
*
@@ -715,6 +775,7 @@ class Financial
* COUPPCD(settlement,maturity,frequency[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
@@ -735,6 +796,11 @@ class Financial
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $frequency
+ * @param mixed $basis
+ *
* @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -762,7 +828,7 @@ class Financial
}
/**
- * CUMIPMT
+ * CUMIPMT.
*
* Returns the cumulative interest paid on a loan between the start and end periods.
*
@@ -770,15 +836,17 @@ class Financial
* CUMIPMT(rate,nper,pv,start,end[,type])
*
* @category Financial Functions
+ *
* @param float $rate The Interest rate
* @param int $nper The total number of payment periods
* @param float $pv Present Value
* @param int $start The first period in the calculation.
* Payment periods are numbered beginning with 1.
- * @param int $end The last period in the calculation.
+ * @param int $end the last period in the calculation
* @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
+ *
* @return float
*/
public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0)
@@ -808,7 +876,7 @@ class Financial
}
/**
- * CUMPRINC
+ * CUMPRINC.
*
* Returns the cumulative principal paid on a loan between the start and end periods.
*
@@ -816,15 +884,17 @@ class Financial
* CUMPRINC(rate,nper,pv,start,end[,type])
*
* @category Financial Functions
+ *
* @param float $rate The Interest rate
* @param int $nper The total number of payment periods
* @param float $pv Present Value
* @param int $start The first period in the calculation.
* Payment periods are numbered beginning with 1.
- * @param int $end The last period in the calculation.
+ * @param int $end the last period in the calculation
* @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
+ *
* @return float
*/
public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0)
@@ -854,7 +924,7 @@ class Financial
}
/**
- * DB
+ * DB.
*
* Returns the depreciation of an asset for a specified period using the
* fixed-declining balance method.
@@ -867,7 +937,8 @@ class Financial
* DB(cost,salvage,life,period[,month])
*
* @category Financial Functions
- * @param float cost Initial cost of the asset.
+ *
+ * @param float cost Initial cost of the asset
* @param float salvage Value at the end of the depreciation.
* (Sometimes called the salvage value of the asset)
* @param int life Number of periods over which the asset is depreciated.
@@ -876,6 +947,12 @@ class Financial
* depreciation. Period must use the same units as life.
* @param int month Number of months in the first year. If month is omitted,
* it defaults to 12.
+ * @param mixed $cost
+ * @param mixed $salvage
+ * @param mixed $life
+ * @param mixed $period
+ * @param mixed $month
+ *
* @return float
*/
public static function DB($cost, $salvage, $life, $period, $month = 12)
@@ -925,7 +1002,7 @@ class Financial
}
/**
- * DDB
+ * DDB.
*
* Returns the depreciation of an asset for a specified period using the
* double-declining balance method or some other method you specify.
@@ -934,7 +1011,8 @@ class Financial
* DDB(cost,salvage,life,period[,factor])
*
* @category Financial Functions
- * @param float cost Initial cost of the asset.
+ *
+ * @param float cost Initial cost of the asset
* @param float salvage Value at the end of the depreciation.
* (Sometimes called the salvage value of the asset)
* @param int life Number of periods over which the asset is depreciated.
@@ -944,6 +1022,12 @@ class Financial
* @param float factor The rate at which the balance declines.
* If factor is omitted, it is assumed to be 2 (the
* double-declining balance method).
+ * @param mixed $cost
+ * @param mixed $salvage
+ * @param mixed $life
+ * @param mixed $period
+ * @param mixed $factor
+ *
* @return float
*/
public static function DDB($cost, $salvage, $life, $period, $factor = 2.0)
@@ -985,7 +1069,7 @@ class Financial
}
/**
- * DISC
+ * DISC.
*
* Returns the discount rate for a security.
*
@@ -993,19 +1077,26 @@ class Financial
* DISC(settlement,maturity,price,redemption[,basis])
*
* @category Financial Functions
+ *
* @param mixed settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int price The security's price per $100 face value.
- * @param int redemption The security's redemption value per $100 face value.
+ * @param int price The security's price per $100 face value
+ * @param int redemption The security's redemption value per $100 face value
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $price
+ * @param mixed $redemption
+ * @param mixed $basis
+ *
* @return float
*/
public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0)
@@ -1037,7 +1128,7 @@ class Financial
}
/**
- * DOLLARDE
+ * DOLLARDE.
*
* Converts a dollar price expressed as an integer part and a fraction
* part into a dollar price expressed as a decimal number.
@@ -1047,8 +1138,10 @@ class Financial
* DOLLARDE(fractional_dollar,fraction)
*
* @category Financial Functions
+ *
* @param float $fractional_dollar Fractional Dollar
* @param int $fraction Fraction
+ *
* @return float
*/
public static function DOLLARDE($fractional_dollar = null, $fraction = 0)
@@ -1073,7 +1166,7 @@ class Financial
}
/**
- * DOLLARFR
+ * DOLLARFR.
*
* Converts a dollar price expressed as a decimal number into a dollar price
* expressed as a fraction.
@@ -1083,8 +1176,10 @@ class Financial
* DOLLARFR(decimal_dollar,fraction)
*
* @category Financial Functions
+ *
* @param float $decimal_dollar Decimal Dollar
* @param int $fraction Fraction
+ *
* @return float
*/
public static function DOLLARFR($decimal_dollar = null, $fraction = 0)
@@ -1109,7 +1204,7 @@ class Financial
}
/**
- * EFFECT
+ * EFFECT.
*
* Returns the effective interest rate given the nominal rate and the number of
* compounding payments per year.
@@ -1118,8 +1213,10 @@ class Financial
* EFFECT(nominal_rate,npery)
*
* @category Financial Functions
+ *
* @param float $nominal_rate Nominal interest rate
* @param int $npery Number of compounding payments per year
+ *
* @return float
*/
public static function EFFECT($nominal_rate = 0, $npery = 0)
@@ -1136,7 +1233,7 @@ class Financial
}
/**
- * FV
+ * FV.
*
* Returns the Future Value of a cash flow with constant payments and interest rate (annuities).
*
@@ -1144,16 +1241,18 @@ class Financial
* FV(rate,nper,pmt[,pv[,type]])
*
* @category Financial Functions
+ *
* @param float $rate The interest rate per period
* @param int $nper Total number of payment periods in an annuity
* @param float $pmt The payment made each period: it cannot change over the
* life of the annuity. Typically, pmt contains principal
* and interest but no other fees or taxes.
- * @param float $pv Present Value, or the lump-sum amount that a series of
- * future payments is worth right now.
+ * @param float $pv present Value, or the lump-sum amount that a series of
+ * future payments is worth right now
* @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
+ *
* @return float
*/
public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0)
@@ -1178,7 +1277,7 @@ class Financial
}
/**
- * FVSCHEDULE
+ * FVSCHEDULE.
*
* Returns the future value of an initial principal after applying a series of compound interest rates.
* Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
@@ -1186,8 +1285,9 @@ class Financial
* Excel Function:
* FVSCHEDULE(principal,schedule)
*
- * @param float $principal The present value.
- * @param float[] $schedule An array of interest rates to apply.
+ * @param float $principal the present value
+ * @param float[] $schedule an array of interest rates to apply
+ *
* @return float
*/
public static function FVSCHEDULE($principal, $schedule)
@@ -1203,7 +1303,7 @@ class Financial
}
/**
- * INTRATE
+ * INTRATE.
*
* Returns the interest rate for a fully invested security.
*
@@ -1214,14 +1314,15 @@ class Financial
* The security settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int $investment The amount invested in the security.
- * @param int $redemption The amount to be received at maturity.
+ * @param int $investment the amount invested in the security
+ * @param int $redemption the amount to be received at maturity
* @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ *
* @return float
*/
public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis = 0)
@@ -1253,7 +1354,7 @@ class Financial
}
/**
- * IPMT
+ * IPMT.
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
@@ -1266,6 +1367,7 @@ class Financial
* @param float $pv Present Value
* @param float $fv Future Value
* @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
* @return float
*/
public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
@@ -1292,7 +1394,7 @@ class Financial
}
/**
- * IRR
+ * IRR.
*
* Returns the internal rate of return for a series of cash flows represented by the numbers in values.
* These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
@@ -1308,6 +1410,7 @@ class Financial
* Values must contain at least one positive value and one negative value to
* calculate the internal rate of return.
* @param float $guess A number that you guess is close to the result of IRR
+ *
* @return float
*/
public static function IRR($values, $guess = 0.1)
@@ -1362,7 +1465,7 @@ class Financial
}
/**
- * ISPMT
+ * ISPMT.
*
* Returns the interest payment for an investment based on an interest rate and a constant payment schedule.
*
@@ -1404,7 +1507,7 @@ class Financial
}
/**
- * MIRR
+ * MIRR.
*
* Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
* the cost of the investment and the interest received on reinvestment of cash.
@@ -1417,6 +1520,7 @@ class Financial
* Payments are negative value, income is positive values.
* @param float $finance_rate The interest rate you pay on the money used in the cash flows
* @param float $reinvestment_rate The interest rate you receive on the cash flows as you reinvest them
+ *
* @return float
*/
public static function MIRR($values, $finance_rate, $reinvestment_rate)
@@ -1452,12 +1556,13 @@ class Financial
}
/**
- * NOMINAL
+ * NOMINAL.
*
* Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
*
* @param float $effect_rate Effective interest rate
* @param int $npery Number of compounding payments per year
+ *
* @return float
*/
public static function NOMINAL($effect_rate = 0, $npery = 0)
@@ -1475,7 +1580,7 @@ class Financial
}
/**
- * NPER
+ * NPER.
*
* Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
*
@@ -1484,6 +1589,7 @@ class Financial
* @param float $pv Present Value
* @param float $fv Future Value
* @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
* @return float
*/
public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0)
@@ -1515,7 +1621,7 @@ class Financial
}
/**
- * NPV
+ * NPV.
*
* Returns the Net Present Value of a cash flow series given a discount rate.
*
@@ -1543,7 +1649,7 @@ class Financial
}
/**
- * PMT
+ * PMT.
*
* Returns the constant payment (annuity) for a cash flow with a constant interest rate.
*
@@ -1552,6 +1658,7 @@ class Financial
* @param float $pv Present Value
* @param float $fv Future Value
* @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
* @return float
*/
public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0)
@@ -1576,7 +1683,7 @@ class Financial
}
/**
- * PPMT
+ * PPMT.
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
@@ -1586,6 +1693,7 @@ class Financial
* @param float $pv Present Value
* @param float $fv Future Value
* @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
* @return float
*/
public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
@@ -1653,7 +1761,7 @@ class Financial
}
/**
- * PRICEDISC
+ * PRICEDISC.
*
* Returns the price per $100 face value of a discounted security.
*
@@ -1661,14 +1769,20 @@ class Financial
* The security settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int discount The security's discount rate.
- * @param int redemption The security's redemption value per $100 face value.
+ * @param int discount The security's discount rate
+ * @param int redemption The security's redemption value per $100 face value
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $discount
+ * @param mixed $redemption
+ * @param mixed $basis
+ *
* @return float
*/
public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis = 0)
@@ -1697,7 +1811,7 @@ class Financial
}
/**
- * PRICEMAT
+ * PRICEMAT.
*
* Returns the price per $100 face value of a security that pays interest at maturity.
*
@@ -1705,15 +1819,22 @@ class Financial
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed issue The security's issue date.
- * @param int rate The security's interest rate at date of issue.
- * @param int yield The security's annual yield.
+ * @param mixed issue The security's issue date
+ * @param int rate The security's interest rate at date of issue
+ * @param int yield The security's annual yield
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $issue
+ * @param mixed $rate
+ * @param mixed $yield
+ * @param mixed $basis
+ *
* @return float
*/
public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis = 0)
@@ -1762,7 +1883,7 @@ class Financial
}
/**
- * PV
+ * PV.
*
* Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
*
@@ -1771,6 +1892,7 @@ class Financial
* @param float $pmt Periodic payment (annuity)
* @param float $fv Future Value
* @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
* @return float
*/
public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0)
@@ -1795,7 +1917,7 @@ class Financial
}
/**
- * RATE
+ * RATE.
*
* Returns the interest rate per period of an annuity.
* RATE is calculated by iteration and can have zero or more solutions.
@@ -1806,13 +1928,14 @@ class Financial
* RATE(nper,pmt,pv[,fv[,type[,guess]]])
*
* @category Financial Functions
- * @param float nper The total number of payment periods in an annuity.
+ *
+ * @param float nper The total number of payment periods in an annuity
* @param float pmt The payment made each period and cannot change over the life
* of the annuity.
* Typically, pmt includes principal and interest but no other
* fees or taxes.
* @param float pv The present value - the total amount that a series of future
- * payments is worth now.
+ * payments is worth now
* @param float fv The future value, or a cash balance you want to attain after
* the last payment is made. If fv is omitted, it is assumed
* to be 0 (the future value of a loan, for example, is 0).
@@ -1821,6 +1944,13 @@ class Financial
* 1 At the beginning of the period.
* @param float guess Your guess for what the rate will be.
* If you omit guess, it is assumed to be 10 percent.
+ * @param mixed $nper
+ * @param mixed $pmt
+ * @param mixed $pv
+ * @param mixed $fv
+ * @param mixed $type
+ * @param mixed $guess
+ *
* @return float
**/
public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1)
@@ -1868,7 +1998,7 @@ class Financial
}
/**
- * RECEIVED
+ * RECEIVED.
*
* Returns the price per $100 face value of a discounted security.
*
@@ -1876,14 +2006,20 @@ class Financial
* The security settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int investment The amount invested in the security.
- * @param int discount The security's discount rate.
+ * @param int investment The amount invested in the security
+ * @param int discount The security's discount rate
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $investment
+ * @param mixed $discount
+ * @param mixed $basis
+ *
* @return float
*/
public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis = 0)
@@ -1912,13 +2048,17 @@ class Financial
}
/**
- * SLN
+ * SLN.
*
* 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
+ *
* @return float
*/
public static function SLN($cost, $salvage, $life)
@@ -1940,7 +2080,7 @@ class Financial
}
/**
- * SYD
+ * SYD.
*
* Returns the sum-of-years' digits depreciation of an asset for a specified period.
*
@@ -1948,6 +2088,11 @@ class Financial
* @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
+ *
* @return float
*/
public static function SYD($cost, $salvage, $life, $period)
@@ -1970,7 +2115,7 @@ class Financial
}
/**
- * TBILLEQ
+ * TBILLEQ.
*
* Returns the bond-equivalent yield for a Treasury bill.
*
@@ -1978,7 +2123,11 @@ class Financial
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
* @param mixed maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int discount The Treasury bill's discount rate.
+ * @param int discount The Treasury bill's discount rate
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $discount
+ *
* @return float
*/
public static function TBILLEQ($settlement, $maturity, $discount)
@@ -2008,7 +2157,7 @@ class Financial
}
/**
- * TBILLPRICE
+ * TBILLPRICE.
*
* Returns the yield for a Treasury bill.
*
@@ -2016,7 +2165,11 @@ class Financial
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
* @param mixed maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int discount The Treasury bill's discount rate.
+ * @param int discount The Treasury bill's discount rate
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $discount
+ *
* @return float
*/
public static function TBILLPRICE($settlement, $maturity, $discount)
@@ -2062,7 +2215,7 @@ class Financial
}
/**
- * TBILLYIELD
+ * TBILLYIELD.
*
* Returns the yield for a Treasury bill.
*
@@ -2070,7 +2223,11 @@ class Financial
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
* @param mixed maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int price The Treasury bill's price per $100 face value.
+ * @param int price The Treasury bill's price per $100 face value
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $price
+ *
* @return float
*/
public static function TBILLYIELD($settlement, $maturity, $price)
@@ -2161,7 +2318,7 @@ class Financial
}
/**
- * XNPV
+ * XNPV.
*
* Returns the net present value for a schedule of cash flows that is not necessarily periodic.
* To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
@@ -2169,7 +2326,7 @@ class Financial
* Excel Function:
* =XNPV(rate,values,dates)
*
- * @param float $rate The discount rate to apply to the cash flows.
+ * @param float $rate the discount rate to apply to the cash flows
* @param array of float $values A series of cash flows that corresponds to a schedule of payments in dates.
* The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment.
* If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year.
@@ -2177,6 +2334,7 @@ class Financial
* @param array of mixed $dates A schedule of payment dates that corresponds to the cash flow payments.
* The first payment date indicates the beginning of the schedule of payments.
* All other dates must be later than this date, but they may occur in any order.
+ *
* @return float
*/
public static function XNPV($rate, $values, $dates)
@@ -2210,7 +2368,7 @@ class Financial
}
/**
- * YIELDDISC
+ * YIELDDISC.
*
* Returns the annual yield of a security that pays interest at maturity.
*
@@ -2218,14 +2376,20 @@ class Financial
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int price The security's price per $100 face value.
- * @param int redemption The security's redemption value per $100 face value.
+ * @param int price The security's price per $100 face value
+ * @param int redemption The security's redemption value per $100 face value
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $price
+ * @param mixed $redemption
+ * @param mixed $basis
+ *
* @return float
*/
public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis = 0)
@@ -2259,7 +2423,7 @@ class Financial
}
/**
- * YIELDMAT
+ * YIELDMAT.
*
* Returns the annual yield of a security that pays interest at maturity.
*
@@ -2267,15 +2431,22 @@ class Financial
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
* @param mixed maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed issue The security's issue date.
- * @param int rate The security's interest rate at date of issue.
- * @param int price The security's price per $100 face value.
+ * @param mixed issue The security's issue date
+ * @param int rate The security's interest rate at date of issue
+ * @param int price The security's price per $100 face value
* @param int basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
+ * @param mixed $settlement
+ * @param mixed $maturity
+ * @param mixed $issue
+ * @param mixed $rate
+ * @param mixed $price
+ * @param mixed $basis
+ *
* @return float
*/
public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis = 0)
diff --git a/src/PhpSpreadsheet/Calculation/FormulaParser.php b/src/PhpSpreadsheet/Calculation/FormulaParser.php
index 6381f0d2..6c214e5b 100644
--- a/src/PhpSpreadsheet/Calculation/FormulaParser.php
+++ b/src/PhpSpreadsheet/Calculation/FormulaParser.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -66,23 +67,24 @@ class FormulaParser
const OPERATORS_POSTFIX = '%';
/**
- * Formula
+ * Formula.
*
* @var string
*/
private $formula;
/**
- * Tokens
+ * Tokens.
*
* @var FormulaToken[]
*/
private $tokens = [];
/**
- * Create a new FormulaParser
+ * Create a new FormulaParser.
*
* @param string $pFormula Formula to parse
+ *
* @throws Exception
*/
public function __construct($pFormula = '')
@@ -99,7 +101,7 @@ class FormulaParser
}
/**
- * Get Formula
+ * Get Formula.
*
* @return string
*/
@@ -109,23 +111,24 @@ class FormulaParser
}
/**
- * Get Token
+ * Get Token.
*
* @param int $pId Token id
+ *
* @throws Exception
+ *
* @return string
*/
public function getToken($pId = 0)
{
if (isset($this->tokens[$pId])) {
return $this->tokens[$pId];
- } else {
- throw new Exception("Token with id $pId does not exist.");
}
+ throw new Exception("Token with id $pId does not exist.");
}
/**
- * Get Token count
+ * Get Token count.
*
* @return int
*/
@@ -135,7 +138,7 @@ class FormulaParser
}
/**
- * Get Tokens
+ * Get Tokens.
*
* @return FormulaToken[]
*/
@@ -145,7 +148,7 @@ class FormulaParser
}
/**
- * Parse to tokens
+ * Parse to tokens.
*/
private function parseToTokens()
{
@@ -154,7 +157,7 @@ class FormulaParser
// Check if the formula has a valid starting =
$formulaLength = strlen($this->formula);
- if ($formulaLength < 2 || $this->formula{0} != '=') {
+ if ($formulaLength < 2 || $this->formula[0] != '=') {
return;
}
@@ -176,8 +179,8 @@ class FormulaParser
// embeds are doubled
// end marks token
if ($inString) {
- if ($this->formula{$index} == self::QUOTE_DOUBLE) {
- if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == self::QUOTE_DOUBLE)) {
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_DOUBLE)) {
$value .= self::QUOTE_DOUBLE;
++$index;
} else {
@@ -186,7 +189,7 @@ class FormulaParser
$value = '';
}
} else {
- $value .= $this->formula{$index};
+ $value .= $this->formula[$index];
}
++$index;
continue;
@@ -196,15 +199,15 @@ class FormulaParser
// embeds are double
// end does not mark a token
if ($inPath) {
- if ($this->formula{$index} == self::QUOTE_SINGLE) {
- if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == self::QUOTE_SINGLE)) {
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_SINGLE)) {
$value .= self::QUOTE_SINGLE;
++$index;
} else {
$inPath = false;
}
} else {
- $value .= $this->formula{$index};
+ $value .= $this->formula[$index];
}
++$index;
continue;
@@ -214,10 +217,10 @@ class FormulaParser
// no embeds (changed to "()" by Excel)
// end does not mark a token
if ($inRange) {
- if ($this->formula{$index} == self::BRACKET_CLOSE) {
+ if ($this->formula[$index] == self::BRACKET_CLOSE) {
$inRange = false;
}
- $value .= $this->formula{$index};
+ $value .= $this->formula[$index];
++$index;
continue;
}
@@ -225,7 +228,7 @@ class FormulaParser
// error values
// end marks a token, determined from absolute list of values
if ($inError) {
- $value .= $this->formula{$index};
+ $value .= $this->formula[$index];
++$index;
if (in_array($value, $ERRORS)) {
$inError = false;
@@ -236,10 +239,10 @@ class FormulaParser
}
// scientific notation check
- if (strpos(self::OPERATORS_SN, $this->formula{$index}) !== false) {
+ if (strpos(self::OPERATORS_SN, $this->formula[$index]) !== false) {
if (strlen($value) > 1) {
- if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula{$index}) != 0) {
- $value .= $this->formula{$index};
+ if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula[$index]) != 0) {
+ $value .= $this->formula[$index];
++$index;
continue;
}
@@ -249,7 +252,7 @@ class FormulaParser
// independent character evaluation (order not important)
// establish state-dependent character evaluations
- if ($this->formula{$index} == self::QUOTE_DOUBLE) {
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
if (strlen($value > 0)) {
// unexpected
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
@@ -260,7 +263,7 @@ class FormulaParser
continue;
}
- if ($this->formula{$index} == self::QUOTE_SINGLE) {
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
@@ -271,14 +274,14 @@ class FormulaParser
continue;
}
- if ($this->formula{$index} == self::BRACKET_OPEN) {
+ if ($this->formula[$index] == self::BRACKET_OPEN) {
$inRange = true;
$value .= self::BRACKET_OPEN;
++$index;
continue;
}
- if ($this->formula{$index} == self::ERROR_START) {
+ if ($this->formula[$index] == self::ERROR_START) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
@@ -291,7 +294,7 @@ class FormulaParser
}
// mark start and end of arrays and array rows
- if ($this->formula{$index} == self::BRACE_OPEN) {
+ if ($this->formula[$index] == self::BRACE_OPEN) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
@@ -310,7 +313,7 @@ class FormulaParser
continue;
}
- if ($this->formula{$index} == self::SEMICOLON) {
+ if ($this->formula[$index] == self::SEMICOLON) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
@@ -332,7 +335,7 @@ class FormulaParser
continue;
}
- if ($this->formula{$index} == self::BRACE_CLOSE) {
+ if ($this->formula[$index] == self::BRACE_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
@@ -353,14 +356,14 @@ class FormulaParser
}
// trim white-space
- if ($this->formula{$index} == self::WHITESPACE) {
+ if ($this->formula[$index] == self::WHITESPACE) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
}
$tokens1[] = new FormulaToken('', FormulaToken::TOKEN_TYPE_WHITESPACE);
++$index;
- while (($this->formula{$index} == self::WHITESPACE) && ($index < $formulaLength)) {
+ while (($this->formula[$index] == self::WHITESPACE) && ($index < $formulaLength)) {
++$index;
}
continue;
@@ -380,29 +383,29 @@ class FormulaParser
}
// standard infix operators
- if (strpos(self::OPERATORS_INFIX, $this->formula{$index}) !== false) {
+ if (strpos(self::OPERATORS_INFIX, $this->formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
}
- $tokens1[] = new FormulaToken($this->formula{$index}, FormulaToken::TOKEN_TYPE_OPERATORINFIX);
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORINFIX);
++$index;
continue;
}
// standard postfix operators (only one)
- if (strpos(self::OPERATORS_POSTFIX, $this->formula{$index}) !== false) {
+ if (strpos(self::OPERATORS_POSTFIX, $this->formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
}
- $tokens1[] = new FormulaToken($this->formula{$index}, FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
++$index;
continue;
}
// start subexpression or function
- if ($this->formula{$index} == self::PAREN_OPEN) {
+ if ($this->formula[$index] == self::PAREN_OPEN) {
if (strlen($value) > 0) {
$tmp = new FormulaToken($value, FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
$tokens1[] = $tmp;
@@ -418,7 +421,7 @@ class FormulaParser
}
// function, subexpression, or array parameters, or operand unions
- if ($this->formula{$index} == self::COMMA) {
+ if ($this->formula[$index] == self::COMMA) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
@@ -439,7 +442,7 @@ class FormulaParser
}
// stop subexpression
- if ($this->formula{$index} == self::PAREN_CLOSE) {
+ if ($this->formula[$index] == self::PAREN_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
$value = '';
@@ -455,7 +458,7 @@ class FormulaParser
}
// token accumulation
- $value .= $this->formula{$index};
+ $value .= $this->formula[$index];
++$index;
}
diff --git a/src/PhpSpreadsheet/Calculation/FormulaToken.php b/src/PhpSpreadsheet/Calculation/FormulaToken.php
index f9360ca6..d6a39fdf 100644
--- a/src/PhpSpreadsheet/Calculation/FormulaToken.php
+++ b/src/PhpSpreadsheet/Calculation/FormulaToken.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -75,28 +76,28 @@ class FormulaToken
const TOKEN_SUBTYPE_UNION = 'Union';
/**
- * Value
+ * Value.
*
* @var string
*/
private $value;
/**
- * Token Type (represented by TOKEN_TYPE_*)
+ * Token Type (represented by TOKEN_TYPE_*).
*
* @var string
*/
private $tokenType;
/**
- * Token SubType (represented by TOKEN_SUBTYPE_*)
+ * Token SubType (represented by TOKEN_SUBTYPE_*).
*
* @var string
*/
private $tokenSubType;
/**
- * Create a new FormulaToken
+ * Create a new FormulaToken.
*
* @param string $pValue
* @param string $pTokenType Token type (represented by TOKEN_TYPE_*)
@@ -111,7 +112,7 @@ class FormulaToken
}
/**
- * Get Value
+ * Get Value.
*
* @return string
*/
@@ -121,7 +122,7 @@ class FormulaToken
}
/**
- * Set Value
+ * Set Value.
*
* @param string $value
*/
@@ -131,7 +132,7 @@ class FormulaToken
}
/**
- * Get Token Type (represented by TOKEN_TYPE_*)
+ * Get Token Type (represented by TOKEN_TYPE_*).
*
* @return string
*/
@@ -141,7 +142,7 @@ class FormulaToken
}
/**
- * Set Token Type
+ * Set Token Type.
*
* @param string $value
*/
@@ -151,7 +152,7 @@ class FormulaToken
}
/**
- * Get Token SubType (represented by TOKEN_SUBTYPE_*)
+ * Get Token SubType (represented by TOKEN_SUBTYPE_*).
*
* @return string
*/
@@ -161,7 +162,7 @@ class FormulaToken
}
/**
- * Set Token SubType
+ * Set Token SubType.
*
* @param string $value
*/
diff --git a/src/PhpSpreadsheet/Calculation/Functions.php b/src/PhpSpreadsheet/Calculation/Functions.php
index f41092ea..bdd2edd2 100644
--- a/src/PhpSpreadsheet/Calculation/Functions.php
+++ b/src/PhpSpreadsheet/Calculation/Functions.php
@@ -15,7 +15,7 @@ define('MAX_ITERATIONS', 256);
define('PRECISION', 8.88E-016);
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,6 +32,7 @@ define('PRECISION', 8.88E-016);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -47,21 +48,21 @@ class Functions
const RETURNDATE_EXCEL = 'E';
/**
- * Compatibility mode to use for error checking and responses
+ * Compatibility mode to use for error checking and responses.
*
* @var string
*/
protected static $compatibilityMode = self::COMPATIBILITY_EXCEL;
/**
- * Data Type to use when returning date values
+ * Data Type to use when returning date values.
*
* @var string
*/
protected static $returnDateType = self::RETURNDATE_EXCEL;
/**
- * List of error codes
+ * List of error codes.
*
* @var array
*/
@@ -77,14 +78,16 @@ class Functions
];
/**
- * Set the Compatibility Mode
+ * Set the Compatibility Mode.
*
* @category Function Configuration
+ *
* @param string $compatibilityMode Compatibility Mode
* Permitted values are:
* Functions::COMPATIBILITY_EXCEL 'Excel'
* Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
* Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
+ *
* @return bool (Success or Failure)
*/
public static function setCompatibilityMode($compatibilityMode)
@@ -102,9 +105,10 @@ class Functions
}
/**
- * Return the current Compatibility Mode
+ * Return the current Compatibility Mode.
*
* @category Function Configuration
+ *
* @return string Compatibility Mode
* Possible Return values are:
* Functions::COMPATIBILITY_EXCEL 'Excel'
@@ -117,14 +121,16 @@ class Functions
}
/**
- * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
+ * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
*
* @category Function Configuration
+ *
* @param string $returnDateType Return Date Format
* Permitted values are:
* Functions::RETURNDATE_PHP_NUMERIC 'P'
* Functions::RETURNDATE_PHP_OBJECT 'O'
* Functions::RETURNDATE_EXCEL 'E'
+ *
* @return bool Success or failure
*/
public static function setReturnDateType($returnDateType)
@@ -142,9 +148,10 @@ class Functions
}
/**
- * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
+ * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
*
* @category Function Configuration
+ *
* @return string Return Date Format
* Possible Return values are:
* Functions::RETURNDATE_PHP_NUMERIC 'P'
@@ -157,9 +164,10 @@ class Functions
}
/**
- * DUMMY
+ * DUMMY.
*
* @category Error Returns
+ *
* @return string #Not Yet Implemented
*/
public static function DUMMY()
@@ -168,9 +176,10 @@ class Functions
}
/**
- * DIV0
+ * DIV0.
*
* @category Error Returns
+ *
* @return string #Not Yet Implemented
*/
public static function DIV0()
@@ -179,7 +188,7 @@ class Functions
}
/**
- * NA
+ * NA.
*
* Excel Function:
* =NA()
@@ -188,6 +197,7 @@ class Functions
* #N/A is the error value that means "no value is available."
*
* @category Logical Functions
+ *
* @return string #N/A!
*/
public static function NA()
@@ -196,11 +206,12 @@ class Functions
}
/**
- * NaN
+ * NaN.
*
* Returns the error value #NUM!
*
* @category Error Returns
+ *
* @return string #NUM!
*/
public static function NAN()
@@ -209,11 +220,12 @@ class Functions
}
/**
- * NAME
+ * NAME.
*
* Returns the error value #NAME?
*
* @category Error Returns
+ *
* @return string #NAME?
*/
public static function NAME()
@@ -222,11 +234,12 @@ class Functions
}
/**
- * REF
+ * REF.
*
* Returns the error value #REF!
*
* @category Error Returns
+ *
* @return string #REF!
*/
public static function REF()
@@ -235,11 +248,12 @@ class Functions
}
/**
- * NULL
+ * NULL.
*
* Returns the error value #NULL!
*
* @category Error Returns
+ *
* @return string #NULL!
*/
public static function null()
@@ -248,11 +262,12 @@ class Functions
}
/**
- * VALUE
+ * VALUE.
*
* Returns the error value #VALUE!
*
* @category Error Returns
+ *
* @return string #VALUE!
*/
public static function VALUE()
@@ -278,32 +293,32 @@ class Functions
public static function ifCondition($condition)
{
$condition = self::flattenSingleValue($condition);
- if (!isset($condition{0})) {
+ if (!isset($condition[0])) {
$condition = '=""';
}
- if (!in_array($condition{0}, ['>', '<', '='])) {
+ if (!in_array($condition[0], ['>', '<', '='])) {
if (!is_numeric($condition)) {
$condition = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition));
}
return '=' . $condition;
- } else {
- preg_match('/([<>=]+)(.*)/', $condition, $matches);
- list(, $operator, $operand) = $matches;
-
- if (!is_numeric($operand)) {
- $operand = str_replace('"', '""', $operand);
- $operand = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand));
- }
-
- return $operator . $operand;
}
+ preg_match('/([<>=]+)(.*)/', $condition, $matches);
+ list(, $operator, $operand) = $matches;
+
+ if (!is_numeric($operand)) {
+ $operand = str_replace('"', '""', $operand);
+ $operand = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand));
+ }
+
+ return $operator . $operand;
}
/**
- * ERROR_TYPE
+ * ERROR_TYPE.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function errorType($value = '')
@@ -322,9 +337,10 @@ class Functions
}
/**
- * IS_BLANK
+ * IS_BLANK.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isBlank($value = null)
@@ -337,9 +353,10 @@ class Functions
}
/**
- * IS_ERR
+ * IS_ERR.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isErr($value = '')
@@ -350,9 +367,10 @@ class Functions
}
/**
- * IS_ERROR
+ * IS_ERROR.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isError($value = '')
@@ -367,9 +385,10 @@ class Functions
}
/**
- * IS_NA
+ * IS_NA.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isNa($value = '')
@@ -380,9 +399,10 @@ class Functions
}
/**
- * IS_EVEN
+ * IS_EVEN.
*
* @param mixed $value Value to check
+ *
* @return string|bool
*/
public static function isEven($value = null)
@@ -399,9 +419,10 @@ class Functions
}
/**
- * IS_ODD
+ * IS_ODD.
*
* @param mixed $value Value to check
+ *
* @return string|bool
*/
public static function isOdd($value = null)
@@ -418,9 +439,10 @@ class Functions
}
/**
- * IS_NUMBER
+ * IS_NUMBER.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isNumber($value = null)
@@ -435,9 +457,10 @@ class Functions
}
/**
- * IS_LOGICAL
+ * IS_LOGICAL.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isLogical($value = null)
@@ -448,9 +471,10 @@ class Functions
}
/**
- * IS_TEXT
+ * IS_TEXT.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isText($value = null)
@@ -461,9 +485,10 @@ class Functions
}
/**
- * IS_NONTEXT
+ * IS_NONTEXT.
*
* @param mixed $value Value to check
+ *
* @return bool
*/
public static function isNonText($value = null)
@@ -472,11 +497,13 @@ class Functions
}
/**
- * N
+ * N.
*
* Returns a value converted to a number
*
* @param value The value you want converted
+ * @param null|mixed $value
+ *
* @return number N converts values listed in the following table
* If value is or refers to N returns
* A number That number
@@ -498,10 +525,10 @@ class Functions
case 'integer':
return $value;
case 'boolean':
- return (integer) $value;
+ return (int) $value;
case 'string':
// Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
return $value;
}
break;
@@ -511,11 +538,13 @@ class Functions
}
/**
- * TYPE
+ * TYPE.
*
* Returns a number that identifies the type of a value
*
* @param value The value you want tested
+ * @param null|mixed $value
+ *
* @return number N converts values listed in the following table
* If value is or refers to N returns
* A number 1
@@ -551,7 +580,7 @@ class Functions
return 64;
} elseif (is_string($value)) {
// Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
return 16;
}
@@ -562,9 +591,10 @@ class Functions
}
/**
- * Convert a multi-dimensional array to a simple 1-dimensional array
+ * Convert a multi-dimensional array to a simple 1-dimensional array.
*
* @param array $array Array to be flattened
+ *
* @return array Flattened array
*/
public static function flattenArray($array)
@@ -594,9 +624,10 @@ class Functions
}
/**
- * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing
+ * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
*
* @param array $array Array to be flattened
+ *
* @return array Flattened array
*/
public static function flattenArrayIndexed($array)
@@ -626,9 +657,10 @@ class Functions
}
/**
- * Convert an array to a single scalar value by extracting the first element
+ * Convert an array to a single scalar value by extracting the first element.
*
* @param mixed $value Array or scalar value
+ *
* @return mixed
*/
public static function flattenSingleValue($value = '')
diff --git a/src/PhpSpreadsheet/Calculation/Logical.php b/src/PhpSpreadsheet/Calculation/Logical.php
index 1bc4711d..e120f90c 100644
--- a/src/PhpSpreadsheet/Calculation/Logical.php
+++ b/src/PhpSpreadsheet/Calculation/Logical.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Logical
{
/**
- * TRUE
+ * TRUE.
*
* Returns the boolean TRUE.
*
@@ -34,6 +35,7 @@ class Logical
* =TRUE()
*
* @category Logical Functions
+ *
* @return bool True
*/
public static function true()
@@ -42,7 +44,7 @@ class Logical
}
/**
- * FALSE
+ * FALSE.
*
* Returns the boolean FALSE.
*
@@ -50,6 +52,7 @@ class Logical
* =FALSE()
*
* @category Logical Functions
+ *
* @return bool False
*/
public static function false()
@@ -58,7 +61,7 @@ class Logical
}
/**
- * LOGICAL_AND
+ * LOGICAL_AND.
*
* Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.
*
@@ -74,8 +77,10 @@ class Logical
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
*
* @category Logical Functions
+ *
* @param mixed $arg,... Data values
- * @return string|bool The logical AND of the arguments.
+ *
+ * @return string|bool the logical AND of the arguments
*/
public static function logicalAnd()
{
@@ -113,7 +118,7 @@ class Logical
}
/**
- * LOGICAL_OR
+ * LOGICAL_OR.
*
* Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
*
@@ -129,8 +134,10 @@ class Logical
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
*
* @category Logical Functions
+ *
* @param mixed $arg,... Data values
- * @return string|bool The logical OR of the arguments.
+ *
+ * @return string|bool the logical OR of the arguments
*/
public static function logicalOr()
{
@@ -168,7 +175,7 @@ class Logical
}
/**
- * NOT
+ * NOT.
*
* Returns the boolean inverse of the argument.
*
@@ -183,8 +190,10 @@ class Logical
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
*
* @category Logical Functions
+ *
* @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
- * @return bool|string The boolean inverse of the argument.
+ *
+ * @return bool|string the boolean inverse of the argument
*/
public static function NOT($logical = false)
{
@@ -195,16 +204,16 @@ class Logical
return false;
} elseif (($logical == 'FALSE') || ($logical == \PhpOffice\PhpSpreadsheet\Calculation::getFALSE())) {
return true;
- } else {
- return Functions::VALUE();
}
+
+ return Functions::VALUE();
}
return !$logical;
}
/**
- * STATEMENT_IF
+ * STATEMENT_IF.
*
* Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
*
@@ -229,14 +238,16 @@ class Logical
* ReturnIfFalse can be another formula.
*
* @category Logical Functions
+ *
* @param mixed $condition Condition to evaluate
* @param mixed $returnIfTrue Value to return when condition is true
* @param mixed $returnIfFalse Optional value to return when condition is false
+ *
* @return mixed The value of returnIfTrue or returnIfFalse determined by condition
*/
public static function statementIf($condition = true, $returnIfTrue = 0, $returnIfFalse = false)
{
- $condition = (is_null($condition)) ? true : (boolean) Functions::flattenSingleValue($condition);
+ $condition = (is_null($condition)) ? true : (bool) Functions::flattenSingleValue($condition);
$returnIfTrue = (is_null($returnIfTrue)) ? 0 : Functions::flattenSingleValue($returnIfTrue);
$returnIfFalse = (is_null($returnIfFalse)) ? false : Functions::flattenSingleValue($returnIfFalse);
@@ -244,14 +255,16 @@ class Logical
}
/**
- * IFERROR
+ * IFERROR.
*
* Excel Function:
* =IFERROR(testValue,errorpart)
*
* @category Logical Functions
+ *
* @param mixed $testValue Value to check, is also the value returned when no error
* @param mixed $errorpart Value to return when testValue is an error condition
+ *
* @return mixed The value of errorpart or testValue determined by error condition
*/
public static function IFERROR($testValue = '', $errorpart = '')
diff --git a/src/PhpSpreadsheet/Calculation/LookupRef.php b/src/PhpSpreadsheet/Calculation/LookupRef.php
index b0e601ba..ceb06411 100644
--- a/src/PhpSpreadsheet/Calculation/LookupRef.php
+++ b/src/PhpSpreadsheet/Calculation/LookupRef.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class LookupRef
{
/**
- * CELL_ADDRESS
+ * CELL_ADDRESS.
*
* Creates a cell address as text, given specified row and column numbers.
*
@@ -44,6 +45,12 @@ class LookupRef
* 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
+ *
* @return string
*/
public static function cellAddress($row, $column, $relativity = 1, $referenceStyle = true, $sheetText = '')
@@ -74,20 +81,19 @@ class LookupRef
}
return $sheetText . $columnRelative . $column . $rowRelative . $row;
- } else {
- if (($relativity == 2) || ($relativity == 4)) {
- $column = '[' . $column . ']';
- }
- if (($relativity == 3) || ($relativity == 4)) {
- $row = '[' . $row . ']';
- }
-
- return $sheetText . 'R' . $row . 'C' . $column;
}
+ if (($relativity == 2) || ($relativity == 4)) {
+ $column = '[' . $column . ']';
+ }
+ if (($relativity == 3) || ($relativity == 4)) {
+ $row = '[' . $row . ']';
+ }
+
+ return $sheetText . 'R' . $row . 'C' . $column;
}
/**
- * COLUMN
+ * COLUMN.
*
* Returns the column number of the given cell reference
* If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array.
@@ -98,6 +104,8 @@ class LookupRef
* =COLUMN([cellAddress])
*
* @param cellAddress A reference to a range of cells for which you want the column numbers
+ * @param null|mixed $cellAddress
+ *
* @return int or array of integer
*/
public static function COLUMN($cellAddress = null)
@@ -110,7 +118,7 @@ class LookupRef
foreach ($cellAddress as $columnKey => $value) {
$columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
- return (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnKey);
+ return (int) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnKey);
}
} else {
if (strpos($cellAddress, '!') !== false) {
@@ -122,20 +130,19 @@ class LookupRef
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
$returnValue = [];
do {
- $returnValue[] = (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startAddress);
+ $returnValue[] = (int) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startAddress);
} while ($startAddress++ != $endAddress);
return $returnValue;
- } else {
- $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
-
- return (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($cellAddress);
}
+ $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
+
+ return (int) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($cellAddress);
}
}
/**
- * COLUMNS
+ * COLUMNS.
*
* Returns the number of columns in an array or reference.
*
@@ -143,6 +150,8 @@ class LookupRef
* =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
+ *
* @return int The number of columns in cellAddress
*/
public static function COLUMNS($cellAddress = null)
@@ -159,13 +168,13 @@ class LookupRef
if ($isMatrix) {
return $rows;
- } else {
- return $columns;
}
+
+ return $columns;
}
/**
- * ROW
+ * ROW.
*
* Returns the row number of the given cell reference
* If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array.
@@ -176,6 +185,8 @@ class LookupRef
* =ROW([cellAddress])
*
* @param cellAddress A reference to a range of cells for which you want the row numbers
+ * @param null|mixed $cellAddress
+ *
* @return int or array of integer
*/
public static function ROW($cellAddress = null)
@@ -187,7 +198,7 @@ class LookupRef
if (is_array($cellAddress)) {
foreach ($cellAddress as $columnKey => $rowValue) {
foreach ($rowValue as $rowKey => $cellValue) {
- return (integer) preg_replace('/[^0-9]/i', '', $rowKey);
+ return (int) preg_replace('/[^0-9]/i', '', $rowKey);
}
}
} else {
@@ -200,20 +211,19 @@ class LookupRef
$endAddress = preg_replace('/[^0-9]/', '', $endAddress);
$returnValue = [];
do {
- $returnValue[][] = (integer) $startAddress;
+ $returnValue[][] = (int) $startAddress;
} while ($startAddress++ != $endAddress);
return $returnValue;
- } else {
- list($cellAddress) = explode(':', $cellAddress);
-
- return (integer) preg_replace('/[^0-9]/', '', $cellAddress);
}
+ list($cellAddress) = explode(':', $cellAddress);
+
+ return (int) preg_replace('/[^0-9]/', '', $cellAddress);
}
}
/**
- * ROWS
+ * ROWS.
*
* Returns the number of rows in an array or reference.
*
@@ -221,6 +231,8 @@ class LookupRef
* =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|mixed $cellAddress
+ *
* @return int The number of rows in cellAddress
*/
public static function ROWS($cellAddress = null)
@@ -237,21 +249,23 @@ class LookupRef
if ($isMatrix) {
return $columns;
- } else {
- return $rows;
}
+
+ return $rows;
}
/**
- * HYPERLINK
+ * HYPERLINK.
*
* Excel Function:
* =HYPERLINK(linkURL,displayName)
*
* @category Logical Functions
+ *
* @param string $linkURL Value to check, is also the value returned when no error
* @param string $displayName Value to return when testValue is an error condition
* @param \PhpOffice\PhpSpreadsheet\Cell $pCell The cell to set the hyperlink in
+ *
* @return mixed The value of $displayName (or $linkURL if $displayName was blank)
*/
public static function HYPERLINK($linkURL = '', $displayName = null, \PhpOffice\PhpSpreadsheet\Cell $pCell = null)
@@ -277,7 +291,7 @@ class LookupRef
}
/**
- * INDIRECT
+ * INDIRECT.
*
* Returns the reference specified by a text string.
* References are immediately evaluated to display their contents.
@@ -289,6 +303,7 @@ class LookupRef
*
* @param cellAddress $cellAddress The cell address of the current cell (containing this formula)
* @param \PhpOffice\PhpSpreadsheet\Cell $pCell The current cell (containing this formula)
+ *
* @return mixed The cells referenced by cellAddress
*
* @todo Support for the optional a1 parameter introduced in Excel 2010
@@ -335,7 +350,7 @@ class LookupRef
}
/**
- * OFFSET
+ * OFFSET.
*
* Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
* The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and
@@ -357,6 +372,12 @@ class LookupRef
* 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
+ *
* @return string A reference to a cell or range of cells
*/
public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null)
@@ -429,7 +450,7 @@ class LookupRef
}
/**
- * CHOOSE
+ * CHOOSE.
*
* Uses lookup_value to return a value from the list of value arguments.
* Use CHOOSE to select one of up to 254 values based on the lookup_value.
@@ -444,6 +465,7 @@ class LookupRef
* 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.
+ *
* @return mixed The selected value
*/
public static function CHOOSE()
@@ -467,13 +489,13 @@ class LookupRef
if (is_array($chooseArgs[$chosenEntry])) {
return Functions::flattenArray($chooseArgs[$chosenEntry]);
- } else {
- return $chooseArgs[$chosenEntry];
}
+
+ return $chooseArgs[$chosenEntry];
}
/**
- * MATCH
+ * MATCH.
*
* The MATCH function searches for a specified item in a range of cells
*
@@ -483,6 +505,10 @@ class LookupRef
* @param lookup_value The value that you want to match in lookup_array
* @param lookup_array The range of cells being searched
* @param match_type The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.
+ * @param mixed $lookup_value
+ * @param mixed $lookup_array
+ * @param mixed $match_type
+ *
* @return int The relative position of the found item
*/
public static function MATCH($lookup_value, $lookup_array, $match_type = 1)
@@ -547,20 +573,18 @@ class LookupRef
if ($i < 1) {
// 1st cell was already smaller than the lookup_value
break;
- } else {
+ }
// the previous cell was the match
return $keySet[$i - 1] + 1;
- }
} elseif (($match_type == 1) && ($lookupArrayValue >= $lookup_value)) {
$i = array_search($i, $keySet);
// if match_type is 1 <=> find the largest value that is less than or equal to lookup_value
if ($i < 1) {
// 1st cell was already bigger than the lookup_value
break;
- } else {
+ }
// the previous cell was the match
return $keySet[$i - 1] + 1;
- }
}
}
@@ -569,7 +593,7 @@ class LookupRef
}
/**
- * INDEX
+ * INDEX.
*
* Uses an index to choose a value from a reference or array
*
@@ -579,6 +603,10 @@ class LookupRef
* @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
+ *
* @return mixed the value of a specified cell or array of cells
*/
public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0)
@@ -628,12 +656,13 @@ class LookupRef
}
/**
- * TRANSPOSE
+ * TRANSPOSE.
*
* @param array $matrixData A matrix of values
+ *
* @return array
*
- * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix.
+ * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix
*/
public static function TRANSPOSE($matrixData)
{
@@ -669,10 +698,16 @@ class LookupRef
/**
* 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 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
+ *
* @return mixed The value of the found cell
*/
public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
@@ -689,17 +724,15 @@ class LookupRef
// index_number must be less than or equal to the number of columns in lookup_array
if ((!is_array($lookup_array)) || (empty($lookup_array))) {
return Functions::REF();
- } else {
- $f = array_keys($lookup_array);
- $firstRow = array_pop($f);
- if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
- return Functions::REF();
- } else {
- $columnKeys = array_keys($lookup_array[$firstRow]);
- $returnColumn = $columnKeys[--$index_number];
- $firstColumn = array_shift($columnKeys);
- }
}
+ $f = array_keys($lookup_array);
+ $firstRow = array_pop($f);
+ if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
+ return Functions::REF();
+ }
+ $columnKeys = array_keys($lookup_array[$firstRow]);
+ $returnColumn = $columnKeys[--$index_number];
+ $firstColumn = array_shift($columnKeys);
if (!$not_exact_match) {
uasort($lookup_array, ['self', 'vlookupSort']);
@@ -723,10 +756,9 @@ class LookupRef
if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
// if an exact match is required, we have what we need to return an appropriate response
return Functions::NA();
- } else {
+ }
// otherwise return the appropriate value
return $lookup_array[$rowNumber][$returnColumn];
- }
}
return Functions::NA();
@@ -735,10 +767,16 @@ class LookupRef
/**
* 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 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
+ *
* @return mixed The value of the found cell
*/
public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
@@ -755,18 +793,16 @@ class LookupRef
// index_number must be less than or equal to the number of columns in lookup_array
if ((!is_array($lookup_array)) || (empty($lookup_array))) {
return Functions::REF();
- } else {
- $f = array_keys($lookup_array);
- $firstRow = array_pop($f);
- if ((!is_array($lookup_array[$firstRow])) || ($index_number - 1 > count($lookup_array[$firstRow]))) {
- return Functions::REF();
- } else {
- $columnKeys = array_keys($lookup_array[$firstRow]);
- $firstkey = $f[0] - 1;
- $returnColumn = $firstkey + $index_number;
- $firstColumn = array_shift($f);
- }
}
+ $f = array_keys($lookup_array);
+ $firstRow = array_pop($f);
+ if ((!is_array($lookup_array[$firstRow])) || ($index_number - 1 > count($lookup_array[$firstRow]))) {
+ return Functions::REF();
+ }
+ $columnKeys = array_keys($lookup_array[$firstRow]);
+ $firstkey = $f[0] - 1;
+ $returnColumn = $firstkey + $index_number;
+ $firstColumn = array_shift($f);
if (!$not_exact_match) {
$firstRowH = asort($lookup_array[$firstColumn]);
@@ -785,10 +821,9 @@ class LookupRef
if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
// if an exact match is required, we have what we need to return an appropriate response
return Functions::NA();
- } else {
+ }
// otherwise return the appropriate value
return $lookup_array[$returnColumn][$rowNumber];
- }
}
return Functions::NA();
@@ -797,9 +832,14 @@ class LookupRef
/**
* 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
+ *
* @return mixed The value of the found cell
*/
public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php
index 9c6b60ec..34582f41 100644
--- a/src/PhpSpreadsheet/Calculation/MathTrig.php
+++ b/src/PhpSpreadsheet/Calculation/MathTrig.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Calculation;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -46,9 +47,9 @@ class MathTrig
rsort($factorArray);
return $factorArray;
- } else {
- return [(integer) $value];
}
+
+ return [(int) $value];
}
private static function romanCut($num, $n)
@@ -57,7 +58,7 @@ class MathTrig
}
/**
- * ATAN2
+ * ATAN2.
*
* This function calculates the arc tangent of the two variables x and y. It is similar to
* calculating the arc tangent of y Ă· x, except that the signs of both arguments are used
@@ -73,9 +74,11 @@ class MathTrig
* ATAN2(xCoordinate,yCoordinate)
*
* @category Mathematical and Trigonometric Functions
- * @param float $xCoordinate The x-coordinate of the point.
- * @param float $yCoordinate The y-coordinate of the point.
- * @return float The inverse tangent of the specified x- and y-coordinates.
+ *
+ * @param float $xCoordinate the x-coordinate of the point
+ * @param float $yCoordinate the y-coordinate of the point
+ *
+ * @return float the inverse tangent of the specified x- and y-coordinates
*/
public static function ATAN2($xCoordinate = null, $yCoordinate = null)
{
@@ -101,7 +104,7 @@ class MathTrig
}
/**
- * CEILING
+ * CEILING.
*
* Returns number rounded up, away from zero, to the nearest multiple of significance.
* For example, if you want to avoid using pennies in your prices and your product is
@@ -112,8 +115,10 @@ class MathTrig
* CEILING(number[,significance])
*
* @category Mathematical and Trigonometric Functions
- * @param float $number The number you want to round.
- * @param float $significance The multiple to which you want to round.
+ *
+ * @param float $number the number you want to round
+ * @param float $significance the multiple to which you want to round
+ *
* @return float Rounded Number
*/
public static function CEILING($number, $significance = null)
@@ -131,16 +136,16 @@ class MathTrig
return 0.0;
} elseif (self::SIGN($number) == self::SIGN($significance)) {
return ceil($number / $significance) * $significance;
- } else {
- return Functions::NAN();
}
+
+ return Functions::NAN();
}
return Functions::VALUE();
}
/**
- * COMBIN
+ * COMBIN.
*
* Returns the number of combinations for a given number of items. Use COMBIN to
* determine the total possible number of groups for a given number of items.
@@ -149,8 +154,10 @@ class MathTrig
* COMBIN(numObjs,numInSet)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param int $numObjs Number of different objects
* @param int $numInSet Number of objects in each combination
+ *
* @return int Number of combinations
*/
public static function COMBIN($numObjs, $numInSet)
@@ -172,7 +179,7 @@ class MathTrig
}
/**
- * EVEN
+ * EVEN.
*
* Returns number rounded up to the nearest even integer.
* You can use this function for processing items that come in twos. For example,
@@ -184,7 +191,9 @@ class MathTrig
* EVEN(number)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $number Number to round
+ *
* @return int Rounded Number
*/
public static function EVEN($number)
@@ -207,7 +216,7 @@ class MathTrig
}
/**
- * FACT
+ * FACT.
*
* Returns the factorial of a number.
* The factorial of a number is equal to 1*2*3*...* number.
@@ -216,7 +225,9 @@ class MathTrig
* FACT(factVal)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $factVal Factorial Value
+ *
* @return int Factorial
*/
public static function FACT($factVal)
@@ -246,7 +257,7 @@ class MathTrig
}
/**
- * FACTDOUBLE
+ * FACTDOUBLE.
*
* Returns the double factorial of a number.
*
@@ -254,7 +265,9 @@ class MathTrig
* FACTDOUBLE(factVal)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $factVal Factorial Value
+ *
* @return int Double Factorial
*/
public static function FACTDOUBLE($factVal)
@@ -279,7 +292,7 @@ class MathTrig
}
/**
- * FLOOR
+ * FLOOR.
*
* Rounds number down, toward zero, to the nearest multiple of significance.
*
@@ -287,8 +300,10 @@ class MathTrig
* FLOOR(number[,significance])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $number Number to round
* @param float $significance Significance
+ *
* @return float Rounded Number
*/
public static function FLOOR($number, $significance = null)
@@ -308,16 +323,16 @@ class MathTrig
return 0.0;
} elseif (self::SIGN($number) == self::SIGN($significance)) {
return floor($number / $significance) * $significance;
- } else {
- return Functions::NAN();
}
+
+ return Functions::NAN();
}
return Functions::VALUE();
}
/**
- * GCD
+ * GCD.
*
* Returns the greatest common divisor of a series of numbers.
* The greatest common divisor is the largest integer that divides both
@@ -327,7 +342,9 @@ class MathTrig
* GCD(number1[,number2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return int Greatest Common Divisor
*/
public static function GCD()
@@ -377,24 +394,23 @@ class MathTrig
}
return $returnValue;
- } else {
- $keys = array_keys($mergedArray);
- $key = $keys[0];
- $value = $mergedArray[$key];
- foreach ($allValuesFactors as $testValue) {
- foreach ($testValue as $mergedKey => $mergedValue) {
- if (($mergedKey == $key) && ($mergedValue < $value)) {
- $value = $mergedValue;
- }
+ }
+ $keys = array_keys($mergedArray);
+ $key = $keys[0];
+ $value = $mergedArray[$key];
+ foreach ($allValuesFactors as $testValue) {
+ foreach ($testValue as $mergedKey => $mergedValue) {
+ if (($mergedKey == $key) && ($mergedValue < $value)) {
+ $value = $mergedValue;
}
}
-
- return pow($key, $value);
}
+
+ return pow($key, $value);
}
/**
- * INT
+ * INT.
*
* Casts a floating point value to an integer
*
@@ -402,7 +418,9 @@ class MathTrig
* INT(number)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $number Number to cast to an integer
+ *
* @return int Integer value
*/
public static function INT($number)
@@ -422,7 +440,7 @@ class MathTrig
}
/**
- * LCM
+ * LCM.
*
* Returns the lowest common multiplier of a series of numbers
* The least common multiple is the smallest positive integer that is a multiple
@@ -433,7 +451,9 @@ class MathTrig
* LCM(number1[,number2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return int Lowest Common Multiplier
*/
public static function LCM()
@@ -467,14 +487,14 @@ class MathTrig
}
}
foreach ($allPoweredFactors as $allPoweredFactor) {
- $returnValue *= (integer) $allPoweredFactor;
+ $returnValue *= (int) $allPoweredFactor;
}
return $returnValue;
}
/**
- * LOG_BASE
+ * LOG_BASE.
*
* Returns the logarithm of a number to a specified base. The default base is 10.
*
@@ -482,8 +502,10 @@ class MathTrig
* LOG(number[,base])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param float $number The positive real number for which you want the logarithm
* @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10.
+ *
* @return float
*/
public static function logBase($number = null, $base = 10)
@@ -502,7 +524,7 @@ class MathTrig
}
/**
- * MDETERM
+ * MDETERM.
*
* Returns the matrix determinant of an array.
*
@@ -510,7 +532,9 @@ class MathTrig
* MDETERM(array)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param array $matrixValues A matrix of values
+ *
* @return float
*/
public static function MDETERM($matrixValues)
@@ -552,7 +576,7 @@ class MathTrig
}
/**
- * MINVERSE
+ * MINVERSE.
*
* Returns the inverse matrix for the matrix stored in an array.
*
@@ -560,7 +584,9 @@ class MathTrig
* MINVERSE(array)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param array $matrixValues A matrix of values
+ *
* @return array
*/
public static function MINVERSE($matrixValues)
@@ -604,10 +630,11 @@ class MathTrig
}
/**
- * MMULT
+ * MMULT.
*
* @param array $matrixData1 A matrix of values
* @param array $matrixData2 A matrix of values
+ *
* @return array
*/
public static function MMULT($matrixData1, $matrixData2)
@@ -665,10 +692,11 @@ class MathTrig
}
/**
- * MOD
+ * MOD.
*
* @param int $a Dividend
* @param int $b Divisor
+ *
* @return int Remainder
*/
public static function MOD($a = 1, $b = 1)
@@ -688,12 +716,13 @@ class MathTrig
}
/**
- * MROUND
+ * MROUND.
*
* Rounds a number to the nearest multiple of a specified value
*
* @param float $number Number to round
* @param int $multiple Multiple to which you want to round $number
+ *
* @return float Rounded Number
*/
public static function MROUND($number, $multiple)
@@ -718,11 +747,12 @@ class MathTrig
}
/**
- * MULTINOMIAL
+ * MULTINOMIAL.
*
* Returns the ratio of the factorial of a sum of values to the product of factorials.
*
* @param array of mixed Data Series
+ *
* @return float
*/
public static function MULTINOMIAL()
@@ -754,11 +784,12 @@ class MathTrig
}
/**
- * ODD
+ * ODD.
*
* Returns number rounded up to the nearest odd integer.
*
* @param float $number Number to round
+ *
* @return int Rounded Number
*/
public static function ODD($number)
@@ -787,12 +818,13 @@ class MathTrig
}
/**
- * POWER
+ * POWER.
*
* Computes x raised to the power y.
*
* @param float $x
* @param float $y
+ *
* @return float
*/
public static function POWER($x = 0, $y = 2)
@@ -814,7 +846,7 @@ class MathTrig
}
/**
- * PRODUCT
+ * PRODUCT.
*
* PRODUCT returns the product of all the values and cells referenced in the argument list.
*
@@ -822,7 +854,9 @@ class MathTrig
* PRODUCT(value1[,value2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return float
*/
public static function PRODUCT()
@@ -851,7 +885,7 @@ class MathTrig
}
/**
- * QUOTIENT
+ * QUOTIENT.
*
* QUOTIENT function returns the integer portion of a division. Numerator is the divided number
* and denominator is the divisor.
@@ -860,7 +894,9 @@ class MathTrig
* QUOTIENT(value1[,value2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return float
*/
public static function QUOTIENT()
@@ -885,14 +921,15 @@ class MathTrig
}
// Return
- return intval($returnValue);
+ return (int) $returnValue;
}
/**
- * RAND
+ * RAND.
*
* @param int $min Minimal value
* @param int $max Maximal value
+ *
* @return int Random number
*/
public static function RAND($min = 0, $max = 0)
@@ -902,19 +939,19 @@ class MathTrig
if ($min == 0 && $max == 0) {
return (mt_rand(0, 10000000)) / 10000000;
- } else {
- return mt_rand($min, $max);
}
+
+ return mt_rand($min, $max);
}
public static function ROMAN($aValue, $style = 0)
{
$aValue = Functions::flattenSingleValue($aValue);
- $style = (is_null($style)) ? 0 : (integer) Functions::flattenSingleValue($style);
+ $style = (is_null($style)) ? 0 : (int) Functions::flattenSingleValue($style);
if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) {
return Functions::VALUE();
}
- $aValue = (integer) $aValue;
+ $aValue = (int) $aValue;
if ($aValue == 0) {
return '';
}
@@ -940,12 +977,13 @@ class MathTrig
}
/**
- * ROUNDUP
+ * ROUNDUP.
*
* Rounds a number up to a specified number of decimal places
*
* @param float $number Number to round
* @param int $digits Number of digits to which you want to round $number
+ *
* @return float Rounded Number
*/
public static function ROUNDUP($number, $digits)
@@ -957,21 +995,22 @@ class MathTrig
$significance = pow(10, (int) $digits);
if ($number < 0.0) {
return floor($number * $significance) / $significance;
- } else {
- return ceil($number * $significance) / $significance;
}
+
+ return ceil($number * $significance) / $significance;
}
return Functions::VALUE();
}
/**
- * ROUNDDOWN
+ * ROUNDDOWN.
*
* Rounds a number down to a specified number of decimal places
*
* @param float $number Number to round
* @param int $digits Number of digits to which you want to round $number
+ *
* @return float Rounded Number
*/
public static function ROUNDDOWN($number, $digits)
@@ -983,16 +1022,16 @@ class MathTrig
$significance = pow(10, (int) $digits);
if ($number < 0.0) {
return ceil($number * $significance) / $significance;
- } else {
- return floor($number * $significance) / $significance;
}
+
+ return floor($number * $significance) / $significance;
}
return Functions::VALUE();
}
/**
- * SERIESSUM
+ * SERIESSUM.
*
* Returns the sum of a power series
*
@@ -1000,6 +1039,7 @@ class MathTrig
* @param float $n Initial power to which you want to raise $x
* @param float $m Step by which to increase $n for each term in the series
* @param array of mixed Data Series
+ *
* @return float
*/
public static function SERIESSUM()
@@ -1032,12 +1072,13 @@ class MathTrig
}
/**
- * SIGN
+ * SIGN.
*
* Determines the sign of a number. Returns 1 if the number is positive, zero (0)
* if the number is 0, and -1 if the number is negative.
*
* @param float $number Number to round
+ *
* @return int sign value
*/
public static function SIGN($number)
@@ -1059,11 +1100,12 @@ class MathTrig
}
/**
- * SQRTPI
+ * SQRTPI.
*
* Returns the square root of (number * pi).
*
* @param float $number Number
+ *
* @return float Square Root of Number * Pi
*/
public static function SQRTPI($number)
@@ -1082,13 +1124,14 @@ class MathTrig
}
/**
- * SUBTOTAL
+ * SUBTOTAL.
*
* Returns a subtotal in a list or database.
*
* @param int the number 1 to 11 that specifies which function to
- * use in calculating subtotals within a list.
+ * use in calculating subtotals within a list
* @param array of mixed Data Series
+ *
* @return float
*/
public static function SUBTOTAL()
@@ -1129,7 +1172,7 @@ class MathTrig
}
/**
- * SUM
+ * SUM.
*
* SUM computes the sum of all the values and cells referenced in the argument list.
*
@@ -1137,7 +1180,9 @@ class MathTrig
* SUM(value1[,value2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return float
*/
public static function SUM()
@@ -1156,7 +1201,7 @@ class MathTrig
}
/**
- * SUMIF
+ * SUMIF.
*
* Counts the number of cells that contain numbers within the list of arguments
*
@@ -1164,8 +1209,12 @@ class MathTrig
* SUMIF(value1[,value2[, ...]],condition)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be summed.
+ * @param string $condition the criteria that defines which cells will be summed
+ * @param mixed $aArgs
+ * @param mixed $sumArgs
+ *
* @return float
*/
public static function SUMIF($aArgs, $condition, $sumArgs = [])
@@ -1196,7 +1245,7 @@ class MathTrig
}
/**
- * SUMIFS
+ * SUMIFS.
*
* Counts the number of cells that contain numbers within the list of arguments
*
@@ -1204,8 +1253,10 @@ class MathTrig
* SUMIFS(value1[,value2[, ...]],condition)
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be summed.
+ * @param string $condition the criteria that defines which cells will be summed
+ *
* @return float
*/
public static function SUMIFS()
@@ -1244,13 +1295,15 @@ class MathTrig
}
/**
- * SUMPRODUCT
+ * SUMPRODUCT.
*
* Excel Function:
* SUMPRODUCT(value1[,value2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return float
*/
public static function SUMPRODUCT()
@@ -1285,7 +1338,7 @@ class MathTrig
}
/**
- * SUMSQ
+ * SUMSQ.
*
* SUMSQ returns the sum of the squares of the arguments
*
@@ -1293,7 +1346,9 @@ class MathTrig
* SUMSQ(value1[,value2[, ...]])
*
* @category Mathematical and Trigonometric Functions
+ *
* @param mixed $arg,... Data values
+ *
* @return float
*/
public static function SUMSQ()
@@ -1312,10 +1367,11 @@ class MathTrig
}
/**
- * SUMX2MY2
+ * SUMX2MY2.
*
* @param mixed[] $matrixData1 Matrix #1
* @param mixed[] $matrixData2 Matrix #2
+ *
* @return float
*/
public static function SUMX2MY2($matrixData1, $matrixData2)
@@ -1336,10 +1392,11 @@ class MathTrig
}
/**
- * SUMX2PY2
+ * SUMX2PY2.
*
* @param mixed[] $matrixData1 Matrix #1
* @param mixed[] $matrixData2 Matrix #2
+ *
* @return float
*/
public static function SUMX2PY2($matrixData1, $matrixData2)
@@ -1360,10 +1417,11 @@ class MathTrig
}
/**
- * SUMXMY2
+ * SUMXMY2.
*
* @param mixed[] $matrixData1 Matrix #1
* @param mixed[] $matrixData2 Matrix #2
+ *
* @return float
*/
public static function SUMXMY2($matrixData1, $matrixData2)
@@ -1384,12 +1442,13 @@ class MathTrig
}
/**
- * TRUNC
+ * TRUNC.
*
* Truncates value to the number of fractional digits by number_digits.
*
* @param float $value
* @param int $digits
+ *
* @return float Truncated value
*/
public static function TRUNC($value = 0, $digits = 0)
@@ -1406,10 +1465,10 @@ class MathTrig
// Truncate
$adjust = pow(10, $digits);
- if (($digits > 0) && (rtrim(intval((abs($value) - abs(intval($value))) * $adjust), '0') < $adjust / 10)) {
+ if (($digits > 0) && (rtrim((int) ((abs($value) - abs((int) $value)) * $adjust), '0') < $adjust / 10)) {
return $value;
}
- return (intval($value * $adjust)) / $adjust;
+ return ((int) ($value * $adjust)) / $adjust;
}
}
diff --git a/src/PhpSpreadsheet/Calculation/Statistical.php b/src/PhpSpreadsheet/Calculation/Statistical.php
index 593d0478..e020630e 100644
--- a/src/PhpSpreadsheet/Calculation/Statistical.php
+++ b/src/PhpSpreadsheet/Calculation/Statistical.php
@@ -15,7 +15,7 @@ define('EPS', 2.22e-16);
define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,6 +32,7 @@ define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -50,14 +51,12 @@ class Statistical
$array2 = Functions::flattenArray($array2);
foreach ($array1 as $key => $value) {
if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
- unset($array1[$key]);
- unset($array2[$key]);
+ unset($array1[$key], $array2[$key]);
}
}
foreach ($array2 as $key => $value) {
if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
- unset($array1[$key]);
- unset($array2[$key]);
+ unset($array1[$key], $array2[$key]);
}
}
$array1 = array_merge($array1);
@@ -73,27 +72,35 @@ class Statistical
*
* @param p require p>0
* @param q require q>0
+ * @param mixed $p
+ * @param mixed $q
+ *
* @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
*/
private static function beta($p, $q)
{
if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) {
return 0.0;
- } else {
- return exp(self::logBeta($p, $q));
}
+
+ return exp(self::logBeta($p, $q));
}
/**
- * Incomplete beta function
+ * Incomplete beta function.
*
* @author Jaco van Kooten
* @author Paul Meagher
*
* 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
+ *
* @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
*/
private static function incompleteBeta($x, $p, $q)
@@ -108,9 +115,9 @@ class Statistical
$beta_gam = exp((0 - self::logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x));
if ($x < ($p + 1.0) / ($p + $q + 2.0)) {
return $beta_gam * self::betaFraction($x, $p, $q) / $p;
- } else {
- return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q);
}
+
+ return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q);
}
// Function cache for logBeta function
@@ -123,7 +130,11 @@ class Statistical
*
* @param p require p>0
* @param q require q>0
+ * @param mixed $p
+ * @param mixed $q
+ *
* @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
+ *
* @author Jaco van Kooten
*/
private static function logBeta($p, $q)
@@ -144,7 +155,12 @@ class Statistical
/**
* Evaluates of continued fraction part of incomplete beta function.
* Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
+ *
* @author Jaco van Kooten
+ *
+ * @param mixed $x
+ * @param mixed $p
+ * @param mixed $q
*/
private static function betaFraction($x, $p, $q)
{
@@ -193,48 +209,50 @@ class Statistical
return $frac;
}
-/**
- * logGamma function
- *
- * @version 1.1
- * @author Jaco van Kooten
- *
- * Original author was Jaco van Kooten. Ported to PHP by Paul Meagher.
- *
- * The natural logarithm of the gamma function.
- * Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
- * Applied Mathematics Division
- * Argonne National Laboratory
- * Argonne, IL 60439
- *
- * References: - *
- * From the original documentation: - *
- *- * This routine calculates the LOG(GAMMA) function for a positive real argument X. - * Computation is based on an algorithm outlined in references 1 and 2. - * The program uses rational functions that theoretically approximate LOG(GAMMA) - * to at least 18 significant decimal digits. The approximation for X > 12 is from - * reference 3, while approximations for X < 12.0 are similar to those in reference - * 1, but are unpublished. The accuracy achieved depends on the arithmetic system, - * the compiler, the intrinsic functions, and proper selection of the - * machine-dependent constants. - *
- *
- * Error returns:
- * The program returns the value XINF for X .LE. 0.0 or when overflow would occur.
- * The computation is believed to be free of underflow and overflow.
- *
+ * References: + *
+ * From the original documentation: + *
+ *+ * This routine calculates the LOG(GAMMA) function for a positive real argument X. + * Computation is based on an algorithm outlined in references 1 and 2. + * The program uses rational functions that theoretically approximate LOG(GAMMA) + * to at least 18 significant decimal digits. The approximation for X > 12 is from + * reference 3, while approximations for X < 12.0 are similar to those in reference + * 1, but are unpublished. The accuracy achieved depends on the arithmetic system, + * the compiler, the intrinsic functions, and proper selection of the + * machine-dependent constants. + *
+ *
+ * Error returns:
+ * The program returns the value XINF for X .LE. 0.0 or when overflow would occur.
+ * The computation is believed to be free of underflow and overflow.
+ *
* $spreadsheet->getActiveSheet()->getStyle('B2')->applyFromArray(
@@ -200,8 +202,10 @@ class Style extends Style\Supervisor implements IComparable
*
*
* @param array $pStyles Array containing style information
- * @param bool $pAdvanced Advanced mode for setting borders.
+ * @param bool $pAdvanced advanced mode for setting borders
+ *
* @throws Exception
+ *
* @return Style
*/
public function applyFromArray($pStyles = null, $pAdvanced = true)
@@ -417,7 +421,6 @@ class Style extends Style\Supervisor implements IComparable
$columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
}
break;
-
case 'ROW':
for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
$rowDimension = $this->getActiveSheet()->getRowDimension($row);
@@ -426,7 +429,6 @@ class Style extends Style\Supervisor implements IComparable
$rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
}
break;
-
case 'CELL':
for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
@@ -469,7 +471,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Fill
+ * Get Fill.
*
* @return Style\Fill
*/
@@ -479,7 +481,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Font
+ * Get Font.
*
* @return Style\Font
*/
@@ -489,9 +491,10 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Set font
+ * Set font.
*
* @param Style\Font $font
+ *
* @return Style
*/
public function setFont(Style\Font $font)
@@ -502,7 +505,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Borders
+ * Get Borders.
*
* @return Style\Borders
*/
@@ -512,7 +515,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Alignment
+ * Get Alignment.
*
* @return Style\Alignment
*/
@@ -522,7 +525,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Number Format
+ * Get Number Format.
*
* @return Style\NumberFormat
*/
@@ -545,6 +548,7 @@ class Style extends Style\Supervisor implements IComparable
* Set Conditional Styles. Only used on supervisor.
*
* @param Style\Conditional[] $pValue Array of condtional styles
+ *
* @return Style
*/
public function setConditionalStyles($pValue = null)
@@ -557,7 +561,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get Protection
+ * Get Protection.
*
* @return Style\Protection
*/
@@ -567,7 +571,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get quote prefix
+ * Get quote prefix.
*
* @return bool
*/
@@ -581,7 +585,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Set quote prefix
+ * Set quote prefix.
*
* @param bool $pValue
*/
@@ -594,14 +598,14 @@ class Style extends Style\Supervisor implements IComparable
$styleArray = ['quotePrefix' => $pValue];
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
- $this->quotePrefix = (boolean) $pValue;
+ $this->quotePrefix = (bool) $pValue;
}
return $this;
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
@@ -626,7 +630,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Get own index in style collection
+ * Get own index in style collection.
*
* @return int
*/
@@ -636,7 +640,7 @@ class Style extends Style\Supervisor implements IComparable
}
/**
- * Set own index in style collection
+ * Set own index in style collection.
*
* @param int $pValue
*/
diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php
index a3e2ce5f..3643d29d 100644
--- a/src/PhpSpreadsheet/Style/Alignment.php
+++ b/src/PhpSpreadsheet/Style/Alignment.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -48,56 +49,56 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
const READORDER_RTL = 2;
/**
- * Horizontal alignment
+ * Horizontal alignment.
*
* @var string
*/
protected $horizontal = self::HORIZONTAL_GENERAL;
/**
- * Vertical alignment
+ * Vertical alignment.
*
* @var string
*/
protected $vertical = self::VERTICAL_BOTTOM;
/**
- * Text rotation
+ * Text rotation.
*
* @var int
*/
protected $textRotation = 0;
/**
- * Wrap text
+ * Wrap text.
*
* @var bool
*/
protected $wrapText = false;
/**
- * Shrink to fit
+ * Shrink to fit.
*
* @var bool
*/
protected $shrinkToFit = false;
/**
- * Indent - only possible with horizontal alignment left and right
+ * Indent - only possible with horizontal alignment left and right.
*
* @var int
*/
protected $indent = 0;
/**
- * Read order
+ * Read order.
*
* @var int
*/
protected $readorder = 0;
/**
- * Create a new Alignment
+ * Create a new Alignment.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -120,7 +121,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Alignment
*/
@@ -130,9 +131,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -141,7 +143,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray(
@@ -155,7 +157,9 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Alignment
*/
public function applyFromArray($pStyles = null)
@@ -195,7 +199,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get Horizontal
+ * Get Horizontal.
*
* @return string
*/
@@ -209,9 +213,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set Horizontal
+ * Set Horizontal.
*
* @param string $pValue
+ *
* @return Alignment
*/
public function setHorizontal($pValue = self::HORIZONTAL_GENERAL)
@@ -231,7 +236,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get Vertical
+ * Get Vertical.
*
* @return string
*/
@@ -245,9 +250,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set Vertical
+ * Set Vertical.
*
* @param string $pValue
+ *
* @return Alignment
*/
public function setVertical($pValue = self::VERTICAL_BOTTOM)
@@ -267,7 +273,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get TextRotation
+ * Get TextRotation.
*
* @return int
*/
@@ -281,10 +287,12 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set TextRotation
+ * Set TextRotation.
*
* @param int $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Alignment
*/
public function setTextRotation($pValue = 0)
@@ -310,7 +318,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get Wrap Text
+ * Get Wrap Text.
*
* @return bool
*/
@@ -324,9 +332,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set Wrap Text
+ * Set Wrap Text.
*
* @param bool $pValue
+ *
* @return Alignment
*/
public function setWrapText($pValue = false)
@@ -345,7 +354,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get Shrink to fit
+ * Get Shrink to fit.
*
* @return bool
*/
@@ -359,9 +368,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set Shrink to fit
+ * Set Shrink to fit.
*
* @param bool $pValue
+ *
* @return Alignment
*/
public function setShrinkToFit($pValue = false)
@@ -380,7 +390,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get indent
+ * Get indent.
*
* @return int
*/
@@ -394,9 +404,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set indent
+ * Set indent.
*
* @param int $pValue
+ *
* @return Alignment
*/
public function setIndent($pValue = 0)
@@ -419,7 +430,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get read order
+ * Get read order.
*
* @return int
*/
@@ -433,9 +444,10 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Set read order
+ * Set read order.
*
* @param int $pValue
+ *
* @return Alignment
*/
public function setReadorder($pValue = 0)
@@ -454,7 +466,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Border.php b/src/PhpSpreadsheet/Style/Border.php
index 4239bc78..e1a1c42f 100644
--- a/src/PhpSpreadsheet/Style/Border.php
+++ b/src/PhpSpreadsheet/Style/Border.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -42,28 +43,28 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
const BORDER_THIN = 'thin';
/**
- * Border style
+ * Border style.
*
* @var string
*/
protected $borderStyle = self::BORDER_NONE;
/**
- * Border color
+ * Border color.
*
* @var Color
*/
protected $color;
/**
- * Parent property name
+ * Parent property name.
*
* @var string
*/
protected $parentPropertyName;
/**
- * Create a new Border
+ * Create a new Border.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -87,10 +88,11 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Bind parent. Only used for supervisor
+ * Bind parent. Only used for supervisor.
*
* @param Borders $parent
* @param string $parentPropertyName
+ *
* @return Border
*/
public function bindParent($parent, $parentPropertyName = null)
@@ -103,9 +105,10 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function getSharedComponent()
@@ -132,9 +135,10 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -158,7 +162,7 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
@@ -172,7 +176,9 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function applyFromArray($pStyles = null)
@@ -196,7 +202,7 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Border style
+ * Get Border style.
*
* @return string
*/
@@ -210,11 +216,12 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Border style
+ * Set Border style.
*
* @param string|bool $pValue
* When passing a boolean, FALSE equates Border::BORDER_NONE
* and TRUE to Border::BORDER_MEDIUM
+ *
* @return Border
*/
public function setBorderStyle($pValue = self::BORDER_NONE)
@@ -235,7 +242,7 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Border Color
+ * Get Border Color.
*
* @return Color
*/
@@ -245,10 +252,12 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Border Color
+ * Set Border Color.
*
* @param Color $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function setColor(Color $pValue = null)
@@ -267,7 +276,7 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Borders.php b/src/PhpSpreadsheet/Style/Borders.php
index 95d80ad4..998aa298 100644
--- a/src/PhpSpreadsheet/Style/Borders.php
+++ b/src/PhpSpreadsheet/Style/Borders.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -32,42 +33,42 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
const DIAGONAL_BOTH = 3;
/**
- * Left
+ * Left.
*
* @var Border
*/
protected $left;
/**
- * Right
+ * Right.
*
* @var Border
*/
protected $right;
/**
- * Top
+ * Top.
*
* @var Border
*/
protected $top;
/**
- * Bottom
+ * Bottom.
*
* @var Border
*/
protected $bottom;
/**
- * Diagonal
+ * Diagonal.
*
* @var Border
*/
protected $diagonal;
/**
- * DiagonalDirection
+ * DiagonalDirection.
*
* @var int
*/
@@ -109,7 +110,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
protected $horizontal;
/**
- * Create a new Borders
+ * Create a new Borders.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -156,7 +157,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Borders
*/
@@ -166,9 +167,10 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -177,7 +179,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
@@ -211,7 +213,9 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Borders
*/
public function applyFromArray($pStyles = null)
@@ -253,7 +257,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get Left
+ * Get Left.
*
* @return Border
*/
@@ -263,7 +267,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get Right
+ * Get Right.
*
* @return Border
*/
@@ -273,7 +277,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get Top
+ * Get Top.
*
* @return Border
*/
@@ -283,7 +287,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get Bottom
+ * Get Bottom.
*
* @return Border
*/
@@ -293,7 +297,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get Diagonal
+ * Get Diagonal.
*
* @return Border
*/
@@ -306,6 +310,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
* Get AllBorders (pseudo-border). Only applies to supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function getAllBorders()
@@ -321,6 +326,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
* Get Outline (pseudo-border). Only applies to supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function getOutline()
@@ -336,6 +342,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
* Get Inside (pseudo-border). Only applies to supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return bool
*/
public function getInside()
@@ -351,6 +358,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
* Get Vertical (pseudo-border). Only applies to supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function getVertical()
@@ -366,6 +374,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
* Get Horizontal (pseudo-border). Only applies to supervisor.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Border
*/
public function getHorizontal()
@@ -378,7 +387,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get DiagonalDirection
+ * Get DiagonalDirection.
*
* @return int
*/
@@ -392,9 +401,10 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Set DiagonalDirection
+ * Set DiagonalDirection.
*
* @param int $pValue
+ *
* @return Borders
*/
public function setDiagonalDirection($pValue = self::DIAGONAL_NONE)
@@ -413,7 +423,7 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php
index fe67ee80..fe3c318a 100644
--- a/src/PhpSpreadsheet/Style/Color.php
+++ b/src/PhpSpreadsheet/Style/Color.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -38,28 +39,28 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
const COLOR_DARKYELLOW = 'FF808000';
/**
- * Indexed colors array
+ * Indexed colors array.
*
* @var array
*/
protected static $indexedColors;
/**
- * ARGB - Alpha RGB
+ * ARGB - Alpha RGB.
*
* @var string
*/
protected $argb = null;
/**
- * Parent property name
+ * Parent property name.
*
* @var string
*/
protected $parentPropertyName;
/**
- * Create a new Color
+ * Create a new Color.
*
* @param string $pARGB ARGB value for the colour
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
@@ -81,10 +82,11 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Bind parent. Only used for supervisor
+ * Bind parent. Only used for supervisor.
*
* @param mixed $parent
* @param string $parentPropertyName
+ *
* @return Color
*/
public function bindParent($parent, $parentPropertyName = null)
@@ -97,7 +99,7 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Color
*/
@@ -114,9 +116,10 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -137,14 +140,16 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') );
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Color
*/
public function applyFromArray($pStyles = null)
@@ -168,7 +173,7 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get ARGB
+ * Get ARGB.
*
* @return string
*/
@@ -182,9 +187,10 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set ARGB
+ * Set ARGB.
*
* @param string $pValue
+ *
* @return Color
*/
public function setARGB($pValue = self::COLOR_BLACK)
@@ -203,7 +209,7 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get RGB
+ * Get RGB.
*
* @return string
*/
@@ -217,9 +223,10 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set RGB
+ * Set RGB.
*
* @param string $pValue RGB value
+ *
* @return Color
*/
public function setRGB($pValue = '000000')
@@ -238,13 +245,15 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get a specified colour component of an RGB value
+ * Get a specified colour component of an RGB value.
*
* @private
+ *
* @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
* @param int $offset Position within the RGB value to extract
* @param bool $hex Flag indicating whether the component should be returned as a hex or a
* decimal value
+ *
* @return string The extracted colour component
*/
private static function getColourComponent($RGB, $offset, $hex = true)
@@ -258,11 +267,12 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get the red colour component of an RGB value
+ * Get the red colour component of an RGB value.
*
* @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
* @param bool $hex Flag indicating whether the component should be returned as a hex or a
* decimal value
+ *
* @return string The red colour component
*/
public static function getRed($RGB, $hex = true)
@@ -271,11 +281,12 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get the green colour component of an RGB value
+ * Get the green colour component of an RGB value.
*
* @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
* @param bool $hex Flag indicating whether the component should be returned as a hex or a
* decimal value
+ *
* @return string The green colour component
*/
public static function getGreen($RGB, $hex = true)
@@ -284,11 +295,12 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get the blue colour component of an RGB value
+ * Get the blue colour component of an RGB value.
*
* @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
* @param bool $hex Flag indicating whether the component should be returned as a hex or a
* decimal value
+ *
* @return string The blue colour component
*/
public static function getBlue($RGB, $hex = true)
@@ -297,10 +309,11 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Adjust the brightness of a color
+ * Adjust the brightness of a color.
*
* @param string $hex The colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
* @param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1
+ *
* @return string The adjusted colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
*/
public static function changeBrightness($hex, $adjustPercentage)
@@ -346,17 +359,18 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get indexed color
+ * Get indexed color.
*
* @param int $pIndex Index entry point into the colour array
* @param bool $background Flag to indicate whether default background or foreground colour
* should be returned if the indexed colour doesn't exist
+ *
* @return Color
*/
public static function indexedColor($pIndex, $background = false)
{
// Clean parameter
- $pIndex = intval($pIndex);
+ $pIndex = (int) $pIndex;
// Indexed colors
if (is_null(self::$indexedColors)) {
@@ -432,7 +446,7 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php
index d97d22d1..64f7c22f 100644
--- a/src/PhpSpreadsheet/Style/Conditional.php
+++ b/src/PhpSpreadsheet/Style/Conditional.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -46,42 +47,42 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
const OPERATOR_BETWEEN = 'between';
/**
- * Condition type
+ * Condition type.
*
* @var string
*/
private $conditionType;
/**
- * Operator type
+ * Operator type.
*
* @var string
*/
private $operatorType;
/**
- * Text
+ * Text.
*
* @var string
*/
private $text;
/**
- * Condition
+ * Condition.
*
* @var string[]
*/
private $condition = [];
/**
- * Style
+ * Style.
*
* @var \PhpOffice\PhpSpreadsheet\Style
*/
private $style;
/**
- * Create a new Conditional
+ * Create a new Conditional.
*/
public function __construct()
{
@@ -94,7 +95,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Condition type
+ * Get Condition type.
*
* @return string
*/
@@ -104,9 +105,10 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Condition type
+ * Set Condition type.
*
* @param string $pValue Condition type
+ *
* @return Conditional
*/
public function setConditionType($pValue = self::CONDITION_NONE)
@@ -117,7 +119,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Operator type
+ * Get Operator type.
*
* @return string
*/
@@ -127,9 +129,10 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Operator type
+ * Set Operator type.
*
* @param string $pValue Conditional operator type
+ *
* @return Conditional
*/
public function setOperatorType($pValue = self::OPERATOR_NONE)
@@ -140,7 +143,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get text
+ * Get text.
*
* @return string
*/
@@ -150,9 +153,10 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set text
+ * Set text.
*
* @param string $value
+ *
* @return Conditional
*/
public function setText($value = null)
@@ -163,7 +167,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Conditions
+ * Get Conditions.
*
* @return string[]
*/
@@ -173,9 +177,10 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Conditions
+ * Set Conditions.
*
* @param string[] $pValue Condition
+ *
* @return Conditional
*/
public function setConditions($pValue)
@@ -189,9 +194,10 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Add Condition
+ * Add Condition.
*
* @param string $pValue Condition
+ *
* @return Conditional
*/
public function addCondition($pValue = '')
@@ -202,7 +208,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Style
+ * Get Style.
*
* @return \PhpOffice\PhpSpreadsheet\Style
*/
@@ -212,10 +218,12 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Style
+ * Set Style.
*
* @param \PhpOffice\PhpSpreadsheet\Style $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Conditional
*/
public function setStyle(\PhpOffice\PhpSpreadsheet\Style $pValue = null)
@@ -226,7 +234,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Fill.php b/src/PhpSpreadsheet/Style/Fill.php
index 7775a2d0..d2dffaf1 100644
--- a/src/PhpSpreadsheet/Style/Fill.php
+++ b/src/PhpSpreadsheet/Style/Fill.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -49,35 +50,35 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
const FILL_PATTERN_MEDIUMGRAY = 'mediumGray';
/**
- * Fill type
+ * Fill type.
*
* @var string
*/
protected $fillType = self::FILL_NONE;
/**
- * Rotation
+ * Rotation.
*
* @var float
*/
protected $rotation = 0;
/**
- * Start color
+ * Start color.
*
* @var Color
*/
protected $startColor;
/**
- * End color
+ * End color.
*
* @var Color
*/
protected $endColor;
/**
- * Create a new Fill
+ * Create a new Fill.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -107,7 +108,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Fill
*/
@@ -117,9 +118,10 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -128,7 +130,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
@@ -146,7 +148,9 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Fill
*/
public function applyFromArray($pStyles = null)
@@ -179,7 +183,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Fill Type
+ * Get Fill Type.
*
* @return string
*/
@@ -193,9 +197,10 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Fill Type
+ * Set Fill Type.
*
* @param string $pValue Fill type
+ *
* @return Fill
*/
public function setFillType($pValue = self::FILL_NONE)
@@ -211,7 +216,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Rotation
+ * Get Rotation.
*
* @return float
*/
@@ -225,9 +230,10 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Rotation
+ * Set Rotation.
*
* @param float $pValue
+ *
* @return Fill
*/
public function setRotation($pValue = 0)
@@ -243,7 +249,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Start Color
+ * Get Start Color.
*
* @return Color
*/
@@ -253,10 +259,12 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Start Color
+ * Set Start Color.
*
* @param Color $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Fill
*/
public function setStartColor(Color $pValue = null)
@@ -275,7 +283,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get End Color
+ * Get End Color.
*
* @return Color
*/
@@ -285,10 +293,12 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set End Color
+ * Set End Color.
*
* @param Color $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Fill
*/
public function setEndColor(Color $pValue = null)
@@ -307,7 +317,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Font.php b/src/PhpSpreadsheet/Style/Font.php
index fe1aebbe..15b2bfff 100644
--- a/src/PhpSpreadsheet/Style/Font.php
+++ b/src/PhpSpreadsheet/Style/Font.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -33,70 +34,70 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
const UNDERLINE_SINGLEACCOUNTING = 'singleAccounting';
/**
- * Font Name
+ * Font Name.
*
* @var string
*/
protected $name = 'Calibri';
/**
- * Font Size
+ * Font Size.
*
* @var float
*/
protected $size = 11;
/**
- * Bold
+ * Bold.
*
* @var bool
*/
protected $bold = false;
/**
- * Italic
+ * Italic.
*
* @var bool
*/
protected $italic = false;
/**
- * Superscript
+ * Superscript.
*
* @var bool
*/
protected $superScript = false;
/**
- * Subscript
+ * Subscript.
*
* @var bool
*/
protected $subScript = false;
/**
- * Underline
+ * Underline.
*
* @var string
*/
protected $underline = self::UNDERLINE_NONE;
/**
- * Strikethrough
+ * Strikethrough.
*
* @var bool
*/
protected $strikethrough = false;
/**
- * Foreground color
+ * Foreground color.
*
* @var Color
*/
protected $color;
/**
- * Create a new Font
+ * Create a new Font.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -132,7 +133,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Font
*/
@@ -142,9 +143,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -153,7 +155,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray(
@@ -171,7 +173,9 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Font
*/
public function applyFromArray($pStyles = null)
@@ -216,7 +220,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Name
+ * Get Name.
*
* @return string
*/
@@ -230,9 +234,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Name
+ * Set Name.
*
* @param string $pValue
+ *
* @return Font
*/
public function setName($pValue = 'Calibri')
@@ -251,7 +256,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Size
+ * Get Size.
*
* @return float
*/
@@ -265,9 +270,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Size
+ * Set Size.
*
* @param float $pValue
+ *
* @return Font
*/
public function setSize($pValue = 10)
@@ -286,7 +292,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Bold
+ * Get Bold.
*
* @return bool
*/
@@ -300,9 +306,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Bold
+ * Set Bold.
*
* @param bool $pValue
+ *
* @return Font
*/
public function setBold($pValue = false)
@@ -321,7 +328,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Italic
+ * Get Italic.
*
* @return bool
*/
@@ -335,9 +342,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Italic
+ * Set Italic.
*
* @param bool $pValue
+ *
* @return Font
*/
public function setItalic($pValue = false)
@@ -356,7 +364,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get SuperScript
+ * Get SuperScript.
*
* @return bool
*/
@@ -370,9 +378,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set SuperScript
+ * Set SuperScript.
*
* @param bool $pValue
+ *
* @return Font
*/
public function setSuperScript($pValue = false)
@@ -392,7 +401,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get SubScript
+ * Get SubScript.
*
* @return bool
*/
@@ -406,9 +415,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set SubScript
+ * Set SubScript.
*
* @param bool $pValue
+ *
* @return Font
*/
public function setSubScript($pValue = false)
@@ -428,7 +438,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Underline
+ * Get Underline.
*
* @return string
*/
@@ -442,11 +452,12 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Underline
+ * Set Underline.
*
* @param string|bool $pValue \PhpOffice\PhpSpreadsheet\Style\Font underline type
* If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE,
* false equates to UNDERLINE_NONE
+ *
* @return Font
*/
public function setUnderline($pValue = self::UNDERLINE_NONE)
@@ -467,7 +478,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Strikethrough
+ * Get Strikethrough.
*
* @return bool
*/
@@ -481,9 +492,10 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Strikethrough
+ * Set Strikethrough.
*
* @param bool $pValue
+ *
* @return Font
*/
public function setStrikethrough($pValue = false)
@@ -502,7 +514,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Color
+ * Get Color.
*
* @return Color
*/
@@ -512,10 +524,12 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Color
+ * Set Color.
*
* @param Color $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Font
*/
public function setColor(Color $pValue = null)
@@ -534,7 +548,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/NumberFormat.php b/src/PhpSpreadsheet/Style/NumberFormat.php
index a111801c..984779a3 100644
--- a/src/PhpSpreadsheet/Style/NumberFormat.php
+++ b/src/PhpSpreadsheet/Style/NumberFormat.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -66,35 +67,35 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
const FORMAT_CURRENCY_EUR_SIMPLE = '[$EUR ]#,##0.00_-';
/**
- * Excel built-in number formats
+ * Excel built-in number formats.
*
* @var array
*/
protected static $builtInFormats;
/**
- * Excel built-in number formats (flipped, for faster lookups)
+ * Excel built-in number formats (flipped, for faster lookups).
*
* @var array
*/
protected static $flippedBuiltInFormats;
/**
- * Format Code
+ * Format Code.
*
* @var string
*/
protected $formatCode = self::FORMAT_GENERAL;
/**
- * Built-in format Code
+ * Built-in format Code.
*
* @var string
*/
protected $builtInFormatCode = 0;
/**
- * Create a new NumberFormat
+ * Create a new NumberFormat.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -116,7 +117,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return NumberFormat
*/
@@ -126,9 +127,10 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -137,7 +139,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
@@ -148,7 +150,9 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return NumberFormat
*/
public function applyFromArray($pStyles = null)
@@ -169,7 +173,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Get Format Code
+ * Get Format Code.
*
* @return string
*/
@@ -186,9 +190,10 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Set Format Code
+ * Set Format Code.
*
* @param string $pValue
+ *
* @return NumberFormat
*/
public function setFormatCode($pValue = self::FORMAT_GENERAL)
@@ -208,7 +213,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Get Built-In Format Code
+ * Get Built-In Format Code.
*
* @return int
*/
@@ -222,9 +227,10 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Set Built-In Format Code
+ * Set Built-In Format Code.
*
* @param int $pValue
+ *
* @return NumberFormat
*/
public function setBuiltInFormatCode($pValue = 0)
@@ -241,7 +247,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Fill built-in format codes
+ * Fill built-in format codes.
*/
private static function fillBuiltInFormatCodes()
{
@@ -328,15 +334,16 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Get built-in format code
+ * Get built-in format code.
*
* @param int $pIndex
+ *
* @return string
*/
public static function builtInFormatCode($pIndex)
{
// Clean parameter
- $pIndex = intval($pIndex);
+ $pIndex = (int) $pIndex;
// Ensure built-in format codes are available
self::fillBuiltInFormatCodes();
@@ -350,9 +357,10 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Get built-in format code index
+ * Get built-in format code index.
*
* @param string $formatCode
+ *
* @return int|bool
*/
public static function builtInFormatCodeIndex($formatCode)
@@ -369,7 +377,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
@@ -387,7 +395,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Search/replace values to convert Excel date/time format masks to PHP format masks
+ * Search/replace values to convert Excel date/time format masks to PHP format masks.
*
* @var array
*/
@@ -430,7 +438,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
'.s' => '',
];
/**
- * Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock)
+ * Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock).
*
* @var array
*/
@@ -439,7 +447,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
'h' => 'G',
];
/**
- * Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock)
+ * Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock).
*
* @var array
*/
@@ -577,11 +585,12 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
}
/**
- * Convert a value in a pre-defined format to a PHP string
+ * Convert a value in a pre-defined format to a PHP string.
*
* @param mixed $value Value to format
* @param string $format Format code
* @param array $callBack Callback function for additional formatting of string
+ *
* @return string Formatted string
*/
public static function toFormattedString($value = '0', $format = self::FORMAT_GENERAL, $callBack = null)
diff --git a/src/PhpSpreadsheet/Style/Protection.php b/src/PhpSpreadsheet/Style/Protection.php
index db924fb2..3e5b4a90 100644
--- a/src/PhpSpreadsheet/Style/Protection.php
+++ b/src/PhpSpreadsheet/Style/Protection.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -31,21 +32,21 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
const PROTECTION_UNPROTECTED = 'unprotected';
/**
- * Locked
+ * Locked.
*
* @var string
*/
protected $locked;
/**
- * Hidden
+ * Hidden.
*
* @var string
*/
protected $hidden;
/**
- * Create a new Protection
+ * Create a new Protection.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -68,7 +69,7 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
/**
* Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
+ * Only used for style supervisor.
*
* @return Protection
*/
@@ -78,9 +79,10 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Build style array from subcomponents
+ * Build style array from subcomponents.
*
* @param array $array
+ *
* @return array
*/
public function getStyleArray($array)
@@ -89,7 +91,7 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
* $spreadsheet->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray(
@@ -101,7 +103,9 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
*
*
* @param array $pStyles Array containing style information
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Protection
*/
public function applyFromArray($pStyles = null)
@@ -125,7 +129,7 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Get locked
+ * Get locked.
*
* @return string
*/
@@ -139,9 +143,10 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Set locked
+ * Set locked.
*
* @param string $pValue
+ *
* @return Protection
*/
public function setLocked($pValue = self::PROTECTION_INHERIT)
@@ -157,7 +162,7 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Get hidden
+ * Get hidden.
*
* @return string
*/
@@ -171,9 +176,10 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Set hidden
+ * Set hidden.
*
* @param string $pValue
+ *
* @return Protection
*/
public function setHidden($pValue = self::PROTECTION_INHERIT)
@@ -189,7 +195,7 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Style/Supervisor.php b/src/PhpSpreadsheet/Style/Supervisor.php
index 380687aa..d881a669 100644
--- a/src/PhpSpreadsheet/Style/Supervisor.php
+++ b/src/PhpSpreadsheet/Style/Supervisor.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Style;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Style;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -33,14 +34,14 @@ abstract class Supervisor
protected $isSupervisor;
/**
- * Parent. Only used for supervisor
+ * Parent. Only used for supervisor.
*
* @var \PhpOffice\PhpSpreadsheet\Style
*/
protected $parent;
/**
- * Create a new Supervisor
+ * Create a new Supervisor.
*
* @param bool $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@@ -53,9 +54,11 @@ abstract class Supervisor
}
/**
- * Bind parent. Only used for supervisor
+ * Bind parent. Only used for supervisor.
*
* @param \PhpOffice\PhpSpreadsheet\Style $parent
+ * @param null|mixed $parentPropertyName
+ *
* @return Supervisor
*/
public function bindParent($parent, $parentPropertyName = null)
@@ -76,7 +79,7 @@ abstract class Supervisor
}
/**
- * Get the currently active sheet. Only used for supervisor
+ * Get the currently active sheet. Only used for supervisor.
*
* @return \PhpOffice\PhpSpreadsheet\Worksheet
*/
@@ -87,7 +90,7 @@ abstract class Supervisor
/**
* Get the currently active cell coordinate in currently active sheet.
- * Only used for supervisor
+ * Only used for supervisor.
*
* @return string E.g. 'A1'
*/
@@ -98,7 +101,7 @@ abstract class Supervisor
/**
* Get the currently active cell coordinate in currently active sheet.
- * Only used for supervisor
+ * Only used for supervisor.
*
* @return string E.g. 'A1'
*/
diff --git a/src/PhpSpreadsheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet.php
index 8a432ede..38d4174d 100644
--- a/src/PhpSpreadsheet/Worksheet.php
+++ b/src/PhpSpreadsheet/Worksheet.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -36,126 +37,126 @@ class Worksheet implements IComparable
const SHEETSTATE_VERYHIDDEN = 'veryHidden';
/**
- * Invalid characters in sheet title
+ * Invalid characters in sheet title.
*
* @var array
*/
private static $invalidCharacters = ['*', ':', '/', '\\', '?', '[', ']'];
/**
- * Parent spreadsheet
+ * Parent spreadsheet.
*
* @var Spreadsheet
*/
private $parent;
/**
- * Cacheable collection of cells
+ * Cacheable collection of cells.
*
* @var CachedObjectStorage_xxx
*/
private $cellCollection;
/**
- * Collection of row dimensions
+ * Collection of row dimensions.
*
* @var Worksheet\RowDimension[]
*/
private $rowDimensions = [];
/**
- * Default row dimension
+ * Default row dimension.
*
* @var Worksheet\RowDimension
*/
private $defaultRowDimension;
/**
- * Collection of column dimensions
+ * Collection of column dimensions.
*
* @var Worksheet\ColumnDimension[]
*/
private $columnDimensions = [];
/**
- * Default column dimension
+ * Default column dimension.
*
* @var Worksheet\ColumnDimension
*/
private $defaultColumnDimension = null;
/**
- * Collection of drawings
+ * Collection of drawings.
*
* @var Worksheet\BaseDrawing[]
*/
private $drawingCollection = null;
/**
- * Collection of Chart objects
+ * Collection of Chart objects.
*
* @var Chart[]
*/
private $chartCollection = [];
/**
- * Worksheet title
+ * Worksheet title.
*
* @var string
*/
private $title;
/**
- * Sheet state
+ * Sheet state.
*
* @var string
*/
private $sheetState;
/**
- * Page setup
+ * Page setup.
*
* @var Worksheet\PageSetup
*/
private $pageSetup;
/**
- * Page margins
+ * Page margins.
*
* @var Worksheet\PageMargins
*/
private $pageMargins;
/**
- * Page header/footer
+ * Page header/footer.
*
* @var Worksheet\HeaderFooter
*/
private $headerFooter;
/**
- * Sheet view
+ * Sheet view.
*
* @var Worksheet\SheetView
*/
private $sheetView;
/**
- * Protection
+ * Protection.
*
* @var Worksheet\Protection
*/
private $protection;
/**
- * Collection of styles
+ * Collection of styles.
*
* @var Style[]
*/
private $styles = [];
/**
- * Conditional styles. Indexed by cell coordinate, e.g. 'A1'
+ * Conditional styles. Indexed by cell coordinate, e.g. 'A1'.
*
* @var array
*/
@@ -169,35 +170,35 @@ class Worksheet implements IComparable
private $cellCollectionIsSorted = false;
/**
- * Collection of breaks
+ * Collection of breaks.
*
* @var array
*/
private $breaks = [];
/**
- * Collection of merged cell ranges
+ * Collection of merged cell ranges.
*
* @var array
*/
private $mergeCells = [];
/**
- * Collection of protected cell ranges
+ * Collection of protected cell ranges.
*
* @var array
*/
private $protectedCells = [];
/**
- * Autofilter Range and selection
+ * Autofilter Range and selection.
*
* @var Worksheet\AutoFilter
*/
private $autoFilter;
/**
- * Freeze pane
+ * Freeze pane.
*
* @var string
*/
@@ -225,49 +226,49 @@ class Worksheet implements IComparable
private $showRowColHeaders = true;
/**
- * Show summary below? (Row/Column outline)
+ * Show summary below? (Row/Column outline).
*
* @var bool
*/
private $showSummaryBelow = true;
/**
- * Show summary right? (Row/Column outline)
+ * Show summary right? (Row/Column outline).
*
* @var bool
*/
private $showSummaryRight = true;
/**
- * Collection of comments
+ * Collection of comments.
*
* @var Comment[]
*/
private $comments = [];
/**
- * Active cell. (Only one!)
+ * Active cell. (Only one!).
*
* @var string
*/
private $activeCell = 'A1';
/**
- * Selected cells
+ * Selected cells.
*
* @var string
*/
private $selectedCells = 'A1';
/**
- * Cached highest column
+ * Cached highest column.
*
* @var string
*/
private $cachedHighestColumn = 'A';
/**
- * Cached highest row
+ * Cached highest row.
*
* @var int
*/
@@ -281,49 +282,49 @@ class Worksheet implements IComparable
private $rightToLeft = false;
/**
- * Hyperlinks. Indexed by cell coordinate, e.g. 'A1'
+ * Hyperlinks. Indexed by cell coordinate, e.g. 'A1'.
*
* @var array
*/
private $hyperlinkCollection = [];
/**
- * Data validation objects. Indexed by cell coordinate, e.g. 'A1'
+ * Data validation objects. Indexed by cell coordinate, e.g. 'A1'.
*
* @var array
*/
private $dataValidationCollection = [];
/**
- * Tab color
+ * Tab color.
*
* @var Style\Color
*/
private $tabColor;
/**
- * Dirty flag
+ * Dirty flag.
*
* @var bool
*/
private $dirty = true;
/**
- * Hash
+ * Hash.
*
* @var string
*/
private $hash;
/**
- * CodeName
+ * CodeName.
*
* @var string
*/
private $codeName = null;
/**
- * Create a new worksheet
+ * Create a new worksheet.
*
* @param Spreadsheet $parent
* @param string $pTitle
@@ -361,7 +362,7 @@ class Worksheet implements IComparable
/**
* Disconnect all cells from this Worksheet object,
- * typically so that the worksheet object can be unset
+ * typically so that the worksheet object can be unset.
*/
public function disconnectCells()
{
@@ -374,7 +375,7 @@ class Worksheet implements IComparable
}
/**
- * Code to execute when this worksheet is unset()
+ * Code to execute when this worksheet is unset().
*/
public function __destruct()
{
@@ -384,7 +385,7 @@ class Worksheet implements IComparable
}
/**
- * Return the cache controller for the cell collection
+ * Return the cache controller for the cell collection.
*
* @return CachedObjectStorage_xxx
*/
@@ -394,7 +395,7 @@ class Worksheet implements IComparable
}
/**
- * Get array of invalid characters for sheet title
+ * Get array of invalid characters for sheet title.
*
* @return array
*/
@@ -404,10 +405,12 @@ class Worksheet implements IComparable
}
/**
- * Check sheet code name for valid Excel syntax
+ * Check sheet code name for valid Excel syntax.
*
* @param string $pValue The string to check
+ *
* @throws Exception
+ *
* @return string The valid string
*/
private static function checkSheetCodeName($pValue)
@@ -432,10 +435,12 @@ class Worksheet implements IComparable
}
/**
- * Check sheet title for valid Excel syntax
+ * Check sheet title for valid Excel syntax.
*
* @param string $pValue The string to check
+ *
* @throws Exception
+ *
* @return string The valid string
*/
private static function checkSheetTitle($pValue)
@@ -454,9 +459,10 @@ class Worksheet implements IComparable
}
/**
- * Get collection of cells
+ * Get collection of cells.
*
* @param bool $pSorted Also sort the cell collection?
+ *
* @return Cell[]
*/
public function getCellCollection($pSorted = true)
@@ -473,7 +479,7 @@ class Worksheet implements IComparable
}
/**
- * Sort collection of cells
+ * Sort collection of cells.
*
* @return Worksheet
*/
@@ -487,7 +493,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of row dimensions
+ * Get collection of row dimensions.
*
* @return Worksheet\RowDimension[]
*/
@@ -497,7 +503,7 @@ class Worksheet implements IComparable
}
/**
- * Get default row dimension
+ * Get default row dimension.
*
* @return Worksheet\RowDimension
*/
@@ -507,7 +513,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of column dimensions
+ * Get collection of column dimensions.
*
* @return Worksheet\ColumnDimension[]
*/
@@ -517,7 +523,7 @@ class Worksheet implements IComparable
}
/**
- * Get default column dimension
+ * Get default column dimension.
*
* @return Worksheet\ColumnDimension
*/
@@ -527,7 +533,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of drawings
+ * Get collection of drawings.
*
* @return Worksheet\BaseDrawing[]
*/
@@ -537,7 +543,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of charts
+ * Get collection of charts.
*
* @return Chart[]
*/
@@ -547,10 +553,11 @@ class Worksheet implements IComparable
}
/**
- * Add chart
+ * Add chart.
*
* @param Chart $pChart
* @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last)
+ *
* @return Chart
*/
public function addChart(Chart $pChart = null, $iChartIndex = null)
@@ -567,7 +574,7 @@ class Worksheet implements IComparable
}
/**
- * Return the count of charts on this worksheet
+ * Return the count of charts on this worksheet.
*
* @return int The number of charts
*/
@@ -577,10 +584,12 @@ class Worksheet implements IComparable
}
/**
- * Get a chart by its index position
+ * Get a chart by its index position.
*
* @param string $index Chart index position
+ *
* @throws Exception
+ *
* @return false|Chart
*/
public function getChartByIndex($index = null)
@@ -600,9 +609,10 @@ class Worksheet implements IComparable
}
/**
- * Return an array of the names of charts on this worksheet
+ * Return an array of the names of charts on this worksheet.
*
* @throws Exception
+ *
* @return string[] The names of charts
*/
public function getChartNames()
@@ -616,10 +626,12 @@ class Worksheet implements IComparable
}
/**
- * Get a chart by name
+ * Get a chart by name.
*
* @param string $chartName Chart name
+ *
* @throws Exception
+ *
* @return false|Chart
*/
public function getChartByName($chartName = '')
@@ -638,7 +650,7 @@ class Worksheet implements IComparable
}
/**
- * Refresh column dimensions
+ * Refresh column dimensions.
*
* @return Worksheet
*/
@@ -657,7 +669,7 @@ class Worksheet implements IComparable
}
/**
- * Refresh row dimensions
+ * Refresh row dimensions.
*
* @return Worksheet
*/
@@ -676,7 +688,7 @@ class Worksheet implements IComparable
}
/**
- * Calculate worksheet dimension
+ * Calculate worksheet dimension.
*
* @return string String containing the dimension of this worksheet
*/
@@ -687,7 +699,7 @@ class Worksheet implements IComparable
}
/**
- * Calculate worksheet data dimension
+ * Calculate worksheet data dimension.
*
* @return string String containing the dimension of this worksheet that actually contain data
*/
@@ -698,7 +710,7 @@ class Worksheet implements IComparable
}
/**
- * Calculate widths for auto-size columns
+ * Calculate widths for auto-size columns.
*
* @return Worksheet;
*/
@@ -776,7 +788,7 @@ class Worksheet implements IComparable
}
/**
- * Get parent
+ * Get parent.
*
* @return Spreadsheet
*/
@@ -786,9 +798,10 @@ class Worksheet implements IComparable
}
/**
- * Re-bind parent
+ * Re-bind parent.
*
* @param Spreadsheet $parent
+ *
* @return Worksheet
*/
public function rebindParent(Spreadsheet $parent)
@@ -809,7 +822,7 @@ class Worksheet implements IComparable
}
/**
- * Get title
+ * Get title.
*
* @return string
*/
@@ -819,7 +832,7 @@ class Worksheet implements IComparable
}
/**
- * Set title
+ * Set title.
*
* @param string $pValue String containing the dimension of this worksheet
* @param string $updateFormulaCellReferences boolean Flag indicating whether cell references in formulae should
@@ -827,6 +840,7 @@ class Worksheet implements IComparable
* This should be left as the default true, unless you are
* certain that no formula cells on any worksheet contain
* references to this worksheet
+ *
* @return Worksheet
*/
public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true)
@@ -888,7 +902,7 @@ class Worksheet implements IComparable
}
/**
- * Get sheet state
+ * Get sheet state.
*
* @return string Sheet state (visible, hidden, veryHidden)
*/
@@ -898,9 +912,10 @@ class Worksheet implements IComparable
}
/**
- * Set sheet state
+ * Set sheet state.
*
* @param string $value Sheet state (visible, hidden, veryHidden)
+ *
* @return Worksheet
*/
public function setSheetState($value = self::SHEETSTATE_VISIBLE)
@@ -911,7 +926,7 @@ class Worksheet implements IComparable
}
/**
- * Get page setup
+ * Get page setup.
*
* @return Worksheet\PageSetup
*/
@@ -921,9 +936,10 @@ class Worksheet implements IComparable
}
/**
- * Set page setup
+ * Set page setup.
*
* @param Worksheet\PageSetup $pValue
+ *
* @return Worksheet
*/
public function setPageSetup(Worksheet\PageSetup $pValue)
@@ -934,7 +950,7 @@ class Worksheet implements IComparable
}
/**
- * Get page margins
+ * Get page margins.
*
* @return Worksheet\PageMargins
*/
@@ -944,9 +960,10 @@ class Worksheet implements IComparable
}
/**
- * Set page margins
+ * Set page margins.
*
* @param Worksheet\PageMargins $pValue
+ *
* @return Worksheet
*/
public function setPageMargins(Worksheet\PageMargins $pValue)
@@ -957,7 +974,7 @@ class Worksheet implements IComparable
}
/**
- * Get page header/footer
+ * Get page header/footer.
*
* @return Worksheet\HeaderFooter
*/
@@ -967,9 +984,10 @@ class Worksheet implements IComparable
}
/**
- * Set page header/footer
+ * Set page header/footer.
*
* @param Worksheet\HeaderFooter $pValue
+ *
* @return Worksheet
*/
public function setHeaderFooter(Worksheet\HeaderFooter $pValue)
@@ -980,7 +998,7 @@ class Worksheet implements IComparable
}
/**
- * Get sheet view
+ * Get sheet view.
*
* @return Worksheet\SheetView
*/
@@ -990,9 +1008,10 @@ class Worksheet implements IComparable
}
/**
- * Set sheet view
+ * Set sheet view.
*
* @param Worksheet\SheetView $pValue
+ *
* @return Worksheet
*/
public function setSheetView(Worksheet\SheetView $pValue)
@@ -1003,7 +1022,7 @@ class Worksheet implements IComparable
}
/**
- * Get Protection
+ * Get Protection.
*
* @return Worksheet\Protection
*/
@@ -1013,9 +1032,10 @@ class Worksheet implements IComparable
}
/**
- * Set Protection
+ * Set Protection.
*
* @param Worksheet\Protection $pValue
+ *
* @return Worksheet
*/
public function setProtection(Worksheet\Protection $pValue)
@@ -1027,10 +1047,11 @@ class Worksheet implements IComparable
}
/**
- * Get highest worksheet column
+ * Get highest worksheet column.
*
* @param string $row Return the data highest column for the specified row,
* or the highest column of any row if no row number is passed
+ *
* @return string Highest column name
*/
public function getHighestColumn($row = null)
@@ -1043,10 +1064,11 @@ class Worksheet implements IComparable
}
/**
- * Get highest worksheet column that contains data
+ * Get highest worksheet column that contains data.
*
* @param string $row Return the highest data column for the specified row,
* or the highest data column of any row if no row number is passed
+ *
* @return string Highest column name that contains data
*/
public function getHighestDataColumn($row = null)
@@ -1055,10 +1077,11 @@ class Worksheet implements IComparable
}
/**
- * Get highest worksheet row
+ * Get highest worksheet row.
*
* @param string $column Return the highest data row for the specified column,
* or the highest row of any column if no column letter is passed
+ *
* @return int Highest row number
*/
public function getHighestRow($column = null)
@@ -1071,10 +1094,11 @@ class Worksheet implements IComparable
}
/**
- * Get highest worksheet row that contains data
+ * Get highest worksheet row that contains data.
*
* @param string $column Return the highest data row for the specified column,
* or the highest data row of any column if no column letter is passed
+ *
* @return string Highest row number that contains data
*/
public function getHighestDataRow($column = null)
@@ -1083,7 +1107,7 @@ class Worksheet implements IComparable
}
/**
- * Get highest worksheet column and highest row that have cell records
+ * Get highest worksheet column and highest row that have cell records.
*
* @return array Highest column name and highest row number
*/
@@ -1093,11 +1117,12 @@ class Worksheet implements IComparable
}
/**
- * Set a cell value
+ * Set a cell value.
*
* @param string $pCoordinate Coordinate of the cell
* @param mixed $pValue Value of the cell
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
+ *
* @return Worksheet|Cell Depending on the last parameter being specified
*/
public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false)
@@ -1108,12 +1133,13 @@ class Worksheet implements IComparable
}
/**
- * Set a cell value by using numeric cell coordinates
+ * Set a cell value by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
* @param int $pRow Numeric row coordinate of the cell
* @param mixed $pValue Value of the cell
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
+ *
* @return Worksheet|Cell Depending on the last parameter being specified
*/
public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false)
@@ -1124,12 +1150,13 @@ class Worksheet implements IComparable
}
/**
- * Set a cell value
+ * Set a cell value.
*
* @param string $pCoordinate Coordinate of the cell
* @param mixed $pValue Value of the cell
* @param string $pDataType Explicit data type
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
+ *
* @return Worksheet|Cell Depending on the last parameter being specified
*/
public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false)
@@ -1141,13 +1168,14 @@ class Worksheet implements IComparable
}
/**
- * Set a cell value by using numeric cell coordinates
+ * Set a cell value by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
* @param mixed $pValue Value of the cell
* @param string $pDataType Explicit data type
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
+ *
* @return Worksheet|Cell Depending on the last parameter being specified
*/
public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false)
@@ -1158,12 +1186,14 @@ class Worksheet implements IComparable
}
/**
- * Get cell at a specific coordinate
+ * Get cell at a specific coordinate.
*
* @param string $pCoordinate Coordinate of the cell
* @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
* already exist, or a null should be returned instead
+ *
* @throws Exception
+ *
* @return null|Cell Cell that was found/created or null
*/
public function getCell($pCoordinate = 'A1', $createIfNotExists = true)
@@ -1205,12 +1235,13 @@ class Worksheet implements IComparable
}
/**
- * Get cell at a specific coordinate by using numeric cell coordinates
+ * Get cell at a specific coordinate by using numeric cell coordinates.
*
* @param string $pColumn Numeric column coordinate of the cell
* @param string $pRow Numeric row coordinate of the cell
* @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
* already exist, or a null should be returned instead
+ *
* @return null|Cell Cell that was found/created or null
*/
public function getCellByColumnAndRow($pColumn = 0, $pRow = 1, $createIfNotExists = true)
@@ -1227,9 +1258,10 @@ class Worksheet implements IComparable
}
/**
- * Create a new cell at the specified coordinate
+ * Create a new cell at the specified coordinate.
*
* @param string $pCoordinate Coordinate of the cell
+ *
* @return Cell Cell that was created
*/
private function createNewCell($pCoordinate)
@@ -1267,7 +1299,9 @@ class Worksheet implements IComparable
* Does the cell at a specific coordinate exist?
*
* @param string $pCoordinate Coordinate of the cell
+ *
* @throws Exception
+ *
* @return bool
*/
public function cellExists($pCoordinate = 'A1')
@@ -1288,9 +1322,8 @@ class Worksheet implements IComparable
if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
if (!$namedRange->getLocalOnly()) {
return $namedRange->getWorksheet()->cellExists($pCoordinate);
- } else {
- throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
}
+ throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
}
} else {
return false;
@@ -1304,13 +1337,12 @@ class Worksheet implements IComparable
throw new Exception('Cell coordinate can not be a range of cells.');
} elseif (strpos($pCoordinate, '$') !== false) {
throw new Exception('Cell coordinate must not be absolute.');
- } else {
+ }
// Coordinates
$aCoordinates = Cell::coordinateFromString($pCoordinate);
// Cell exists?
return $this->cellCollection->isDataSet($pCoordinate);
- }
}
/**
@@ -1318,6 +1350,7 @@ class Worksheet implements IComparable
*
* @param string $pColumn Numeric column coordinate of the cell
* @param string $pRow Numeric row coordinate of the cell
+ *
* @return bool
*/
public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1)
@@ -1326,9 +1359,11 @@ class Worksheet implements IComparable
}
/**
- * Get row dimension at a specific row
+ * Get row dimension at a specific row.
*
* @param int $pRow Numeric index of the row
+ * @param mixed $create
+ *
* @return Worksheet\RowDimension
*/
public function getRowDimension($pRow = 1, $create = true)
@@ -1350,9 +1385,11 @@ class Worksheet implements IComparable
}
/**
- * Get column dimension at a specific column
+ * Get column dimension at a specific column.
*
* @param string $pColumn String index of the column
+ * @param mixed $create
+ *
* @return Worksheet\ColumnDimension
*/
public function getColumnDimension($pColumn = 'A', $create = true)
@@ -1376,9 +1413,10 @@ class Worksheet implements IComparable
}
/**
- * Get column dimension at a specific column by using numeric cell coordinates
+ * Get column dimension at a specific column by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
+ *
* @return Worksheet\ColumnDimension
*/
public function getColumnDimensionByColumn($pColumn = 0)
@@ -1387,7 +1425,7 @@ class Worksheet implements IComparable
}
/**
- * Get styles
+ * Get styles.
*
* @return Style[]
*/
@@ -1397,10 +1435,12 @@ class Worksheet implements IComparable
}
/**
- * Get style for cell
+ * Get style for cell.
*
* @param string $pCellCoordinate Cell coordinate (or range) to get style for
+ *
* @throws Exception
+ *
* @return Style
*/
public function getStyle($pCellCoordinate = 'A1')
@@ -1415,9 +1455,10 @@ class Worksheet implements IComparable
}
/**
- * Get conditional styles for a cell
+ * Get conditional styles for a cell.
*
* @param string $pCoordinate
+ *
* @return Style\Conditional[]
*/
public function getConditionalStyles($pCoordinate = 'A1')
@@ -1434,6 +1475,7 @@ class Worksheet implements IComparable
* Do conditional styles exist for this cell?
*
* @param string $pCoordinate
+ *
* @return bool
*/
public function conditionalStylesExists($pCoordinate = 'A1')
@@ -1446,9 +1488,10 @@ class Worksheet implements IComparable
}
/**
- * Removes conditional styles for a cell
+ * Removes conditional styles for a cell.
*
* @param string $pCoordinate
+ *
* @return Worksheet
*/
public function removeConditionalStyles($pCoordinate = 'A1')
@@ -1459,7 +1502,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of conditional styles
+ * Get collection of conditional styles.
*
* @return array
*/
@@ -1469,10 +1512,11 @@ class Worksheet implements IComparable
}
/**
- * Set conditional styles
+ * Set conditional styles.
*
* @param string $pCoordinate eg: 'A1'
* @param $pValue Style\Conditional[]
+ *
* @return Worksheet
*/
public function setConditionalStyles($pCoordinate, $pValue)
@@ -1483,12 +1527,15 @@ class Worksheet implements IComparable
}
/**
- * Get style for cell by using numeric cell coordinates
+ * Get style for cell by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
* @param int pColumn2 Numeric column coordinate of the range cell
* @param int pRow2 Numeric row coordinate of the range cell
+ * @param null|mixed $pColumn2
+ * @param null|mixed $pRow2
+ *
* @return Style
*/
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null)
@@ -1503,13 +1550,15 @@ class Worksheet implements IComparable
}
/**
- * Duplicate cell style to a range of cells
+ * Duplicate cell style to a range of cells.
*
* Please note that this will overwrite existing cell styles for cells in range!
*
* @param Style $pCellStyle Cell style to duplicate
* @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function duplicateStyle(Style $pCellStyle = null, $pRange = '')
@@ -1549,13 +1598,15 @@ class Worksheet implements IComparable
}
/**
- * Duplicate conditional style to a range of cells
+ * Duplicate conditional style to a range of cells.
*
* Please note that this will overwrite existing cell styles for cells in range!
*
* @param Style\Conditional[] $pCellStyle Cell style to duplicate
* @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '')
@@ -1587,11 +1638,13 @@ class Worksheet implements IComparable
}
/**
- * Set break on a cell
+ * Set break on a cell.
*
* @param string $pCell Cell coordinate (e.g. A1)
* @param int $pBreak Break type (type of Worksheet::BREAK_*)
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function setBreak($pCell = 'A1', $pBreak = self::BREAK_NONE)
@@ -1615,11 +1668,12 @@ class Worksheet implements IComparable
}
/**
- * Set break on a cell by using numeric cell coordinates
+ * Set break on a cell by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
* @param int $pBreak Break type (type of \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_*)
+ *
* @return Worksheet
*/
public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = self::BREAK_NONE)
@@ -1628,7 +1682,7 @@ class Worksheet implements IComparable
}
/**
- * Get breaks
+ * Get breaks.
*
* @return array[]
*/
@@ -1638,10 +1692,12 @@ class Worksheet implements IComparable
}
/**
- * Set merge on a cell range
+ * Set merge on a cell range.
*
* @param string $pRange Cell range (e.g. A1:E1)
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function mergeCells($pRange = 'A1:A1')
@@ -1678,13 +1734,15 @@ class Worksheet implements IComparable
}
/**
- * Set merge on a cell range by using numeric cell coordinates
+ * Set merge on a cell range by using numeric cell coordinates.
*
* @param int $pColumn1 Numeric column coordinate of the first cell
* @param int $pRow1 Numeric row coordinate of the first cell
* @param int $pColumn2 Numeric column coordinate of the last cell
* @param int $pRow2 Numeric row coordinate of the last cell
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
@@ -1695,10 +1753,12 @@ class Worksheet implements IComparable
}
/**
- * Remove merge on a cell range
+ * Remove merge on a cell range.
*
* @param string $pRange Cell range (e.g. A1:E1)
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function unmergeCells($pRange = 'A1:A1')
@@ -1720,13 +1780,15 @@ class Worksheet implements IComparable
}
/**
- * Remove merge on a cell range by using numeric cell coordinates
+ * Remove merge on a cell range by using numeric cell coordinates.
*
* @param int $pColumn1 Numeric column coordinate of the first cell
* @param int $pRow1 Numeric row coordinate of the first cell
* @param int $pColumn2 Numeric column coordinate of the last cell
* @param int $pRow2 Numeric row coordinate of the last cell
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
@@ -1751,6 +1813,7 @@ class Worksheet implements IComparable
* a single cell range.
*
* @param array
+ * @param mixed $pValue
*/
public function setMergeCells($pValue = [])
{
@@ -1760,12 +1823,14 @@ class Worksheet implements IComparable
}
/**
- * Set protection on a cell range
+ * Set protection on a cell range.
*
* @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
* @param string $pPassword Password to unlock the protection
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false)
@@ -1782,7 +1847,7 @@ class Worksheet implements IComparable
}
/**
- * Set protection on a cell range by using numeric cell coordinates
+ * Set protection on a cell range by using numeric cell coordinates.
*
* @param int $pColumn1 Numeric column coordinate of the first cell
* @param int $pRow1 Numeric row coordinate of the first cell
@@ -1790,7 +1855,9 @@ class Worksheet implements IComparable
* @param int $pRow2 Numeric row coordinate of the last cell
* @param string $pPassword Password to unlock the protection
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
@@ -1801,10 +1868,12 @@ class Worksheet implements IComparable
}
/**
- * Remove protection on a cell range
+ * Remove protection on a cell range.
*
* @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function unprotectCells($pRange = 'A1')
@@ -1822,7 +1891,7 @@ class Worksheet implements IComparable
}
/**
- * Remove protection on a cell range by using numeric cell coordinates
+ * Remove protection on a cell range by using numeric cell coordinates.
*
* @param int $pColumn1 Numeric column coordinate of the first cell
* @param int $pRow1 Numeric row coordinate of the first cell
@@ -1830,7 +1899,9 @@ class Worksheet implements IComparable
* @param int $pRow2 Numeric row coordinate of the last cell
* @param string $pPassword Password to unlock the protection
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
@@ -1841,7 +1912,7 @@ class Worksheet implements IComparable
}
/**
- * Get protected cells
+ * Get protected cells.
*
* @return array[]
*/
@@ -1851,7 +1922,7 @@ class Worksheet implements IComparable
}
/**
- * Get Autofilter
+ * Get Autofilter.
*
* @return Worksheet\AutoFilter
*/
@@ -1861,11 +1932,13 @@ class Worksheet implements IComparable
}
/**
- * Set AutoFilter
+ * Set AutoFilter.
*
* @param Worksheet\AutoFilter|string $pValue
* A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function setAutoFilter($pValue)
@@ -1881,13 +1954,15 @@ class Worksheet implements IComparable
}
/**
- * Set Autofilter Range by using numeric cell coordinates
+ * Set Autofilter Range by using numeric cell coordinates.
*
* @param int $pColumn1 Numeric column coordinate of the first cell
* @param int $pRow1 Numeric row coordinate of the first cell
* @param int $pColumn2 Numeric column coordinate of the second cell
* @param int $pRow2 Numeric row coordinate of the second cell
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
@@ -1900,7 +1975,7 @@ class Worksheet implements IComparable
}
/**
- * Remove autofilter
+ * Remove autofilter.
*
* @return Worksheet
*/
@@ -1912,7 +1987,7 @@ class Worksheet implements IComparable
}
/**
- * Get Freeze Pane
+ * Get Freeze Pane.
*
* @return string
*/
@@ -1922,7 +1997,7 @@ class Worksheet implements IComparable
}
/**
- * Freeze Pane
+ * Freeze Pane.
*
* @param string $pCell Cell (i.e. A2)
* Examples:
@@ -1930,7 +2005,9 @@ class Worksheet implements IComparable
* B1 will freeze the columns to the left of cell B1 (i.e column A)
* B2 will freeze the rows above and to the left of cell A2
* (i.e row 1 and column A)
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function freezePane($pCell = '')
@@ -1947,11 +2024,13 @@ class Worksheet implements IComparable
}
/**
- * Freeze Pane by using numeric cell coordinates
+ * Freeze Pane by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1)
@@ -1960,7 +2039,7 @@ class Worksheet implements IComparable
}
/**
- * Unfreeze Pane
+ * Unfreeze Pane.
*
* @return Worksheet
*/
@@ -1970,11 +2049,13 @@ class Worksheet implements IComparable
}
/**
- * Insert a new row, updating all possible related data
+ * Insert a new row, updating all possible related data.
*
* @param int $pBefore Insert before this one
* @param int $pNumRows Number of rows to insert
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function insertNewRowBefore($pBefore = 1, $pNumRows = 1)
@@ -1990,11 +2071,13 @@ class Worksheet implements IComparable
}
/**
- * Insert a new column, updating all possible related data
+ * Insert a new column, updating all possible related data.
*
* @param int $pBefore Insert before this one
* @param int $pNumCols Number of columns to insert
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1)
@@ -2010,28 +2093,31 @@ class Worksheet implements IComparable
}
/**
- * Insert a new column, updating all possible related data
+ * Insert a new column, updating all possible related data.
*
* @param int $pBefore Insert before this one (numeric column coordinate of the cell)
* @param int $pNumCols Number of columns to insert
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1)
{
if ($pBefore >= 0) {
return $this->insertNewColumnBefore(Cell::stringFromColumnIndex($pBefore), $pNumCols);
- } else {
- throw new Exception('Columns can only be inserted before at least column A (0).');
}
+ throw new Exception('Columns can only be inserted before at least column A (0).');
}
/**
- * Delete a row, updating all possible related data
+ * Delete a row, updating all possible related data.
*
* @param int $pRow Remove starting with this one
* @param int $pNumRows Number of rows to remove
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function removeRow($pRow = 1, $pNumRows = 1)
@@ -2052,11 +2138,13 @@ class Worksheet implements IComparable
}
/**
- * Remove a column, updating all possible related data
+ * Remove a column, updating all possible related data.
*
* @param string $pColumn Remove starting with this one
* @param int $pNumCols Number of columns to remove
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function removeColumn($pColumn = 'A', $pNumCols = 1)
@@ -2078,20 +2166,21 @@ class Worksheet implements IComparable
}
/**
- * Remove a column, updating all possible related data
+ * Remove a column, updating all possible related data.
*
* @param int $pColumn Remove starting with this one (numeric column coordinate of the cell)
* @param int $pNumCols Number of columns to remove
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function removeColumnByIndex($pColumn = 0, $pNumCols = 1)
{
if ($pColumn >= 0) {
return $this->removeColumn(Cell::stringFromColumnIndex($pColumn), $pNumCols);
- } else {
- throw new Exception('Columns to be deleted should at least start from column 0');
}
+ throw new Exception('Columns to be deleted should at least start from column 0');
}
/**
@@ -2105,9 +2194,10 @@ class Worksheet implements IComparable
}
/**
- * Set show gridlines
+ * Set show gridlines.
*
* @param bool $pValue Show gridlines (true/false)
+ *
* @return Worksheet
*/
public function setShowGridlines($pValue = false)
@@ -2128,9 +2218,10 @@ class Worksheet implements IComparable
}
/**
- * Set print gridlines
+ * Set print gridlines.
*
* @param bool $pValue Print gridlines (true/false)
+ *
* @return Worksheet
*/
public function setPrintGridlines($pValue = false)
@@ -2151,9 +2242,10 @@ class Worksheet implements IComparable
}
/**
- * Set show row and column headers
+ * Set show row and column headers.
*
* @param bool $pValue Show row and column headers (true/false)
+ *
* @return Worksheet
*/
public function setShowRowColHeaders($pValue = false)
@@ -2164,7 +2256,7 @@ class Worksheet implements IComparable
}
/**
- * Show summary below? (Row/Column outlining)
+ * Show summary below? (Row/Column outlining).
*
* @return bool
*/
@@ -2174,9 +2266,10 @@ class Worksheet implements IComparable
}
/**
- * Set show summary below
+ * Set show summary below.
*
* @param bool $pValue Show summary below (true/false)
+ *
* @return Worksheet
*/
public function setShowSummaryBelow($pValue = true)
@@ -2187,7 +2280,7 @@ class Worksheet implements IComparable
}
/**
- * Show summary right? (Row/Column outlining)
+ * Show summary right? (Row/Column outlining).
*
* @return bool
*/
@@ -2197,9 +2290,10 @@ class Worksheet implements IComparable
}
/**
- * Set show summary right
+ * Set show summary right.
*
* @param bool $pValue Show summary right (true/false)
+ *
* @return Worksheet
*/
public function setShowSummaryRight($pValue = true)
@@ -2210,7 +2304,7 @@ class Worksheet implements IComparable
}
/**
- * Get comments
+ * Get comments.
*
* @return Comment[]
*/
@@ -2223,6 +2317,8 @@ class Worksheet implements IComparable
* Set comments array for the entire sheet.
*
* @param array of Comment
+ * @param mixed $pValue
+ *
* @return Worksheet
*/
public function setComments($pValue = [])
@@ -2233,10 +2329,12 @@ class Worksheet implements IComparable
}
/**
- * Get comment for cell
+ * Get comment for cell.
*
* @param string $pCellCoordinate Cell coordinate to get comment for
+ *
* @throws Exception
+ *
* @return Comment
*/
public function getComment($pCellCoordinate = 'A1')
@@ -2250,25 +2348,24 @@ class Worksheet implements IComparable
throw new Exception('Cell coordinate string must not be absolute.');
} elseif ($pCellCoordinate == '') {
throw new Exception('Cell coordinate can not be zero-length string.');
- } else {
+ }
// Check if we already have a comment for this cell.
// If not, create a new comment.
if (isset($this->comments[$pCellCoordinate])) {
return $this->comments[$pCellCoordinate];
- } else {
- $newComment = new Comment();
- $this->comments[$pCellCoordinate] = $newComment;
-
- return $newComment;
}
- }
+ $newComment = new Comment();
+ $this->comments[$pCellCoordinate] = $newComment;
+
+ return $newComment;
}
/**
- * Get comment for cell by using numeric cell coordinates
+ * Get comment for cell by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
+ *
* @return Comment
*/
public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1)
@@ -2277,7 +2374,7 @@ class Worksheet implements IComparable
}
/**
- * Get active cell
+ * Get active cell.
*
* @return string Example: 'A1'
*/
@@ -2287,7 +2384,7 @@ class Worksheet implements IComparable
}
/**
- * Get selected cells
+ * Get selected cells.
*
* @return string
*/
@@ -2297,9 +2394,10 @@ class Worksheet implements IComparable
}
/**
- * Selected cell
+ * Selected cell.
*
* @param string $pCoordinate Cell (i.e. A1)
+ *
* @return Worksheet
*/
public function setSelectedCell($pCoordinate = 'A1')
@@ -2311,7 +2409,9 @@ class Worksheet implements IComparable
* Select a range of cells.
*
* @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function setSelectedCells($pCoordinate = 'A1')
@@ -2343,11 +2443,13 @@ class Worksheet implements IComparable
}
/**
- * Selected cell by using numeric cell coordinates
+ * Selected cell by using numeric cell coordinates.
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1)
@@ -2356,7 +2458,7 @@ class Worksheet implements IComparable
}
/**
- * Get right-to-left
+ * Get right-to-left.
*
* @return bool
*/
@@ -2366,9 +2468,10 @@ class Worksheet implements IComparable
}
/**
- * Set right-to-left
+ * Set right-to-left.
*
* @param bool $value Right-to-left true/false
+ *
* @return Worksheet
*/
public function setRightToLeft($value = false)
@@ -2379,13 +2482,15 @@ class Worksheet implements IComparable
}
/**
- * Fill worksheet from values in array
+ * Fill worksheet from values in array.
*
* @param array $source Source array
* @param mixed $nullValue Value in source array that stands for blank cell
* @param string $startCell Insert array starting from this cell address as the top left coordinate
* @param bool $strictNullComparison Apply strict comparison when testing for null values in the array
+ *
* @throws Exception
+ *
* @return Worksheet
*/
public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false)
@@ -2426,7 +2531,7 @@ class Worksheet implements IComparable
}
/**
- * Create array from a range of cells
+ * Create array from a range of cells.
*
* @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
* @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
@@ -2434,6 +2539,7 @@ class Worksheet implements IComparable
* @param bool $formatData Should formatting be applied to cell values?
* @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
* True - Return rows and columns indexed by their actual row and column IDs
+ *
* @return array
*/
public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
@@ -2495,7 +2601,7 @@ class Worksheet implements IComparable
}
/**
- * Create array from a range of cells
+ * Create array from a range of cells.
*
* @param string $pNamedRange Name of the Named Range
* @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
@@ -2503,7 +2609,9 @@ class Worksheet implements IComparable
* @param bool $formatData Should formatting be applied to cell values?
* @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
* True - Return rows and columns indexed by their actual row and column IDs
+ *
* @throws Exception
+ *
* @return array
*/
public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
@@ -2520,13 +2628,14 @@ class Worksheet implements IComparable
}
/**
- * Create array from worksheet
+ * Create array from worksheet.
*
* @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
* @param bool $calculateFormulas Should formulas be calculated?
* @param bool $formatData Should formatting be applied to cell values?
* @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
* True - Return rows and columns indexed by their actual row and column IDs
+ *
* @return array
*/
public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
@@ -2542,7 +2651,7 @@ class Worksheet implements IComparable
}
/**
- * Get row iterator
+ * Get row iterator.
*
* @param int $startRow The row number at which to start iterating
* @param int $endRow The row number at which to stop iterating
@@ -2555,7 +2664,7 @@ class Worksheet implements IComparable
}
/**
- * Get column iterator
+ * Get column iterator.
*
* @param string $startColumn The column address at which to start iterating
* @param string $endColumn The column address at which to stop iterating
@@ -2605,7 +2714,7 @@ class Worksheet implements IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
@@ -2627,6 +2736,7 @@ class Worksheet implements IComparable
*
* @param string $pRange Range to extract title from
* @param bool $returnRange Return range? (see example)
+ *
* @return mixed
*/
public static function extractSheetTitle($pRange, $returnRange = false)
@@ -2644,7 +2754,7 @@ class Worksheet implements IComparable
}
/**
- * Get hyperlink
+ * Get hyperlink.
*
* @param string $pCellCoordinate Cell coordinate to get hyperlink for
*/
@@ -2662,10 +2772,11 @@ class Worksheet implements IComparable
}
/**
- * Set hyperlnk
+ * Set hyperlnk.
*
* @param string $pCellCoordinate Cell coordinate to insert hyperlink
* @param Cell\Hyperlink $pHyperlink
+ *
* @return Worksheet
*/
public function setHyperlink($pCellCoordinate = 'A1', Cell\Hyperlink $pHyperlink = null)
@@ -2683,6 +2794,7 @@ class Worksheet implements IComparable
* Hyperlink at a specific coordinate exists?
*
* @param string $pCoordinate
+ *
* @return bool
*/
public function hyperlinkExists($pCoordinate = 'A1')
@@ -2691,7 +2803,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of hyperlinks
+ * Get collection of hyperlinks.
*
* @return Cell\Hyperlink[]
*/
@@ -2701,7 +2813,7 @@ class Worksheet implements IComparable
}
/**
- * Get data validation
+ * Get data validation.
*
* @param string $pCellCoordinate Cell coordinate to get data validation for
*/
@@ -2719,10 +2831,11 @@ class Worksheet implements IComparable
}
/**
- * Set data validation
+ * Set data validation.
*
* @param string $pCellCoordinate Cell coordinate to insert data validation
* @param Cell\DataValidation $pDataValidation
+ *
* @return Worksheet
*/
public function setDataValidation($pCellCoordinate = 'A1', Cell\DataValidation $pDataValidation = null)
@@ -2740,6 +2853,7 @@ class Worksheet implements IComparable
* Data validation at a specific coordinate exists?
*
* @param string $pCoordinate
+ *
* @return bool
*/
public function dataValidationExists($pCoordinate = 'A1')
@@ -2748,7 +2862,7 @@ class Worksheet implements IComparable
}
/**
- * Get collection of data validations
+ * Get collection of data validations.
*
* @return Cell\DataValidation[]
*/
@@ -2758,9 +2872,10 @@ class Worksheet implements IComparable
}
/**
- * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet
+ * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet.
*
* @param string $range
+ *
* @return string Adjusted range value
*/
public function shrinkRangeToFit($range)
@@ -2794,7 +2909,7 @@ class Worksheet implements IComparable
}
/**
- * Get tab color
+ * Get tab color.
*
* @return Style\Color
*/
@@ -2808,7 +2923,7 @@ class Worksheet implements IComparable
}
/**
- * Reset tab color
+ * Reset tab color.
*
* @return Worksheet
*/
@@ -2831,7 +2946,7 @@ class Worksheet implements IComparable
}
/**
- * Copy worksheet (!= clone!)
+ * Copy worksheet (!= clone!).
*
* @return Worksheet
*/
@@ -2870,11 +2985,15 @@ class Worksheet implements IComparable
}
}
}
+
/**
- * Define the code name of the sheet
+ * Define the code name of the sheet.
*
* @param null|string Same rule as Title minus space not allowed (but, like Excel, change silently space to underscore)
+ * @param null|mixed $pValue
+ *
* @throws Exception
+ *
* @return objWorksheet
*/
public function setCodeName($pValue = null)
@@ -2922,8 +3041,9 @@ class Worksheet implements IComparable
return $this;
}
+
/**
- * Return the code name of the sheet
+ * Return the code name of the sheet.
*
* @return null|string
*/
@@ -2931,8 +3051,10 @@ class Worksheet implements IComparable
{
return $this->codeName;
}
+
/**
* Sheet has a code name ?
+ *
* @return bool
*/
public function hasCodeName()
diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php
index 6d284ade..409175c3 100644
--- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php
+++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,34 +20,35 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class AutoFilter
{
/**
- * Autofilter Worksheet
+ * Autofilter Worksheet.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
private $workSheet;
/**
- * Autofilter Range
+ * Autofilter Range.
*
* @var string
*/
private $range = '';
/**
- * Autofilter Column Ruleset
+ * Autofilter Column Ruleset.
*
* @var AutoFilter\Column[]
*/
private $columns = [];
/**
- * Create a new AutoFilter
+ * Create a new AutoFilter.
*
* @param string $pRange Cell range (i.e. A1:E10)
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet
@@ -59,7 +60,7 @@ class AutoFilter
}
/**
- * Get AutoFilter Parent Worksheet
+ * Get AutoFilter Parent Worksheet.
*
* @return \PhpOffice\PhpSpreadsheet\Worksheet
*/
@@ -69,9 +70,10 @@ class AutoFilter
}
/**
- * Set AutoFilter Parent Worksheet
+ * Set AutoFilter Parent Worksheet.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet
+ *
* @return AutoFilter
*/
public function setParent(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null)
@@ -82,7 +84,7 @@ class AutoFilter
}
/**
- * Get AutoFilter Range
+ * Get AutoFilter Range.
*
* @return string
*/
@@ -92,10 +94,12 @@ class AutoFilter
}
/**
- * Set AutoFilter Range
+ * Set AutoFilter Range.
*
* @param string $pRange Cell range (i.e. A1:E10)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter
*/
public function setRange($pRange = '')
@@ -132,9 +136,10 @@ class AutoFilter
}
/**
- * Get all AutoFilter Columns
+ * Get all AutoFilter Columns.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter\Column[]
*/
public function getColumns()
@@ -143,10 +148,12 @@ class AutoFilter
}
/**
- * Validate that the specified column is in the AutoFilter range
+ * Validate that the specified column is in the AutoFilter range.
*
* @param string $column Column name (e.g. A)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return int The column offset within the autofilter range
*/
public function testColumnInRange($column)
@@ -165,10 +172,12 @@ class AutoFilter
}
/**
- * Get a specified AutoFilter Column Offset within the defined AutoFilter range
+ * Get a specified AutoFilter Column Offset within the defined AutoFilter range.
*
* @param string $pColumn Column name (e.g. A)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return int The offset of the specified column within the autofilter range
*/
public function getColumnOffset($pColumn)
@@ -177,10 +186,12 @@ class AutoFilter
}
/**
- * Get a specified AutoFilter Column
+ * Get a specified AutoFilter Column.
*
* @param string $pColumn Column name (e.g. A)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter\Column
*/
public function getColumn($pColumn)
@@ -195,10 +206,12 @@ class AutoFilter
}
/**
- * Get a specified AutoFilter Column by it's offset
+ * Get a specified AutoFilter Column by it's offset.
*
* @param int $pColumnOffset Column offset within range (starting from 0)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter\Column
*/
public function getColumnByOffset($pColumnOffset = 0)
@@ -210,11 +223,13 @@ class AutoFilter
}
/**
- * Set AutoFilter
+ * Set AutoFilter.
*
* @param AutoFilter\Column|string $pColumn
* A simple string containing a Column ID like 'A' is permitted
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter
*/
public function setColumn($pColumn)
@@ -240,10 +255,12 @@ class AutoFilter
}
/**
- * Clear a specified AutoFilter Column
+ * Clear a specified AutoFilter Column.
*
* @param string $pColumn Column name (e.g. A)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter
*/
public function clearColumn($pColumn)
@@ -258,7 +275,7 @@ class AutoFilter
}
/**
- * Shift an AutoFilter Column Rule to a different column
+ * Shift an AutoFilter Column Rule to a different column.
*
* Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
* Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value.
@@ -266,6 +283,7 @@ class AutoFilter
*
* @param string $fromColumn Column name (e.g. A)
* @param string $toColumn Column name (e.g. B)
+ *
* @return AutoFilter
*/
public function shiftColumn($fromColumn = null, $toColumn = null)
@@ -287,10 +305,11 @@ class AutoFilter
}
/**
- * Test if cell value is in the defined set of values
+ * Test if cell value is in the defined set of values.
*
* @param mixed $cellValue
* @param mixed[] $dataSet
+ *
* @return bool
*/
private static function filterTestInSimpleDataSet($cellValue, $dataSet)
@@ -305,10 +324,11 @@ class AutoFilter
}
/**
- * Test if cell value is in the defined set of Excel date values
+ * Test if cell value is in the defined set of Excel date values.
*
* @param mixed $cellValue
* @param mixed[] $dataSet
+ *
* @return bool
*/
private static function filterTestInDateGroupSet($cellValue, $dataSet)
@@ -346,10 +366,11 @@ class AutoFilter
}
/**
- * Test if cell value is within a set of values defined by a ruleset
+ * Test if cell value is within a set of values defined by a ruleset.
*
* @param mixed $cellValue
* @param mixed[] $ruleSet
+ *
* @return bool
*/
private static function filterTestInCustomDataSet($cellValue, $ruleSet)
@@ -424,10 +445,11 @@ class AutoFilter
}
/**
- * Test if cell date value is matches a set of values defined by a set of months
+ * Test if cell date value is matches a set of values defined by a set of months.
*
* @param mixed $cellValue
* @param mixed[] $monthSet
+ *
* @return bool
*/
private static function filterTestInPeriodDateSet($cellValue, $monthSet)
@@ -448,7 +470,7 @@ class AutoFilter
}
/**
- * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching
+ * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching.
*
* @var array
*/
@@ -456,10 +478,11 @@ class AutoFilter
private static $toReplace = ['.*', '.', '~', '\*', '\?'];
/**
- * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation
+ * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation.
*
* @param string $dynamicRuleType
* @param AutoFilter\Column $filterColumn
+ *
* @return mixed[]
*/
private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
@@ -580,9 +603,10 @@ class AutoFilter
}
/**
- * Apply the AutoFilter rules to the AutoFilter Range
+ * Apply the AutoFilter rules to the AutoFilter Range.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return AutoFilter
*/
public function showHideRows()
@@ -712,7 +736,7 @@ class AutoFilter
];
} else {
// Date based
- if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') {
+ if ($dynamicRuleType[0] == 'M' || $dynamicRuleType[0] == 'Q') {
// Month or Quarter
sscanf($dynamicRuleType, '%[A-Z]%d', $periodType, $period);
if ($periodType == 'M') {
diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
index 3e45a3da..b6cdcd11 100644
--- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
+++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -35,7 +36,7 @@ class Column
const AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10';
/**
- * Types of autofilter rules
+ * Types of autofilter rules.
*
* @var string[]
*/
@@ -55,7 +56,7 @@ class Column
const AUTOFILTER_COLUMN_JOIN_OR = 'or';
/**
- * Join options for autofilter rules
+ * Join options for autofilter rules.
*
* @var string[]
*/
@@ -65,49 +66,49 @@ class Column
];
/**
- * Autofilter
+ * Autofilter.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter
*/
private $parent;
/**
- * Autofilter Column Index
+ * Autofilter Column Index.
*
* @var string
*/
private $columnIndex = '';
/**
- * Autofilter Column Filter Type
+ * Autofilter Column Filter Type.
*
* @var string
*/
private $filterType = self::AUTOFILTER_FILTERTYPE_FILTER;
/**
- * Autofilter Multiple Rules And/Or
+ * Autofilter Multiple Rules And/Or.
*
* @var string
*/
private $join = self::AUTOFILTER_COLUMN_JOIN_OR;
/**
- * Autofilter Column Rules
+ * Autofilter Column Rules.
*
* @var array of Column\Rule
*/
private $ruleset = [];
/**
- * Autofilter Column Dynamic Attributes
+ * Autofilter Column Dynamic Attributes.
*
* @var array of mixed
*/
private $attributes = [];
/**
- * Create a new Column
+ * Create a new Column.
*
* @param string $pColumn Column (e.g. A)
* @param \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter $pParent Autofilter for this column
@@ -119,7 +120,7 @@ class Column
}
/**
- * Get AutoFilter Column Index
+ * Get AutoFilter Column Index.
*
* @return string
*/
@@ -129,10 +130,12 @@ class Column
}
/**
- * Set AutoFilter Column Index
+ * Set AutoFilter Column Index.
*
* @param string $pColumn Column (e.g. A)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column
*/
public function setColumnIndex($pColumn)
@@ -149,7 +152,7 @@ class Column
}
/**
- * Get this Column's AutoFilter Parent
+ * Get this Column's AutoFilter Parent.
*
* @return \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter
*/
@@ -159,9 +162,10 @@ class Column
}
/**
- * Set this Column's AutoFilter Parent
+ * Set this Column's AutoFilter Parent.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter
+ *
* @return Column
*/
public function setParent(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter $pParent = null)
@@ -172,7 +176,7 @@ class Column
}
/**
- * Get AutoFilter Type
+ * Get AutoFilter Type.
*
* @return string
*/
@@ -182,10 +186,12 @@ class Column
}
/**
- * Set AutoFilter Type
+ * Set AutoFilter Type.
*
* @param string $pFilterType
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column
*/
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
@@ -200,7 +206,7 @@ class Column
}
/**
- * Get AutoFilter Multiple Rules And/Or Join
+ * Get AutoFilter Multiple Rules And/Or Join.
*
* @return string
*/
@@ -210,10 +216,12 @@ class Column
}
/**
- * Set AutoFilter Multiple Rules And/Or
+ * Set AutoFilter Multiple Rules And/Or.
*
* @param string $pJoin And/Or
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column
*/
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
@@ -230,10 +238,12 @@ class Column
}
/**
- * Set AutoFilter Attributes
+ * Set AutoFilter Attributes.
*
* @param string[] $pAttributes
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column
*/
public function setAttributes($pAttributes = [])
@@ -244,11 +254,13 @@ class Column
}
/**
- * Set An AutoFilter Attribute
+ * Set An AutoFilter Attribute.
*
* @param string $pName Attribute Name
* @param string $pValue Attribute Value
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column
*/
public function setAttribute($pName, $pValue)
@@ -259,7 +271,7 @@ class Column
}
/**
- * Get AutoFilter Column Attributes
+ * Get AutoFilter Column Attributes.
*
* @return string
*/
@@ -269,9 +281,10 @@ class Column
}
/**
- * Get specific AutoFilter Column Attribute
+ * Get specific AutoFilter Column Attribute.
*
* @param string $pName Attribute Name
+ *
* @return string
*/
public function getAttribute($pName)
@@ -284,9 +297,10 @@ class Column
}
/**
- * Get all AutoFilter Column Rules
+ * Get all AutoFilter Column Rules.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Column\Rule[]
*/
public function getRules()
@@ -295,9 +309,10 @@ class Column
}
/**
- * Get a specified AutoFilter Column Rule
+ * Get a specified AutoFilter Column Rule.
*
* @param int $pIndex Rule index in the ruleset array
+ *
* @return Column\Rule
*/
public function getRule($pIndex)
@@ -310,7 +325,7 @@ class Column
}
/**
- * Create a new AutoFilter Column Rule in the ruleset
+ * Create a new AutoFilter Column Rule in the ruleset.
*
* @return Column\Rule
*/
@@ -322,10 +337,11 @@ class Column
}
/**
- * Add a new AutoFilter Column Rule to the ruleset
+ * Add a new AutoFilter Column Rule to the ruleset.
*
* @param Column\Rule $pRule
* @param bool $returnRule Flag indicating whether the rule object or the column object should be returned
+ *
* @return Column|Column\Rule
*/
public function addRule(Column\Rule $pRule, $returnRule = true)
@@ -338,9 +354,10 @@ class Column
/**
* Delete a specified AutoFilter Column Rule
- * If the number of rules is reduced to 1, then we reset And/Or logic to Or
+ * If the number of rules is reduced to 1, then we reset And/Or logic to Or.
*
* @param int $pIndex Rule index in the ruleset array
+ *
* @return Column
*/
public function deleteRule($pIndex)
@@ -357,7 +374,7 @@ class Column
}
/**
- * Delete all AutoFilter Column Rules
+ * Delete all AutoFilter Column Rules.
*
* @return Column
*/
diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
index ea192140..6220a5e1 100644
--- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
+++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -219,42 +220,42 @@ class Rule
// const AUTOFILTER_COLUMN_RULE_ALLDATESINQUARTER = 'allDatesInQuarter'; //
* $objDrawing->setResizeProportional(true);
* $objDrawing->setWidthAndHeight(160,120);
- *
+ * .
*
* @author Vincent@luo MSN:kele_100@hotmail.com
+ *
* @param int $width
* @param int $height
+ *
* @return BaseDrawing
*/
public function setWidthAndHeight($width = 0, $height = 0)
@@ -405,7 +417,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get ResizeProportional
+ * Get ResizeProportional.
*
* @return bool
*/
@@ -415,9 +427,10 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set ResizeProportional
+ * Set ResizeProportional.
*
* @param bool $pValue
+ *
* @return BaseDrawing
*/
public function setResizeProportional($pValue = true)
@@ -428,7 +441,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Rotation
+ * Get Rotation.
*
* @return int
*/
@@ -438,9 +451,10 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Rotation
+ * Set Rotation.
*
* @param int $pValue
+ *
* @return BaseDrawing
*/
public function setRotation($pValue = 0)
@@ -451,7 +465,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Shadow
+ * Get Shadow.
*
* @return Drawing\Shadow
*/
@@ -461,10 +475,12 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Shadow
+ * Set Shadow.
*
* @param Drawing\Shadow $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return BaseDrawing
*/
public function setShadow(Drawing\Shadow $pValue = null)
@@ -475,7 +491,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Worksheet/CellIterator.php b/src/PhpSpreadsheet/Worksheet/CellIterator.php
index e9d365c9..8f914693 100644
--- a/src/PhpSpreadsheet/Worksheet/CellIterator.php
+++ b/src/PhpSpreadsheet/Worksheet/CellIterator.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,34 +20,35 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
abstract class CellIterator
{
/**
- * \PhpOffice\PhpSpreadsheet\Worksheet to iterate
+ * \PhpOffice\PhpSpreadsheet\Worksheet to iterate.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
protected $subject;
/**
- * Current iterator position
+ * Current iterator position.
*
* @var mixed
*/
protected $position = null;
/**
- * Iterate only existing cells
+ * Iterate only existing cells.
*
* @var bool
*/
protected $onlyExistingCells = false;
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -55,7 +56,7 @@ abstract class CellIterator
}
/**
- * Get loop only existing cells
+ * Get loop only existing cells.
*
* @return bool
*/
@@ -65,21 +66,22 @@ abstract class CellIterator
}
/**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
abstract protected function adjustForExistingOnlyRange();
/**
- * Set the iterator to loop only existing cells
+ * Set the iterator to loop only existing cells.
*
* @param bool $value
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public function setIterateOnlyExistingCells($value = true)
{
- $this->onlyExistingCells = (boolean) $value;
+ $this->onlyExistingCells = (bool) $value;
$this->adjustForExistingOnlyRange();
}
diff --git a/src/PhpSpreadsheet/Worksheet/Column.php b/src/PhpSpreadsheet/Worksheet/Column.php
index 4ccb9d24..429a3e3e 100644
--- a/src/PhpSpreadsheet/Worksheet/Column.php
+++ b/src/PhpSpreadsheet/Worksheet/Column.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,27 +20,28 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Column
{
/**
- * \PhpOffice\PhpSpreadsheet\Worksheet
+ * \PhpOffice\PhpSpreadsheet\Worksheet.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
private $parent;
/**
- * Column index
+ * Column index.
*
* @var string
*/
private $columnIndex;
/**
- * Create a new column
+ * Create a new column.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent
* @param string $columnIndex
@@ -53,7 +54,7 @@ class Column
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -61,7 +62,7 @@ class Column
}
/**
- * Get column index
+ * Get column index.
*
* @return string
*/
@@ -71,10 +72,11 @@ class Column
}
/**
- * Get cell iterator
+ * Get cell iterator.
*
* @param int $startRow The row number at which to start iterating
* @param int $endRow Optionally, the row number at which to stop iterating
+ *
* @return ColumnCellIterator
*/
public function getCellIterator($startRow = 1, $endRow = null)
diff --git a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
index 3db702ac..a7a0239a 100644
--- a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
+++ b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,34 +20,35 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class ColumnCellIterator extends CellIterator implements \Iterator
{
/**
- * Column index
+ * Column index.
*
* @var string
*/
protected $columnIndex;
/**
- * Start position
+ * Start position.
*
* @var int
*/
protected $startRow = 1;
/**
- * End position
+ * End position.
*
* @var int
*/
protected $endRow = 1;
/**
- * Create a new row iterator
+ * Create a new row iterator.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $subject The worksheet to iterate over
* @param string $columnIndex The column that we want to iterate
@@ -64,7 +65,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -72,10 +73,12 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * (Re)Set the start row and the current row pointer
+ * (Re)Set the start row and the current row pointer.
*
* @param int $startRow The row number at which to start iterating
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return ColumnCellIterator
*/
public function resetStart($startRow = 1)
@@ -88,10 +91,12 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * (Re)Set the end row
+ * (Re)Set the end row.
*
* @param int $endRow The row number at which to stop iterating
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return ColumnCellIterator
*/
public function resetEnd($endRow = null)
@@ -103,10 +108,12 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the row pointer to the selected row
+ * Set the row pointer to the selected row.
*
* @param int $row The row number to set the current pointer at
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return ColumnCellIterator
*/
public function seek($row = 1)
@@ -122,7 +129,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Rewind the iterator to the starting row
+ * Rewind the iterator to the starting row.
*/
public function rewind()
{
@@ -130,7 +137,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Return the current cell in this worksheet column
+ * Return the current cell in this worksheet column.
*
* @return null|\PhpOffice\PhpSpreadsheet\Cell
*/
@@ -140,7 +147,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Return the current iterator key
+ * Return the current iterator key.
*
* @return int
*/
@@ -150,7 +157,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the iterator to its next value
+ * Set the iterator to its next value.
*/
public function next()
{
@@ -162,7 +169,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the iterator to its previous value
+ * Set the iterator to its previous value.
*/
public function prev()
{
@@ -178,7 +185,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Indicate if more rows exist in the worksheet range of rows that we're iterating
+ * Indicate if more rows exist in the worksheet range of rows that we're iterating.
*
* @return bool
*/
@@ -188,7 +195,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
}
/**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
index c07682d1..472684c5 100644
--- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
+++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class ColumnDimension extends Dimension
{
/**
- * Column index
+ * Column index.
*
* @var string
*/
private $columnIndex;
/**
- * Column width
+ * Column width.
*
* When this is set to a negative value, the column width should be ignored by IWriter
*
@@ -49,7 +50,7 @@ class ColumnDimension extends Dimension
private $autoSize = false;
/**
- * Create a new ColumnDimension
+ * Create a new ColumnDimension.
*
* @param string $pIndex Character column index
*/
@@ -63,7 +64,7 @@ class ColumnDimension extends Dimension
}
/**
- * Get ColumnIndex
+ * Get ColumnIndex.
*
* @return string
*/
@@ -73,9 +74,10 @@ class ColumnDimension extends Dimension
}
/**
- * Set ColumnIndex
+ * Set ColumnIndex.
*
* @param string $pValue
+ *
* @return ColumnDimension
*/
public function setColumnIndex($pValue)
@@ -86,7 +88,7 @@ class ColumnDimension extends Dimension
}
/**
- * Get Width
+ * Get Width.
*
* @return float
*/
@@ -96,9 +98,10 @@ class ColumnDimension extends Dimension
}
/**
- * Set Width
+ * Set Width.
*
* @param float $pValue
+ *
* @return ColumnDimension
*/
public function setWidth($pValue = -1)
@@ -109,7 +112,7 @@ class ColumnDimension extends Dimension
}
/**
- * Get Auto Size
+ * Get Auto Size.
*
* @return bool
*/
@@ -119,9 +122,10 @@ class ColumnDimension extends Dimension
}
/**
- * Set Auto Size
+ * Set Auto Size.
*
* @param bool $pValue
+ *
* @return ColumnDimension
*/
public function setAutoSize($pValue = false)
diff --git a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
index f73883bb..2814add7 100644
--- a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
+++ b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
@@ -6,7 +6,7 @@ use PhpOffice\PhpSpreadsheet\Cell;
use PhpOffice\PhpSpreadsheet\Exception;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -23,41 +23,42 @@ use PhpOffice\PhpSpreadsheet\Exception;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class ColumnIterator implements \Iterator
{
/**
- * \PhpOffice\PhpSpreadsheet\Worksheet to iterate
+ * \PhpOffice\PhpSpreadsheet\Worksheet to iterate.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
private $subject;
/**
- * Current iterator position
+ * Current iterator position.
*
* @var int
*/
private $position = 0;
/**
- * Start position
+ * Start position.
*
* @var int
*/
private $startColumn = 0;
/**
- * End position
+ * End position.
*
* @var int
*/
private $endColumn = 0;
/**
- * Create a new column iterator
+ * Create a new column iterator.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $subject The worksheet to iterate over
* @param string $startColumn The column address at which to start iterating
@@ -72,7 +73,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -80,10 +81,12 @@ class ColumnIterator implements \Iterator
}
/**
- * (Re)Set the start column and the current column pointer
+ * (Re)Set the start column and the current column pointer.
*
* @param int $startColumn The column address at which to start iterating
+ *
* @throws Exception
+ *
* @return ColumnIterator
*/
public function resetStart($startColumn = 'A')
@@ -103,9 +106,10 @@ class ColumnIterator implements \Iterator
}
/**
- * (Re)Set the end column
+ * (Re)Set the end column.
*
* @param string $endColumn The column address at which to stop iterating
+ *
* @return ColumnIterator
*/
public function resetEnd($endColumn = null)
@@ -117,10 +121,12 @@ class ColumnIterator implements \Iterator
}
/**
- * Set the column pointer to the selected column
+ * Set the column pointer to the selected column.
*
* @param string $column The column address to set the current pointer at
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return ColumnIterator
*/
public function seek($column = 'A')
@@ -135,7 +141,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Rewind the iterator to the starting column
+ * Rewind the iterator to the starting column.
*/
public function rewind()
{
@@ -143,7 +149,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Return the current column in this worksheet
+ * Return the current column in this worksheet.
*
* @return Column
*/
@@ -153,7 +159,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Return the current iterator key
+ * Return the current iterator key.
*
* @return string
*/
@@ -163,7 +169,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Set the iterator to its next value
+ * Set the iterator to its next value.
*/
public function next()
{
@@ -171,7 +177,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Set the iterator to its previous value
+ * Set the iterator to its previous value.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -189,7 +195,7 @@ class ColumnIterator implements \Iterator
}
/**
- * Indicate if more columns exist in the worksheet range of columns that we're iterating
+ * Indicate if more columns exist in the worksheet range of columns that we're iterating.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php
index 782a4d65..da06a66c 100644
--- a/src/PhpSpreadsheet/Worksheet/Dimension.php
+++ b/src/PhpSpreadsheet/Worksheet/Dimension.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -33,14 +34,14 @@ abstract class Dimension
private $visible = true;
/**
- * Outline level
+ * Outline level.
*
* @var int
*/
private $outlineLevel = 0;
/**
- * Collapsed
+ * Collapsed.
*
* @var bool
*/
@@ -54,7 +55,7 @@ abstract class Dimension
private $xfIndex;
/**
- * Create a new Dimension
+ * Create a new Dimension.
*
* @param int $initialValue Numeric row index
*/
@@ -65,7 +66,7 @@ abstract class Dimension
}
/**
- * Get Visible
+ * Get Visible.
*
* @return bool
*/
@@ -75,9 +76,10 @@ abstract class Dimension
}
/**
- * Set Visible
+ * Set Visible.
*
* @param bool $pValue
+ *
* @return Dimension
*/
public function setVisible($pValue = true)
@@ -88,7 +90,7 @@ abstract class Dimension
}
/**
- * Get Outline Level
+ * Get Outline Level.
*
* @return int
*/
@@ -98,12 +100,14 @@ abstract class Dimension
}
/**
- * Set Outline Level
+ * Set Outline Level.
*
* Value must be between 0 and 7
*
* @param int $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Dimension
*/
public function setOutlineLevel($pValue)
@@ -118,7 +122,7 @@ abstract class Dimension
}
/**
- * Get Collapsed
+ * Get Collapsed.
*
* @return bool
*/
@@ -128,9 +132,10 @@ abstract class Dimension
}
/**
- * Set Collapsed
+ * Set Collapsed.
*
* @param bool $pValue
+ *
* @return Dimension
*/
public function setCollapsed($pValue = true)
@@ -141,7 +146,7 @@ abstract class Dimension
}
/**
- * Get index to cellXf
+ * Get index to cellXf.
*
* @return int
*/
@@ -151,9 +156,10 @@ abstract class Dimension
}
/**
- * Set index to cellXf
+ * Set index to cellXf.
*
* @param int $pValue
+ *
* @return Dimension
*/
public function setXfIndex($pValue = 0)
diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php
index 4041e7f9..0c2bfe29 100644
--- a/src/PhpSpreadsheet/Worksheet/Drawing.php
+++ b/src/PhpSpreadsheet/Worksheet/Drawing.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
{
/**
- * Path
+ * Path.
*
* @var string
*/
private $path;
/**
- * Create a new Drawing
+ * Create a new Drawing.
*/
public function __construct()
{
@@ -45,7 +46,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Get Filename
+ * Get Filename.
*
* @return string
*/
@@ -55,7 +56,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Get indexed filename (using image index)
+ * Get indexed filename (using image index).
*
* @return string
*/
@@ -68,7 +69,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Get Extension
+ * Get Extension.
*
* @return string
*/
@@ -80,7 +81,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Get Path
+ * Get Path.
*
* @return string
*/
@@ -90,11 +91,13 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Set Path
+ * Set Path.
*
* @param string $pValue File path
* @param bool $pVerifyFile Verify file
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Drawing
*/
public function setPath($pValue = '', $pVerifyFile = true)
@@ -118,7 +121,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
index 8d7321af..38c6878e 100644
--- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
+++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -36,14 +37,14 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
const SHADOW_TOP_RIGHT = 'tr';
/**
- * Visible
+ * Visible.
*
* @var bool
*/
private $visible;
/**
- * Blur radius
+ * Blur radius.
*
* Defaults to 6
*
@@ -52,7 +53,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
private $blurRadius;
/**
- * Shadow distance
+ * Shadow distance.
*
* Defaults to 2
*
@@ -61,35 +62,35 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
private $distance;
/**
- * Shadow direction (in degrees)
+ * Shadow direction (in degrees).
*
* @var int
*/
private $direction;
/**
- * Shadow alignment
+ * Shadow alignment.
*
* @var int
*/
private $alignment;
/**
- * Color
+ * Color.
*
* @var \PhpOffice\PhpSpreadsheet\Style\Color
*/
private $color;
/**
- * Alpha
+ * Alpha.
*
* @var int
*/
private $alpha;
/**
- * Create a new Shadow
+ * Create a new Shadow.
*/
public function __construct()
{
@@ -104,7 +105,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Visible
+ * Get Visible.
*
* @return bool
*/
@@ -114,9 +115,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Visible
+ * Set Visible.
*
* @param bool $pValue
+ *
* @return Shadow
*/
public function setVisible($pValue = false)
@@ -127,7 +129,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Blur radius
+ * Get Blur radius.
*
* @return int
*/
@@ -137,9 +139,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Blur radius
+ * Set Blur radius.
*
* @param int $pValue
+ *
* @return Shadow
*/
public function setBlurRadius($pValue = 6)
@@ -150,7 +153,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Shadow distance
+ * Get Shadow distance.
*
* @return int
*/
@@ -160,9 +163,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Shadow distance
+ * Set Shadow distance.
*
* @param int $pValue
+ *
* @return Shadow
*/
public function setDistance($pValue = 2)
@@ -173,7 +177,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Shadow direction (in degrees)
+ * Get Shadow direction (in degrees).
*
* @return int
*/
@@ -183,9 +187,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Shadow direction (in degrees)
+ * Set Shadow direction (in degrees).
*
* @param int $pValue
+ *
* @return Shadow
*/
public function setDirection($pValue = 0)
@@ -196,7 +201,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Shadow alignment
+ * Get Shadow alignment.
*
* @return int
*/
@@ -206,9 +211,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Shadow alignment
+ * Set Shadow alignment.
*
* @param int $pValue
+ *
* @return Shadow
*/
public function setAlignment($pValue = 0)
@@ -219,7 +225,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Color
+ * Get Color.
*
* @return \PhpOffice\PhpSpreadsheet\Style\Color
*/
@@ -229,10 +235,12 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Color
+ * Set Color.
*
* @param \PhpOffice\PhpSpreadsheet\Style\Color $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return Shadow
*/
public function setColor(\PhpOffice\PhpSpreadsheet\Style\Color $pValue = null)
@@ -243,7 +251,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get Alpha
+ * Get Alpha.
*
* @return int
*/
@@ -253,9 +261,10 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Set Alpha
+ * Set Alpha.
*
* @param int $pValue
+ *
* @return Shadow
*/
public function setAlpha($pValue = 0)
@@ -266,7 +275,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
index 64996390..b8ad3ccf 100644
--- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
+++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*
@@ -94,91 +95,91 @@ class HeaderFooter
const IMAGE_FOOTER_RIGHT = 'RF';
/**
- * OddHeader
+ * OddHeader.
*
* @var string
*/
private $oddHeader = '';
/**
- * OddFooter
+ * OddFooter.
*
* @var string
*/
private $oddFooter = '';
/**
- * EvenHeader
+ * EvenHeader.
*
* @var string
*/
private $evenHeader = '';
/**
- * EvenFooter
+ * EvenFooter.
*
* @var string
*/
private $evenFooter = '';
/**
- * FirstHeader
+ * FirstHeader.
*
* @var string
*/
private $firstHeader = '';
/**
- * FirstFooter
+ * FirstFooter.
*
* @var string
*/
private $firstFooter = '';
/**
- * Different header for Odd/Even, defaults to false
+ * Different header for Odd/Even, defaults to false.
*
* @var bool
*/
private $differentOddEven = false;
/**
- * Different header for first page, defaults to false
+ * Different header for first page, defaults to false.
*
* @var bool
*/
private $differentFirst = false;
/**
- * Scale with document, defaults to true
+ * Scale with document, defaults to true.
*
* @var bool
*/
private $scaleWithDocument = true;
/**
- * Align with margins, defaults to true
+ * Align with margins, defaults to true.
*
* @var bool
*/
private $alignWithMargins = true;
/**
- * Header/footer images
+ * Header/footer images.
*
* @var HeaderFooterDrawing[]
*/
private $headerFooterImages = [];
/**
- * Create a new HeaderFooter
+ * Create a new HeaderFooter.
*/
public function __construct()
{
}
/**
- * Get OddHeader
+ * Get OddHeader.
*
* @return string
*/
@@ -188,9 +189,10 @@ class HeaderFooter
}
/**
- * Set OddHeader
+ * Set OddHeader.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setOddHeader($pValue)
@@ -201,7 +203,7 @@ class HeaderFooter
}
/**
- * Get OddFooter
+ * Get OddFooter.
*
* @return string
*/
@@ -211,9 +213,10 @@ class HeaderFooter
}
/**
- * Set OddFooter
+ * Set OddFooter.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setOddFooter($pValue)
@@ -224,7 +227,7 @@ class HeaderFooter
}
/**
- * Get EvenHeader
+ * Get EvenHeader.
*
* @return string
*/
@@ -234,9 +237,10 @@ class HeaderFooter
}
/**
- * Set EvenHeader
+ * Set EvenHeader.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setEvenHeader($pValue)
@@ -247,7 +251,7 @@ class HeaderFooter
}
/**
- * Get EvenFooter
+ * Get EvenFooter.
*
* @return string
*/
@@ -257,9 +261,10 @@ class HeaderFooter
}
/**
- * Set EvenFooter
+ * Set EvenFooter.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setEvenFooter($pValue)
@@ -270,7 +275,7 @@ class HeaderFooter
}
/**
- * Get FirstHeader
+ * Get FirstHeader.
*
* @return string
*/
@@ -280,9 +285,10 @@ class HeaderFooter
}
/**
- * Set FirstHeader
+ * Set FirstHeader.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setFirstHeader($pValue)
@@ -293,7 +299,7 @@ class HeaderFooter
}
/**
- * Get FirstFooter
+ * Get FirstFooter.
*
* @return string
*/
@@ -303,9 +309,10 @@ class HeaderFooter
}
/**
- * Set FirstFooter
+ * Set FirstFooter.
*
* @param string $pValue
+ *
* @return HeaderFooter
*/
public function setFirstFooter($pValue)
@@ -316,7 +323,7 @@ class HeaderFooter
}
/**
- * Get DifferentOddEven
+ * Get DifferentOddEven.
*
* @return bool
*/
@@ -326,9 +333,10 @@ class HeaderFooter
}
/**
- * Set DifferentOddEven
+ * Set DifferentOddEven.
*
* @param bool $pValue
+ *
* @return HeaderFooter
*/
public function setDifferentOddEven($pValue = false)
@@ -339,7 +347,7 @@ class HeaderFooter
}
/**
- * Get DifferentFirst
+ * Get DifferentFirst.
*
* @return bool
*/
@@ -349,9 +357,10 @@ class HeaderFooter
}
/**
- * Set DifferentFirst
+ * Set DifferentFirst.
*
* @param bool $pValue
+ *
* @return HeaderFooter
*/
public function setDifferentFirst($pValue = false)
@@ -362,7 +371,7 @@ class HeaderFooter
}
/**
- * Get ScaleWithDocument
+ * Get ScaleWithDocument.
*
* @return bool
*/
@@ -372,9 +381,10 @@ class HeaderFooter
}
/**
- * Set ScaleWithDocument
+ * Set ScaleWithDocument.
*
* @param bool $pValue
+ *
* @return HeaderFooter
*/
public function setScaleWithDocument($pValue = true)
@@ -385,7 +395,7 @@ class HeaderFooter
}
/**
- * Get AlignWithMargins
+ * Get AlignWithMargins.
*
* @return bool
*/
@@ -395,9 +405,10 @@ class HeaderFooter
}
/**
- * Set AlignWithMargins
+ * Set AlignWithMargins.
*
* @param bool $pValue
+ *
* @return HeaderFooter
*/
public function setAlignWithMargins($pValue = true)
@@ -408,11 +419,13 @@ class HeaderFooter
}
/**
- * Add header/footer image
+ * Add header/footer image.
*
* @param HeaderFooterDrawing $image
* @param string $location
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return HeaderFooter
*/
public function addImage(HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT)
@@ -423,10 +436,12 @@ class HeaderFooter
}
/**
- * Remove header/footer image
+ * Remove header/footer image.
*
* @param string $location
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return HeaderFooter
*/
public function removeImage($location = self::IMAGE_HEADER_LEFT)
@@ -439,10 +454,12 @@ class HeaderFooter
}
/**
- * Set header/footer images
+ * Set header/footer images.
*
* @param HeaderFooterDrawing[] $images
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return HeaderFooter
*/
public function setImages($images)
@@ -457,7 +474,7 @@ class HeaderFooter
}
/**
- * Get header/footer images
+ * Get header/footer images.
*
* @return HeaderFooterDrawing[]
*/
diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
index 2dc8814c..c684b90e 100644
--- a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
+++ b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,62 +20,63 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\IComparable
{
/**
- * Path
+ * Path.
*
* @var string
*/
private $path;
/**
- * Name
+ * Name.
*
* @var string
*/
protected $name;
/**
- * Offset X
+ * Offset X.
*
* @var int
*/
protected $offsetX;
/**
- * Offset Y
+ * Offset Y.
*
* @var int
*/
protected $offsetY;
/**
- * Width
+ * Width.
*
* @var int
*/
protected $width;
/**
- * Height
+ * Height.
*
* @var int
*/
protected $height;
/**
- * Proportional resize
+ * Proportional resize.
*
* @var bool
*/
protected $resizeProportional;
/**
- * Create a new HeaderFooterDrawing
+ * Create a new HeaderFooterDrawing.
*/
public function __construct()
{
@@ -90,7 +91,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Name
+ * Get Name.
*
* @return string
*/
@@ -100,9 +101,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set Name
+ * Set Name.
*
* @param string $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setName($pValue = '')
@@ -113,7 +115,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get OffsetX
+ * Get OffsetX.
*
* @return int
*/
@@ -123,9 +125,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set OffsetX
+ * Set OffsetX.
*
* @param int $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setOffsetX($pValue = 0)
@@ -136,7 +139,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get OffsetY
+ * Get OffsetY.
*
* @return int
*/
@@ -146,9 +149,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set OffsetY
+ * Set OffsetY.
*
* @param int $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setOffsetY($pValue = 0)
@@ -159,7 +163,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Width
+ * Get Width.
*
* @return int
*/
@@ -169,9 +173,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set Width
+ * Set Width.
*
* @param int $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setWidth($pValue = 0)
@@ -189,7 +194,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Height
+ * Get Height.
*
* @return int
*/
@@ -199,9 +204,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set Height
+ * Set Height.
*
* @param int $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setHeight($pValue = 0)
@@ -224,11 +230,13 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
*
* $objDrawing->setResizeProportional(true);
* $objDrawing->setWidthAndHeight(160,120);
- *
+ * .
*
* @author Vincent@luo MSN:kele_100@hotmail.com
+ *
* @param int $width
* @param int $height
+ *
* @return HeaderFooterDrawing
*/
public function setWidthAndHeight($width = 0, $height = 0)
@@ -249,7 +257,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get ResizeProportional
+ * Get ResizeProportional.
*
* @return bool
*/
@@ -259,9 +267,10 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set ResizeProportional
+ * Set ResizeProportional.
*
* @param bool $pValue
+ *
* @return HeaderFooterDrawing
*/
public function setResizeProportional($pValue = true)
@@ -272,7 +281,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Filename
+ * Get Filename.
*
* @return string
*/
@@ -282,7 +291,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Extension
+ * Get Extension.
*
* @return string
*/
@@ -294,7 +303,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get Path
+ * Get Path.
*
* @return string
*/
@@ -304,11 +313,13 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Set Path
+ * Set Path.
*
* @param string $pValue File path
* @param bool $pVerifyFile Verify file
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return HeaderFooterDrawing
*/
public function setPath($pValue = '', $pVerifyFile = true)
@@ -332,7 +343,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Worksheet/Iterator.php b/src/PhpSpreadsheet/Worksheet/Iterator.php
index bc620986..03fe44f8 100644
--- a/src/PhpSpreadsheet/Worksheet/Iterator.php
+++ b/src/PhpSpreadsheet/Worksheet/Iterator.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,27 +20,28 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Iterator implements \Iterator
{
/**
- * Spreadsheet to iterate
+ * Spreadsheet to iterate.
*
* @var \PhpOffice\PhpSpreadsheet\Spreadsheet
*/
private $subject;
/**
- * Current iterator position
+ * Current iterator position.
*
* @var int
*/
private $position = 0;
/**
- * Create a new worksheet iterator
+ * Create a new worksheet iterator.
*
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $subject
*/
@@ -51,7 +52,7 @@ class Iterator implements \Iterator
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -59,7 +60,7 @@ class Iterator implements \Iterator
}
/**
- * Rewind iterator
+ * Rewind iterator.
*/
public function rewind()
{
@@ -67,7 +68,7 @@ class Iterator implements \Iterator
}
/**
- * Current Worksheet
+ * Current Worksheet.
*
* @return \PhpOffice\PhpSpreadsheet\Worksheet
*/
@@ -77,7 +78,7 @@ class Iterator implements \Iterator
}
/**
- * Current key
+ * Current key.
*
* @return int
*/
@@ -87,7 +88,7 @@ class Iterator implements \Iterator
}
/**
- * Next value
+ * Next value.
*/
public function next()
{
diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
index 6f8aff74..5267d72c 100644
--- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
+++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -38,35 +39,35 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
const MIMETYPE_JPEG = 'image/jpeg';
/**
- * Image resource
+ * Image resource.
*
* @var resource
*/
private $imageResource;
/**
- * Rendering function
+ * Rendering function.
*
* @var string
*/
private $renderingFunction;
/**
- * Mime type
+ * Mime type.
*
* @var string
*/
private $mimeType;
/**
- * Unique name
+ * Unique name.
*
* @var string
*/
private $uniqueName;
/**
- * Create a new MemoryDrawing
+ * Create a new MemoryDrawing.
*/
public function __construct()
{
@@ -81,7 +82,7 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Get image resource
+ * Get image resource.
*
* @return resource
*/
@@ -91,9 +92,10 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Set image resource
+ * Set image resource.
*
* @param $value resource
+ *
* @return MemoryDrawing
*/
public function setImageResource($value = null)
@@ -110,7 +112,7 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Get rendering function
+ * Get rendering function.
*
* @return string
*/
@@ -120,9 +122,10 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Set rendering function
+ * Set rendering function.
*
* @param string $value
+ *
* @return MemoryDrawing
*/
public function setRenderingFunction($value = self::RENDERING_DEFAULT)
@@ -133,7 +136,7 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Get mime type
+ * Get mime type.
*
* @return string
*/
@@ -143,9 +146,10 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Set mime type
+ * Set mime type.
*
* @param string $value
+ *
* @return MemoryDrawing
*/
public function setMimeType($value = self::MIMETYPE_DEFAULT)
@@ -156,7 +160,7 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Get indexed filename (using image index)
+ * Get indexed filename (using image index).
*
* @return string
*/
@@ -170,7 +174,7 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
}
/**
- * Get hash code
+ * Get hash code.
*
* @return string Hash code
*/
diff --git a/src/PhpSpreadsheet/Worksheet/PageMargins.php b/src/PhpSpreadsheet/Worksheet/PageMargins.php
index ae90c065..9aa51665 100644
--- a/src/PhpSpreadsheet/Worksheet/PageMargins.php
+++ b/src/PhpSpreadsheet/Worksheet/PageMargins.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,62 +20,63 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class PageMargins
{
/**
- * Left
+ * Left.
*
* @var float
*/
private $left = 0.7;
/**
- * Right
+ * Right.
*
* @var float
*/
private $right = 0.7;
/**
- * Top
+ * Top.
*
* @var float
*/
private $top = 0.75;
/**
- * Bottom
+ * Bottom.
*
* @var float
*/
private $bottom = 0.75;
/**
- * Header
+ * Header.
*
* @var float
*/
private $header = 0.3;
/**
- * Footer
+ * Footer.
*
* @var float
*/
private $footer = 0.3;
/**
- * Create a new PageMargins
+ * Create a new PageMargins.
*/
public function __construct()
{
}
/**
- * Get Left
+ * Get Left.
*
* @return float
*/
@@ -85,9 +86,10 @@ class PageMargins
}
/**
- * Set Left
+ * Set Left.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setLeft($pValue)
@@ -98,7 +100,7 @@ class PageMargins
}
/**
- * Get Right
+ * Get Right.
*
* @return float
*/
@@ -108,9 +110,10 @@ class PageMargins
}
/**
- * Set Right
+ * Set Right.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setRight($pValue)
@@ -121,7 +124,7 @@ class PageMargins
}
/**
- * Get Top
+ * Get Top.
*
* @return float
*/
@@ -131,9 +134,10 @@ class PageMargins
}
/**
- * Set Top
+ * Set Top.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setTop($pValue)
@@ -144,7 +148,7 @@ class PageMargins
}
/**
- * Get Bottom
+ * Get Bottom.
*
* @return float
*/
@@ -154,9 +158,10 @@ class PageMargins
}
/**
- * Set Bottom
+ * Set Bottom.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setBottom($pValue)
@@ -167,7 +172,7 @@ class PageMargins
}
/**
- * Get Header
+ * Get Header.
*
* @return float
*/
@@ -177,9 +182,10 @@ class PageMargins
}
/**
- * Set Header
+ * Set Header.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setHeader($pValue)
@@ -190,7 +196,7 @@ class PageMargins
}
/**
- * Get Footer
+ * Get Footer.
*
* @return float
*/
@@ -200,9 +206,10 @@ class PageMargins
}
/**
- * Set Footer
+ * Set Footer.
*
* @param float $pValue
+ *
* @return PageMargins
*/
public function setFooter($pValue)
diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php
index 21cb2c47..6503afde 100644
--- a/src/PhpSpreadsheet/Worksheet/PageSetup.php
+++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*
@@ -95,6 +96,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
*
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
*/
class PageSetup
@@ -177,21 +179,21 @@ class PageSetup
const SETPRINTRANGE_INSERT = 'I';
/**
- * Paper size
+ * Paper size.
*
* @var int
*/
private $paperSize = self::PAPERSIZE_LETTER;
/**
- * Orientation
+ * Orientation.
*
* @var string
*/
private $orientation = self::ORIENTATION_DEFAULT;
/**
- * Scale (Print Scale)
+ * Scale (Print Scale).
*
* Print scaling. Valid values range from 10 to 400
* This setting is overridden when fitToWidth and/or fitToHeight are in use
@@ -202,7 +204,7 @@ class PageSetup
/**
* Fit To Page
- * Whether scale or fitToWith / fitToHeight applies
+ * Whether scale or fitToWith / fitToHeight applies.
*
* @var bool
*/
@@ -210,7 +212,7 @@ class PageSetup
/**
* Fit To Height
- * Number of vertical pages to fit on
+ * Number of vertical pages to fit on.
*
* @var int?
*/
@@ -218,63 +220,63 @@ class PageSetup
/**
* Fit To Width
- * Number of horizontal pages to fit on
+ * Number of horizontal pages to fit on.
*
* @var int?
*/
private $fitToWidth = 1;
/**
- * Columns to repeat at left
+ * Columns to repeat at left.
*
* @var array Containing start column and end column, empty array if option unset
*/
private $columnsToRepeatAtLeft = ['', ''];
/**
- * Rows to repeat at top
+ * Rows to repeat at top.
*
* @var array Containing start row number and end row number, empty array if option unset
*/
private $rowsToRepeatAtTop = [0, 0];
/**
- * Center page horizontally
+ * Center page horizontally.
*
* @var bool
*/
private $horizontalCentered = false;
/**
- * Center page vertically
+ * Center page vertically.
*
* @var bool
*/
private $verticalCentered = false;
/**
- * Print area
+ * Print area.
*
* @var string
*/
private $printArea = null;
/**
- * First page number
+ * First page number.
*
* @var int
*/
private $firstPageNumber = null;
/**
- * Create a new PageSetup
+ * Create a new PageSetup.
*/
public function __construct()
{
}
/**
- * Get Paper Size
+ * Get Paper Size.
*
* @return int
*/
@@ -284,9 +286,10 @@ class PageSetup
}
/**
- * Set Paper Size
+ * Set Paper Size.
*
* @param int $pValue
+ *
* @return PageSetup
*/
public function setPaperSize($pValue = self::PAPERSIZE_LETTER)
@@ -297,7 +300,7 @@ class PageSetup
}
/**
- * Get Orientation
+ * Get Orientation.
*
* @return string
*/
@@ -307,9 +310,10 @@ class PageSetup
}
/**
- * Set Orientation
+ * Set Orientation.
*
* @param string $pValue
+ *
* @return PageSetup
*/
public function setOrientation($pValue = self::ORIENTATION_DEFAULT)
@@ -320,7 +324,7 @@ class PageSetup
}
/**
- * Get Scale
+ * Get Scale.
*
* @return int?
*/
@@ -330,14 +334,16 @@ class PageSetup
}
/**
- * Set Scale
+ * Set Scale.
*
* Print scaling. Valid values range from 10 to 400
* This setting is overridden when fitToWidth and/or fitToHeight are in use
*
* @param int? $pValue
* @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return PageSetup
*/
public function setScale($pValue = 100, $pUpdate = true)
@@ -357,7 +363,7 @@ class PageSetup
}
/**
- * Get Fit To Page
+ * Get Fit To Page.
*
* @return bool
*/
@@ -367,9 +373,10 @@ class PageSetup
}
/**
- * Set Fit To Page
+ * Set Fit To Page.
*
* @param bool $pValue
+ *
* @return PageSetup
*/
public function setFitToPage($pValue = true)
@@ -380,7 +387,7 @@ class PageSetup
}
/**
- * Get Fit To Height
+ * Get Fit To Height.
*
* @return int?
*/
@@ -390,10 +397,11 @@ class PageSetup
}
/**
- * Set Fit To Height
+ * Set Fit To Height.
*
* @param int? $pValue
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
+ *
* @return PageSetup
*/
public function setFitToHeight($pValue = 1, $pUpdate = true)
@@ -407,7 +415,7 @@ class PageSetup
}
/**
- * Get Fit To Width
+ * Get Fit To Width.
*
* @return int?
*/
@@ -417,10 +425,11 @@ class PageSetup
}
/**
- * Set Fit To Width
+ * Set Fit To Width.
*
* @param int? $pValue
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
+ *
* @return PageSetup
*/
public function setFitToWidth($pValue = 1, $pUpdate = true)
@@ -450,7 +459,7 @@ class PageSetup
}
/**
- * Get Columns to repeat at left
+ * Get Columns to repeat at left.
*
* @return array Containing start column and end column, empty array if option unset
*/
@@ -460,9 +469,10 @@ class PageSetup
}
/**
- * Set Columns to repeat at left
+ * Set Columns to repeat at left.
*
* @param array $pValue Containing start column and end column, empty array if option unset
+ *
* @return PageSetup
*/
public function setColumnsToRepeatAtLeft($pValue = null)
@@ -475,10 +485,11 @@ class PageSetup
}
/**
- * Set Columns to repeat at left by start and end
+ * Set Columns to repeat at left by start and end.
*
* @param string $pStart
* @param string $pEnd
+ *
* @return PageSetup
*/
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A')
@@ -505,7 +516,7 @@ class PageSetup
}
/**
- * Get Rows to repeat at top
+ * Get Rows to repeat at top.
*
* @return array Containing start column and end column, empty array if option unset
*/
@@ -515,9 +526,10 @@ class PageSetup
}
/**
- * Set Rows to repeat at top
+ * Set Rows to repeat at top.
*
* @param array $pValue Containing start column and end column, empty array if option unset
+ *
* @return PageSetup
*/
public function setRowsToRepeatAtTop($pValue = null)
@@ -530,10 +542,11 @@ class PageSetup
}
/**
- * Set Rows to repeat at top by start and end
+ * Set Rows to repeat at top by start and end.
*
* @param int $pStart
* @param int $pEnd
+ *
* @return PageSetup
*/
public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1)
@@ -544,7 +557,7 @@ class PageSetup
}
/**
- * Get center page horizontally
+ * Get center page horizontally.
*
* @return bool
*/
@@ -554,9 +567,10 @@ class PageSetup
}
/**
- * Set center page horizontally
+ * Set center page horizontally.
*
* @param bool $value
+ *
* @return PageSetup
*/
public function setHorizontalCentered($value = false)
@@ -567,7 +581,7 @@ class PageSetup
}
/**
- * Get center page vertically
+ * Get center page vertically.
*
* @return bool
*/
@@ -577,9 +591,10 @@ class PageSetup
}
/**
- * Set center page vertically
+ * Set center page vertically.
*
* @param bool $value
+ *
* @return PageSetup
*/
public function setVerticalCentered($value = false)
@@ -590,13 +605,15 @@ class PageSetup
}
/**
- * Get print area
+ * Get print area.
*
* @param int $index Identifier for a specific print area range if several ranges have been set
* Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
* Otherwise, the specific range identified by the value of $index will be returned
* Print areas are numbered from 1
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return string
*/
public function getPrintArea($index = 0)
@@ -618,6 +635,7 @@ class PageSetup
* Default behaviour, or an index value of 0, will identify whether any print range is set
* Otherwise, existence of the range identified by the value of $index will be returned
* Print areas are numbered from 1
+ *
* @return bool
*/
public function isPrintAreaSet($index = 0)
@@ -631,12 +649,13 @@ class PageSetup
}
/**
- * Clear a print area
+ * Clear a print area.
*
* @param int $index Identifier for a specific print area range if several ranges have been set
* Default behaviour, or an index value of 0, will clear all print ranges that are set
* Otherwise, the range identified by the value of $index will be removed from the series
* Print areas are numbered from 1
+ *
* @return PageSetup
*/
public function clearPrintArea($index = 0)
@@ -655,7 +674,7 @@ class PageSetup
}
/**
- * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'
+ * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'.
*
* @param string $value
* @param int $index Identifier for a specific print area range allowing several ranges to be set
@@ -671,7 +690,9 @@ class PageSetup
* @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return PageSetup
*/
public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
@@ -721,7 +742,7 @@ class PageSetup
}
/**
- * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas
+ * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas.
*
* @param string $value
* @param int $index Identifier for a specific print area range allowing several ranges to be set
@@ -730,7 +751,9 @@ class PageSetup
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return PageSetup
*/
public function addPrintArea($value, $index = -1)
@@ -739,7 +762,7 @@ class PageSetup
}
/**
- * Set print area
+ * Set print area.
*
* @param int $column1 Column 1
* @param int $row1 Row 1
@@ -758,7 +781,9 @@ class PageSetup
* @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return PageSetup
*/
public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
@@ -771,7 +796,7 @@ class PageSetup
}
/**
- * Add a new print area to the list of print areas
+ * Add a new print area to the list of print areas.
*
* @param int $column1 Start Column for the print area
* @param int $row1 Start Row for the print area
@@ -783,7 +808,9 @@ class PageSetup
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return PageSetup
*/
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
@@ -796,7 +823,7 @@ class PageSetup
}
/**
- * Get first page number
+ * Get first page number.
*
* @return int
*/
@@ -806,9 +833,10 @@ class PageSetup
}
/**
- * Set first page number
+ * Set first page number.
*
* @param int $value
+ *
* @return PageSetup
*/
public function setFirstPageNumber($value = null)
@@ -819,7 +847,7 @@ class PageSetup
}
/**
- * Reset first page number
+ * Reset first page number.
*
* @return PageSetup
*/
diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php
index 5bf83e72..f619cf59 100644
--- a/src/PhpSpreadsheet/Worksheet/Protection.php
+++ b/src/PhpSpreadsheet/Worksheet/Protection.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,132 +20,133 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Protection
{
/**
- * Sheet
+ * Sheet.
*
* @var bool
*/
private $sheet = false;
/**
- * Objects
+ * Objects.
*
* @var bool
*/
private $objects = false;
/**
- * Scenarios
+ * Scenarios.
*
* @var bool
*/
private $scenarios = false;
/**
- * Format cells
+ * Format cells.
*
* @var bool
*/
private $formatCells = false;
/**
- * Format columns
+ * Format columns.
*
* @var bool
*/
private $formatColumns = false;
/**
- * Format rows
+ * Format rows.
*
* @var bool
*/
private $formatRows = false;
/**
- * Insert columns
+ * Insert columns.
*
* @var bool
*/
private $insertColumns = false;
/**
- * Insert rows
+ * Insert rows.
*
* @var bool
*/
private $insertRows = false;
/**
- * Insert hyperlinks
+ * Insert hyperlinks.
*
* @var bool
*/
private $insertHyperlinks = false;
/**
- * Delete columns
+ * Delete columns.
*
* @var bool
*/
private $deleteColumns = false;
/**
- * Delete rows
+ * Delete rows.
*
* @var bool
*/
private $deleteRows = false;
/**
- * Select locked cells
+ * Select locked cells.
*
* @var bool
*/
private $selectLockedCells = false;
/**
- * Sort
+ * Sort.
*
* @var bool
*/
private $sort = false;
/**
- * AutoFilter
+ * AutoFilter.
*
* @var bool
*/
private $autoFilter = false;
/**
- * Pivot tables
+ * Pivot tables.
*
* @var bool
*/
private $pivotTables = false;
/**
- * Select unlocked cells
+ * Select unlocked cells.
*
* @var bool
*/
private $selectUnlockedCells = false;
/**
- * Password
+ * Password.
*
* @var string
*/
private $password = '';
/**
- * Create a new Protection
+ * Create a new Protection.
*/
public function __construct()
{
@@ -177,7 +178,7 @@ class Protection
}
/**
- * Get Sheet
+ * Get Sheet.
*
* @return bool
*/
@@ -187,9 +188,10 @@ class Protection
}
/**
- * Set Sheet
+ * Set Sheet.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setSheet($pValue = false)
@@ -200,7 +202,7 @@ class Protection
}
/**
- * Get Objects
+ * Get Objects.
*
* @return bool
*/
@@ -210,9 +212,10 @@ class Protection
}
/**
- * Set Objects
+ * Set Objects.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setObjects($pValue = false)
@@ -223,7 +226,7 @@ class Protection
}
/**
- * Get Scenarios
+ * Get Scenarios.
*
* @return bool
*/
@@ -233,9 +236,10 @@ class Protection
}
/**
- * Set Scenarios
+ * Set Scenarios.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setScenarios($pValue = false)
@@ -246,7 +250,7 @@ class Protection
}
/**
- * Get FormatCells
+ * Get FormatCells.
*
* @return bool
*/
@@ -256,9 +260,10 @@ class Protection
}
/**
- * Set FormatCells
+ * Set FormatCells.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setFormatCells($pValue = false)
@@ -269,7 +274,7 @@ class Protection
}
/**
- * Get FormatColumns
+ * Get FormatColumns.
*
* @return bool
*/
@@ -279,9 +284,10 @@ class Protection
}
/**
- * Set FormatColumns
+ * Set FormatColumns.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setFormatColumns($pValue = false)
@@ -292,7 +298,7 @@ class Protection
}
/**
- * Get FormatRows
+ * Get FormatRows.
*
* @return bool
*/
@@ -302,9 +308,10 @@ class Protection
}
/**
- * Set FormatRows
+ * Set FormatRows.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setFormatRows($pValue = false)
@@ -315,7 +322,7 @@ class Protection
}
/**
- * Get InsertColumns
+ * Get InsertColumns.
*
* @return bool
*/
@@ -325,9 +332,10 @@ class Protection
}
/**
- * Set InsertColumns
+ * Set InsertColumns.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setInsertColumns($pValue = false)
@@ -338,7 +346,7 @@ class Protection
}
/**
- * Get InsertRows
+ * Get InsertRows.
*
* @return bool
*/
@@ -348,9 +356,10 @@ class Protection
}
/**
- * Set InsertRows
+ * Set InsertRows.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setInsertRows($pValue = false)
@@ -361,7 +370,7 @@ class Protection
}
/**
- * Get InsertHyperlinks
+ * Get InsertHyperlinks.
*
* @return bool
*/
@@ -371,9 +380,10 @@ class Protection
}
/**
- * Set InsertHyperlinks
+ * Set InsertHyperlinks.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setInsertHyperlinks($pValue = false)
@@ -384,7 +394,7 @@ class Protection
}
/**
- * Get DeleteColumns
+ * Get DeleteColumns.
*
* @return bool
*/
@@ -394,9 +404,10 @@ class Protection
}
/**
- * Set DeleteColumns
+ * Set DeleteColumns.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setDeleteColumns($pValue = false)
@@ -407,7 +418,7 @@ class Protection
}
/**
- * Get DeleteRows
+ * Get DeleteRows.
*
* @return bool
*/
@@ -417,9 +428,10 @@ class Protection
}
/**
- * Set DeleteRows
+ * Set DeleteRows.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setDeleteRows($pValue = false)
@@ -430,7 +442,7 @@ class Protection
}
/**
- * Get SelectLockedCells
+ * Get SelectLockedCells.
*
* @return bool
*/
@@ -440,9 +452,10 @@ class Protection
}
/**
- * Set SelectLockedCells
+ * Set SelectLockedCells.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setSelectLockedCells($pValue = false)
@@ -453,7 +466,7 @@ class Protection
}
/**
- * Get Sort
+ * Get Sort.
*
* @return bool
*/
@@ -463,9 +476,10 @@ class Protection
}
/**
- * Set Sort
+ * Set Sort.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setSort($pValue = false)
@@ -476,7 +490,7 @@ class Protection
}
/**
- * Get AutoFilter
+ * Get AutoFilter.
*
* @return bool
*/
@@ -486,9 +500,10 @@ class Protection
}
/**
- * Set AutoFilter
+ * Set AutoFilter.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setAutoFilter($pValue = false)
@@ -499,7 +514,7 @@ class Protection
}
/**
- * Get PivotTables
+ * Get PivotTables.
*
* @return bool
*/
@@ -509,9 +524,10 @@ class Protection
}
/**
- * Set PivotTables
+ * Set PivotTables.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setPivotTables($pValue = false)
@@ -522,7 +538,7 @@ class Protection
}
/**
- * Get SelectUnlockedCells
+ * Get SelectUnlockedCells.
*
* @return bool
*/
@@ -532,9 +548,10 @@ class Protection
}
/**
- * Set SelectUnlockedCells
+ * Set SelectUnlockedCells.
*
* @param bool $pValue
+ *
* @return Protection
*/
public function setSelectUnlockedCells($pValue = false)
@@ -545,7 +562,7 @@ class Protection
}
/**
- * Get Password (hashed)
+ * Get Password (hashed).
*
* @return string
*/
@@ -555,10 +572,11 @@ class Protection
}
/**
- * Set Password
+ * Set Password.
*
* @param string $pValue
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
* @return Protection
*/
public function setPassword($pValue = '', $pAlreadyHashed = false)
diff --git a/src/PhpSpreadsheet/Worksheet/Row.php b/src/PhpSpreadsheet/Worksheet/Row.php
index e7fe6427..b546d808 100644
--- a/src/PhpSpreadsheet/Worksheet/Row.php
+++ b/src/PhpSpreadsheet/Worksheet/Row.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,27 +20,28 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Row
{
/**
- * \PhpOffice\PhpSpreadsheet\Worksheet
+ * \PhpOffice\PhpSpreadsheet\Worksheet.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
private $parent;
/**
- * Row index
+ * Row index.
*
* @var int
*/
private $rowIndex = 0;
/**
- * Create a new row
+ * Create a new row.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent
* @param int $rowIndex
@@ -53,7 +54,7 @@ class Row
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -61,7 +62,7 @@ class Row
}
/**
- * Get row index
+ * Get row index.
*
* @return int
*/
@@ -71,10 +72,11 @@ class Row
}
/**
- * Get cell iterator
+ * Get cell iterator.
*
* @param string $startColumn The column address at which to start iterating
* @param string $endColumn Optionally, the column address at which to stop iterating
+ *
* @return RowCellIterator
*/
public function getCellIterator($startColumn = 'A', $endColumn = null)
diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
index 108353fb..813e708d 100644
--- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
+++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,34 +20,35 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class RowCellIterator extends CellIterator implements \Iterator
{
/**
- * Row index
+ * Row index.
*
* @var int
*/
protected $rowIndex;
/**
- * Start position
+ * Start position.
*
* @var int
*/
protected $startColumn = 0;
/**
- * End position
+ * End position.
*
* @var int
*/
protected $endColumn = 0;
/**
- * Create a new column iterator
+ * Create a new column iterator.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $subject The worksheet to iterate over
* @param int $rowIndex The row that we want to iterate
@@ -64,7 +65,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -72,10 +73,12 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * (Re)Set the start column and the current column pointer
+ * (Re)Set the start column and the current column pointer.
*
* @param int $startColumn The column address at which to start iterating
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return RowCellIterator
*/
public function resetStart($startColumn = 'A')
@@ -89,10 +92,12 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * (Re)Set the end column
+ * (Re)Set the end column.
*
* @param string $endColumn The column address at which to stop iterating
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return RowCellIterator
*/
public function resetEnd($endColumn = null)
@@ -105,10 +110,12 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the column pointer to the selected column
+ * Set the column pointer to the selected column.
*
* @param string $column The column address to set the current pointer at
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return RowCellIterator
*/
public function seek($column = 'A')
@@ -125,7 +132,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Rewind the iterator to the starting column
+ * Rewind the iterator to the starting column.
*/
public function rewind()
{
@@ -133,7 +140,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Return the current cell in this worksheet row
+ * Return the current cell in this worksheet row.
*
* @return \PhpOffice\PhpSpreadsheet\Cell
*/
@@ -143,7 +150,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Return the current iterator key
+ * Return the current iterator key.
*
* @return string
*/
@@ -153,7 +160,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the iterator to its next value
+ * Set the iterator to its next value.
*/
public function next()
{
@@ -165,7 +172,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Set the iterator to its previous value
+ * Set the iterator to its previous value.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -187,7 +194,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Indicate if more columns exist in the worksheet range of columns that we're iterating
+ * Indicate if more columns exist in the worksheet range of columns that we're iterating.
*
* @return bool
*/
@@ -197,7 +204,7 @@ class RowCellIterator extends CellIterator implements \Iterator
}
/**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php
index 8118db2b..60097dcc 100644
--- a/src/PhpSpreadsheet/Worksheet/RowDimension.php
+++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,20 +20,21 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class RowDimension extends Dimension
{
/**
- * Row index
+ * Row index.
*
* @var int
*/
private $rowIndex;
/**
- * Row height (in pt)
+ * Row height (in pt).
*
* When this is set to a negative value, the row height should be ignored by IWriter
*
@@ -49,7 +50,7 @@ class RowDimension extends Dimension
private $zeroHeight = false;
/**
- * Create a new RowDimension
+ * Create a new RowDimension.
*
* @param int $pIndex Numeric row index
*/
@@ -63,7 +64,7 @@ class RowDimension extends Dimension
}
/**
- * Get Row Index
+ * Get Row Index.
*
* @return int
*/
@@ -73,9 +74,10 @@ class RowDimension extends Dimension
}
/**
- * Set Row Index
+ * Set Row Index.
*
* @param int $pValue
+ *
* @return RowDimension
*/
public function setRowIndex($pValue)
@@ -86,7 +88,7 @@ class RowDimension extends Dimension
}
/**
- * Get Row Height
+ * Get Row Height.
*
* @return float
*/
@@ -96,9 +98,10 @@ class RowDimension extends Dimension
}
/**
- * Set Row Height
+ * Set Row Height.
*
* @param float $pValue
+ *
* @return RowDimension
*/
public function setRowHeight($pValue = -1)
@@ -109,7 +112,7 @@ class RowDimension extends Dimension
}
/**
- * Get ZeroHeight
+ * Get ZeroHeight.
*
* @return bool
*/
@@ -119,9 +122,10 @@ class RowDimension extends Dimension
}
/**
- * Set ZeroHeight
+ * Set ZeroHeight.
*
* @param bool $pValue
+ *
* @return RowDimension
*/
public function setZeroHeight($pValue = false)
diff --git a/src/PhpSpreadsheet/Worksheet/RowIterator.php b/src/PhpSpreadsheet/Worksheet/RowIterator.php
index 91821d5d..e0077ca7 100644
--- a/src/PhpSpreadsheet/Worksheet/RowIterator.php
+++ b/src/PhpSpreadsheet/Worksheet/RowIterator.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,41 +20,42 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class RowIterator implements \Iterator
{
/**
- * \PhpOffice\PhpSpreadsheet\Worksheet to iterate
+ * \PhpOffice\PhpSpreadsheet\Worksheet to iterate.
*
* @var \PhpOffice\PhpSpreadsheet\Worksheet
*/
private $subject;
/**
- * Current iterator position
+ * Current iterator position.
*
* @var int
*/
private $position = 1;
/**
- * Start position
+ * Start position.
*
* @var int
*/
private $startRow = 1;
/**
- * End position
+ * End position.
*
* @var int
*/
private $endRow = 1;
/**
- * Create a new row iterator
+ * Create a new row iterator.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $subject The worksheet to iterate over
* @param int $startRow The row number at which to start iterating
@@ -69,7 +70,7 @@ class RowIterator implements \Iterator
}
/**
- * Destructor
+ * Destructor.
*/
public function __destruct()
{
@@ -77,10 +78,12 @@ class RowIterator implements \Iterator
}
/**
- * (Re)Set the start row and the current row pointer
+ * (Re)Set the start row and the current row pointer.
*
* @param int $startRow The row number at which to start iterating
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return RowIterator
*/
public function resetStart($startRow = 1)
@@ -99,9 +102,10 @@ class RowIterator implements \Iterator
}
/**
- * (Re)Set the end row
+ * (Re)Set the end row.
*
* @param int $endRow The row number at which to stop iterating
+ *
* @return RowIterator
*/
public function resetEnd($endRow = null)
@@ -112,10 +116,12 @@ class RowIterator implements \Iterator
}
/**
- * Set the row pointer to the selected row
+ * Set the row pointer to the selected row.
*
* @param int $row The row number to set the current pointer at
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return RowIterator
*/
public function seek($row = 1)
@@ -129,7 +135,7 @@ class RowIterator implements \Iterator
}
/**
- * Rewind the iterator to the starting row
+ * Rewind the iterator to the starting row.
*/
public function rewind()
{
@@ -137,7 +143,7 @@ class RowIterator implements \Iterator
}
/**
- * Return the current row in this worksheet
+ * Return the current row in this worksheet.
*
* @return Row
*/
@@ -147,7 +153,7 @@ class RowIterator implements \Iterator
}
/**
- * Return the current iterator key
+ * Return the current iterator key.
*
* @return int
*/
@@ -157,7 +163,7 @@ class RowIterator implements \Iterator
}
/**
- * Set the iterator to its next value
+ * Set the iterator to its next value.
*/
public function next()
{
@@ -165,7 +171,7 @@ class RowIterator implements \Iterator
}
/**
- * Set the iterator to its previous value
+ * Set the iterator to its previous value.
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
@@ -179,7 +185,7 @@ class RowIterator implements \Iterator
}
/**
- * Indicate if more rows exist in the worksheet range of rows that we're iterating
+ * Indicate if more rows exist in the worksheet range of rows that we're iterating.
*
* @return bool
*/
diff --git a/src/PhpSpreadsheet/Worksheet/SheetView.php b/src/PhpSpreadsheet/Worksheet/SheetView.php
index 5dd6f6a7..8ac4849f 100644
--- a/src/PhpSpreadsheet/Worksheet/SheetView.php
+++ b/src/PhpSpreadsheet/Worksheet/SheetView.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Worksheet;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -37,7 +38,7 @@ class SheetView
];
/**
- * ZoomScale
+ * ZoomScale.
*
* Valid values range from 10 to 400.
*
@@ -46,7 +47,7 @@ class SheetView
private $zoomScale = 100;
/**
- * ZoomScaleNormal
+ * ZoomScaleNormal.
*
* Valid values range from 10 to 400.
*
@@ -55,7 +56,7 @@ class SheetView
private $zoomScaleNormal = 100;
/**
- * View
+ * View.
*
* Valid values range from 10 to 400.
*
@@ -64,14 +65,14 @@ class SheetView
private $sheetviewType = self::SHEETVIEW_NORMAL;
/**
- * Create a new SheetView
+ * Create a new SheetView.
*/
public function __construct()
{
}
/**
- * Get ZoomScale
+ * Get ZoomScale.
*
* @return int
*/
@@ -81,12 +82,14 @@ class SheetView
}
/**
- * Set ZoomScale
+ * Set ZoomScale.
*
* Valid values range from 10 to 400.
*
* @param int $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return SheetView
*/
public function setZoomScale($pValue = 100)
@@ -103,7 +106,7 @@ class SheetView
}
/**
- * Get ZoomScaleNormal
+ * Get ZoomScaleNormal.
*
* @return int
*/
@@ -113,12 +116,14 @@ class SheetView
}
/**
- * Set ZoomScale
+ * Set ZoomScale.
*
* Valid values range from 10 to 400.
*
* @param int $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return SheetView
*/
public function setZoomScaleNormal($pValue = 100)
@@ -133,7 +138,7 @@ class SheetView
}
/**
- * Get View
+ * Get View.
*
* @return string
*/
@@ -143,7 +148,7 @@ class SheetView
}
/**
- * Set View
+ * Set View.
*
* Valid values are
* 'normal' self::SHEETVIEW_NORMAL
@@ -151,7 +156,9 @@ class SheetView
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
*
* @param string $pValue
+ *
* @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
* @return SheetView
*/
public function setView($pValue = null)
diff --git a/src/PhpSpreadsheet/Writer/BaseWriter.php b/src/PhpSpreadsheet/Writer/BaseWriter.php
index 017bb481..05821181 100644
--- a/src/PhpSpreadsheet/Writer/BaseWriter.php
+++ b/src/PhpSpreadsheet/Writer/BaseWriter.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Writer;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
@@ -27,7 +28,7 @@ abstract class BaseWriter implements IWriter
{
/**
* Write charts that are defined in the workbook?
- * Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object;
+ * Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object;.
*
* @var bool
*/
@@ -36,7 +37,7 @@ abstract class BaseWriter implements IWriter
/**
* Pre-calculate formulas
* Forces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are
- * immediately available to MS Excel or other office spreadsheet viewer when opening the file
+ * immediately available to MS Excel or other office spreadsheet viewer when opening the file.
*
* @var bool
*/
@@ -50,7 +51,7 @@ abstract class BaseWriter implements IWriter
protected $_useDiskCaching = false;
/**
- * Disk caching directory
+ * Disk caching directory.
*
* @var string
*/
@@ -74,11 +75,12 @@ abstract class BaseWriter implements IWriter
* Set to false (the default) to ignore charts.
*
* @param bool $pValue
+ *
* @return IWriter
*/
public function setIncludeCharts($pValue = false)
{
- $this->includeCharts = (boolean) $pValue;
+ $this->includeCharts = (bool) $pValue;
return $this;
}
@@ -89,7 +91,7 @@ abstract class BaseWriter implements IWriter
* so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet
* viewer when opening the file
* If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower
- * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself
+ * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.
*
* @return bool
*/
@@ -104,11 +106,12 @@ abstract class BaseWriter implements IWriter
* Set to false to prevent precalculation of formulae on save.
*
* @param bool $pValue Pre-Calculate Formulas?
+ *
* @return IWriter
*/
public function setPreCalculateFormulas($pValue = true)
{
- $this->preCalculateFormulas = (boolean) $pValue;
+ $this->preCalculateFormulas = (bool) $pValue;
return $this;
}
@@ -128,7 +131,9 @@ abstract class BaseWriter implements IWriter
*
* @param bool $pValue
* @param string $pDirectory Disk caching directory
+ *
* @throws Exception when directory does not exist
+ *
* @return IWriter
*/
public function setUseDiskCaching($pValue = false, $pDirectory = null)
@@ -147,7 +152,7 @@ abstract class BaseWriter implements IWriter
}
/**
- * Get disk caching directory
+ * Get disk caching directory.
*
* @return string
*/
diff --git a/src/PhpSpreadsheet/Writer/CSV.php b/src/PhpSpreadsheet/Writer/CSV.php
index e5fde94a..84e0e1a2 100644
--- a/src/PhpSpreadsheet/Writer/CSV.php
+++ b/src/PhpSpreadsheet/Writer/CSV.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Writer;
/**
- * Copyright (c) 2006 - 2016 PhpSpreadsheet
+ * Copyright (c) 2006 - 2016 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,41 +20,42 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class CSV extends BaseWriter implements IWriter
{
/**
- * PhpSpreadsheet object
+ * PhpSpreadsheet object.
*
* @var PhpSpreadsheet
*/
private $spreadsheet;
/**
- * Delimiter
+ * Delimiter.
*
* @var string
*/
private $delimiter = ',';
/**
- * Enclosure
+ * Enclosure.
*
* @var string
*/
private $enclosure = '"';
/**
- * Line ending
+ * Line ending.
*
* @var string
*/
private $lineEnding = PHP_EOL;
/**
- * Sheet index to write
+ * Sheet index to write.
*
* @var int
*/
@@ -69,7 +70,7 @@ class CSV extends BaseWriter implements IWriter
/**
* Whether to write a Separator line as the first line of the file
- * sep=x
+ * sep=x.
*
* @var bool
*/
@@ -83,7 +84,7 @@ class CSV extends BaseWriter implements IWriter
private $excelCompatibility = false;
/**
- * Create a new CSV
+ * Create a new CSV.
*
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet Spreadsheet object
*/
@@ -93,9 +94,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Save PhpSpreadsheet to file
+ * Save PhpSpreadsheet to file.
*
* @param string $pFilename
+ *
* @throws Exception
*/
public function save($pFilename = null)
@@ -150,7 +152,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get delimiter
+ * Get delimiter.
*
* @return string
*/
@@ -160,9 +162,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set delimiter
+ * Set delimiter.
*
* @param string $pValue Delimiter, defaults to ,
+ *
* @return CSV
*/
public function setDelimiter($pValue = ',')
@@ -173,7 +176,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get enclosure
+ * Get enclosure.
*
* @return string
*/
@@ -183,9 +186,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set enclosure
+ * Set enclosure.
*
* @param string $pValue Enclosure, defaults to "
+ *
* @return CSV
*/
public function setEnclosure($pValue = '"')
@@ -199,7 +203,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get line ending
+ * Get line ending.
*
* @return string
*/
@@ -209,9 +213,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set line ending
+ * Set line ending.
*
* @param string $pValue Line ending, defaults to OS line ending (PHP_EOL)
+ *
* @return CSV
*/
public function setLineEnding($pValue = PHP_EOL)
@@ -222,7 +227,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get whether BOM should be used
+ * Get whether BOM should be used.
*
* @return bool
*/
@@ -232,9 +237,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set whether BOM should be used
+ * Set whether BOM should be used.
*
* @param bool $pValue Use UTF-8 byte-order mark? Defaults to false
+ *
* @return CSV
*/
public function setUseBOM($pValue = false)
@@ -245,7 +251,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get whether a separator line should be included
+ * Get whether a separator line should be included.
*
* @return bool
*/
@@ -255,9 +261,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set whether a separator line should be included as the first line of the file
+ * Set whether a separator line should be included as the first line of the file.
*
* @param bool $pValue Use separator line? Defaults to false
+ *
* @return CSV
*/
public function setIncludeSeparatorLine($pValue = false)
@@ -268,7 +275,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get whether the file should be saved with full Excel Compatibility
+ * Get whether the file should be saved with full Excel Compatibility.
*
* @return bool
*/
@@ -278,10 +285,11 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set whether the file should be saved with full Excel Compatibility
+ * Set whether the file should be saved with full Excel Compatibility.
*
* @param bool $pValue Set the file to be written as a fully Excel compatible csv file
* Note that this overrides other settings such as useBOM, enclosure and delimiter
+ *
* @return CSV
*/
public function setExcelCompatibility($pValue = false)
@@ -292,7 +300,7 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Get sheet index
+ * Get sheet index.
*
* @return int
*/
@@ -302,9 +310,10 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Set sheet index
+ * Set sheet index.
*
* @param int $pValue Sheet index
+ *
* @return CSV
*/
public function setSheetIndex($pValue = 0)
@@ -315,10 +324,11 @@ class CSV extends BaseWriter implements IWriter
}
/**
- * Write line to CSV file
+ * Write line to CSV file.
*
* @param resource $pFileHandle PHP filehandle
* @param array $pValues Array containing values in a row
+ *
* @throws Exception
*/
private function writeLine($pFileHandle = null, $pValues = null)
diff --git a/src/PhpSpreadsheet/Writer/Exception.php b/src/PhpSpreadsheet/Writer/Exception.php
index be920d89..d36fc3f2 100644
--- a/src/PhpSpreadsheet/Writer/Exception.php
+++ b/src/PhpSpreadsheet/Writer/Exception.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Writer;
/**
- * Copyright (c) 2006 - 2015 PhpSpreadsheet
+ * Copyright (c) 2006 - 2015 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,13 +20,14 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Exception extends \PhpOffice\PhpSpreadsheet\Exception
{
/**
- * Error handler callback
+ * Error handler callback.
*
* @param mixed $code
* @param mixed $string
diff --git a/src/PhpSpreadsheet/Writer/HTML.php b/src/PhpSpreadsheet/Writer/HTML.php
index c08b2589..467dbdcb 100644
--- a/src/PhpSpreadsheet/Writer/HTML.php
+++ b/src/PhpSpreadsheet/Writer/HTML.php
@@ -8,7 +8,7 @@ use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
/**
- * Copyright (c) 2006 - 2015 Spreadsheet
+ * Copyright (c) 2006 - 2015 Spreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,34 +25,35 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category Spreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 Spreadsheet (https://github.com/PHPOffice/Spreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class HTML extends BaseWriter implements IWriter
{
/**
- * Spreadsheet object
+ * Spreadsheet object.
*
* @var Spreadsheet
*/
protected $spreadsheet;
/**
- * Sheet index to write
+ * Sheet index to write.
*
* @var int
*/
private $sheetIndex = 0;
/**
- * Images root
+ * Images root.
*
* @var string
*/
private $imagesRoot = '.';
/**
- * embed images, or link to images
+ * embed images, or link to images.
*
* @var bool
*/
@@ -66,49 +67,49 @@ class HTML extends BaseWriter implements IWriter
private $useInlineCss = false;
/**
- * Array of CSS styles
+ * Array of CSS styles.
*
* @var array
*/
private $cssStyles;
/**
- * Array of column widths in points
+ * Array of column widths in points.
*
* @var array
*/
private $columnWidths;
/**
- * Default font
+ * Default font.
*
* @var \PhpOffice\PhpSpreadsheet\Style\Font
*/
private $defaultFont;
/**
- * Flag whether spans have been calculated
+ * Flag whether spans have been calculated.
*
* @var bool
*/
private $spansAreCalculated = false;
/**
- * Excel cells that should not be written as HTML cells
+ * Excel cells that should not be written as HTML cells.
*
* @var array
*/
private $isSpannedCell = [];
/**
- * Excel cells that are upper-left corner in a cell merge
+ * Excel cells that are upper-left corner in a cell merge.
*
* @var array
*/
private $isBaseCell = [];
/**
- * Excel rows that should not be written as HTML rows
+ * Excel rows that should not be written as HTML rows.
*
* @var array
*/
@@ -122,14 +123,14 @@ class HTML extends BaseWriter implements IWriter
protected $isPdf = false;
/**
- * Generate the Navigation block
+ * Generate the Navigation block.
*
* @var bool
*/
private $generateSheetNavigationBlock = true;
/**
- * Create a new HTML
+ * Create a new HTML.
*
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet
*/
@@ -140,9 +141,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Save Spreadsheet to file
+ * Save Spreadsheet to file.
*
* @param string $pFilename
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function save($pFilename = null)
@@ -186,9 +188,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Map VAlign
+ * Map VAlign.
*
* @param string $vAlign Vertical alignment
+ *
* @return string
*/
private function mapVAlign($vAlign)
@@ -207,9 +210,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Map HAlign
+ * Map HAlign.
*
* @param string $hAlign Horizontal alignment
+ *
* @return string|false
*/
private function mapHAlign($hAlign)
@@ -232,9 +236,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Map border style
+ * Map border style.
*
* @param int $borderStyle Sheet index
+ *
* @return string
*/
private function mapBorderStyle($borderStyle)
@@ -275,7 +280,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Get sheet index
+ * Get sheet index.
*
* @return int
*/
@@ -285,9 +290,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Set sheet index
+ * Set sheet index.
*
* @param int $pValue Sheet index
+ *
* @return HTML
*/
public function setSheetIndex($pValue = 0)
@@ -298,7 +304,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Get sheet index
+ * Get sheet index.
*
* @return bool
*/
@@ -308,9 +314,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Set sheet index
+ * Set sheet index.
*
* @param bool $pValue Flag indicating whether the sheet navigation block should be generated or not
+ *
* @return HTML
*/
public function setGenerateSheetNavigationBlock($pValue = true)
@@ -321,7 +328,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Write all sheets (resets sheetIndex to NULL)
+ * Write all sheets (resets sheetIndex to NULL).
*/
public function writeAllSheets()
{
@@ -331,10 +338,12 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate HTML header
+ * Generate HTML header.
*
* @param bool $pIncludeStyles Include styles?
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
public function generateHTMLHeader($pIncludeStyles = false)
@@ -391,9 +400,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate sheet data
+ * Generate sheet data.
*
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
public function generateSheetData()
@@ -510,9 +520,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate sheet tabs
+ * Generate sheet tabs.
*
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
public function generateNavigation()
@@ -603,11 +614,13 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate image tag in cell
+ * Generate image tag in cell.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet
* @param string $coordinates Cell coordinates
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
private function writeImageInCell(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $coordinates)
@@ -684,11 +697,13 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate chart tag in cell
+ * Generate chart tag in cell.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet
* @param string $coordinates Cell coordinates
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
private function writeChartInCell(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $coordinates)
@@ -731,10 +746,12 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate CSS styles
+ * Generate CSS styles.
*
* @param bool $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>)
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
public function generateStyles($generateSurroundingHTML = true)
@@ -773,10 +790,12 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Build CSS styles
+ * Build CSS styles.
*
* @param bool $generateSurroundingHTML Generate surrounding HTML style? (html { })
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return array
*/
public function buildCSS($generateSurroundingHTML = true)
@@ -928,9 +947,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style
+ * Create CSS style.
*
* @param \PhpOffice\PhpSpreadsheet\Style $pStyle
+ *
* @return array
*/
private function createCSSStyle(\PhpOffice\PhpSpreadsheet\Style $pStyle)
@@ -951,9 +971,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Alignment)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Alignment).
*
* @param \PhpOffice\PhpSpreadsheet\Style\Alignment $pStyle \PhpOffice\PhpSpreadsheet\Style\Alignment
+ *
* @return array
*/
private function createCSSStyleAlignment(\PhpOffice\PhpSpreadsheet\Style\Alignment $pStyle)
@@ -974,9 +995,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Font)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Font).
*
* @param \PhpOffice\PhpSpreadsheet\Style\Font $pStyle \PhpOffice\PhpSpreadsheet\Style\Font
+ *
* @return array
*/
private function createCSSStyleFont(\PhpOffice\PhpSpreadsheet\Style\Font $pStyle)
@@ -1007,9 +1029,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Borders)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Borders).
*
* @param \PhpOffice\PhpSpreadsheet\Style\Borders $pStyle \PhpOffice\PhpSpreadsheet\Style\Borders
+ *
* @return array
*/
private function createCSSStyleBorders(\PhpOffice\PhpSpreadsheet\Style\Borders $pStyle)
@@ -1027,9 +1050,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Border)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Border).
*
* @param \PhpOffice\PhpSpreadsheet\Style\Border $pStyle \PhpOffice\PhpSpreadsheet\Style\Border
+ *
* @return string
*/
private function createCSSStyleBorder(\PhpOffice\PhpSpreadsheet\Style\Border $pStyle)
@@ -1042,9 +1066,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Fill)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Fill).
*
* @param \PhpOffice\PhpSpreadsheet\Style\Fill $pStyle \PhpOffice\PhpSpreadsheet\Style\Fill
+ *
* @return array
*/
private function createCSSStyleFill(\PhpOffice\PhpSpreadsheet\Style\Fill $pStyle)
@@ -1061,7 +1086,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate HTML footer
+ * Generate HTML footer.
*/
public function generateHTMLFooter()
{
@@ -1074,10 +1099,12 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate table header
+ * Generate table header.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet The worksheet for the table we are writing
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
private function generateTableHeader($pSheet)
@@ -1121,7 +1148,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate table footer
+ * Generate table footer.
*
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
@@ -1133,12 +1160,15 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Generate row
+ * Generate row.
*
* @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet
* @param array $pValues Array containing cells in a row
* @param int $pRow Row number (0-based)
+ * @param mixed $cellType
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return string
*/
private function generateRow(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
@@ -1379,15 +1409,16 @@ class HTML extends BaseWriter implements IWriter
// Return
return $html;
- } else {
- throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.');
}
+ throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.');
}
/**
- * Takes array where of CSS properties / values and converts to CSS string
+ * Takes array where of CSS properties / values and converts to CSS string.
*
* @param array
+ * @param mixed $pValue
+ *
* @return string
*/
private function assembleCSS($pValue = [])
@@ -1402,7 +1433,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Get images root
+ * Get images root.
*
* @return string
*/
@@ -1412,9 +1443,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Set images root
+ * Set images root.
*
* @param string $pValue
+ *
* @return HTML
*/
public function setImagesRoot($pValue = '.')
@@ -1425,7 +1457,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Get embed images
+ * Get embed images.
*
* @return bool
*/
@@ -1435,9 +1467,10 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Set embed images
+ * Set embed images.
*
* @param bool $pValue
+ *
* @return HTML
*/
public function setEmbedImages($pValue = true)
@@ -1461,6 +1494,7 @@ class HTML extends BaseWriter implements IWriter
* Set use inline CSS?
*
* @param bool $pValue
+ *
* @return HTML
*/
public function setUseInlineCss($pValue = false)
@@ -1471,10 +1505,11 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Add color to formatted string as inline style
+ * Add color to formatted string as inline style.
*
* @param string $pValue Plain formatted value without color
* @param string $pFormat Format code
+ *
* @return string
*/
public function formatColor($pValue, $pFormat)
@@ -1502,7 +1537,7 @@ class HTML extends BaseWriter implements IWriter
}
/**
- * Calculate information about HTML colspan and rowspan which is not always the same as Excel's
+ * Calculate information about HTML colspan and rowspan which is not always the same as Excel's.
*/
private function calculateSpans()
{
diff --git a/src/PhpSpreadsheet/Writer/IWriter.php b/src/PhpSpreadsheet/Writer/IWriter.php
index d693d308..0fd2109e 100644
--- a/src/PhpSpreadsheet/Writer/IWriter.php
+++ b/src/PhpSpreadsheet/Writer/IWriter.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Writer;
/**
- * Copyright (c) 2006 - 2015 PhpSpreadsheet
+ * Copyright (c) 2006 - 2015 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,15 +20,17 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
interface IWriter
{
/**
- * Save PhpSpreadsheet to file
+ * Save PhpSpreadsheet to file.
*
* @param string $pFilename Name of the file to save
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function save($pFilename = null);
diff --git a/src/PhpSpreadsheet/Writer/Ods.php b/src/PhpSpreadsheet/Writer/Ods.php
index f2cbd471..66860e41 100644
--- a/src/PhpSpreadsheet/Writer/Ods.php
+++ b/src/PhpSpreadsheet/Writer/Ods.php
@@ -5,7 +5,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
/**
- * Copyright (c) 2006 - 2015 PhpSpreadsheet
+ * Copyright (c) 2006 - 2015 PhpSpreadsheet.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,27 +22,28 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
class Ods extends BaseWriter implements IWriter
{
/**
- * Private writer parts
+ * Private writer parts.
*
* @var Ods\WriterPart[]
*/
private $writerParts = [];
/**
- * Private PhpSpreadsheet
+ * Private PhpSpreadsheet.
*
* @var PhpSpreadsheet
*/
private $spreadSheet;
/**
- * Create a new Ods
+ * Create a new Ods.
*
* @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet
*/
@@ -66,24 +67,26 @@ class Ods extends BaseWriter implements IWriter
}
/**
- * Get writer part
+ * Get writer part.
*
* @param string $pPartName Writer part name
+ *
* @return Ods\WriterPart|null
*/
public function getWriterPart($pPartName = '')
{
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
return $this->writerParts[strtolower($pPartName)];
- } else {
- return null;
}
+
+ return null;
}
/**
- * Save PhpSpreadsheet to file
+ * Save PhpSpreadsheet to file.
*
* @param string $pFilename
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function save($pFilename = null)
@@ -129,10 +132,12 @@ class Ods extends BaseWriter implements IWriter
}
/**
- * Create zip object
+ * Create zip object.
*
* @param string $pFilename
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return ZipArchive
*/
private function createZip($pFilename)
@@ -161,25 +166,27 @@ class Ods extends BaseWriter implements IWriter
}
/**
- * Get Spreadsheet object
+ * Get Spreadsheet object.
*
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return Spreadsheet
*/
public function getSpreadsheet()
{
if ($this->spreadSheet !== null) {
return $this->spreadSheet;
- } else {
- throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet assigned.');
}
+ throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet assigned.');
}
/**
- * Set Spreadsheet object
+ * Set Spreadsheet object.
*
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
+ *
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
* @return self
*/
public function setSpreadsheet(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null)
diff --git a/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php b/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
index a9b76f62..9d3b4c00 100644
--- a/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
+++ b/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
@@ -3,7 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Writer\Ods\Cell;
/**
- * PhpSpreadsheet
+ * PhpSpreadsheet.
*
* Copyright (c) 2006 - 2015 PhpSpreadsheet
*
@@ -22,12 +22,14 @@ namespace PhpOffice\PhpSpreadsheet\Writer\Ods\Cell;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
/**
* @category PhpSpreadsheet
+ *
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @author Alexander Pervakov