Skip to content

Commit 557e80d

Browse files
committed
Rename classes to keep them in their related namespaces
1 parent 3982ce2 commit 557e80d

File tree

160 files changed

+627
-571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+627
-571
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2828

2929
- Standardization of array keys used for style, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
3030
- Easier usage of PDF writers, and other custom readers and writers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
31+
- Easier usage of chart renderers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
32+
- Rename a few more classes to keep them in their related namespaces:
33+
- `CalcEngine` => `Calculation\Engine`
34+
- `PhpSpreadsheet\Calculation` => `PhpSpreadsheet\Calculation\Calculation`
35+
- `PhpSpreadsheet\Cell` => `PhpSpreadsheet\Cell\Cell`
36+
- `PhpSpreadsheet\Chart` => `PhpSpreadsheet\Chart\Chart`
37+
- `PhpSpreadsheet\RichText` => `PhpSpreadsheet\RichText\RichText`
38+
- `PhpSpreadsheet\Style` => `PhpSpreadsheet\Style\Style`
39+
- `PhpSpreadsheet\Worksheet` => `PhpSpreadsheet\Worksheet\Worksheet`
3140

3241
## [1.0.0-beta] - 2017-08-17
3342

docs/topics/accessing-cells.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ $worksheet = $spreadsheet->getActiveSheet();
389389
// Get the highest row and column numbers referenced in the worksheet
390390
$highestRow = $worksheet->getHighestRow(); // e.g. 10
391391
$highestColumn = $worksheet->getHighestColumn(); // e.g 'F'
392-
$highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($highestColumn); // e.g. 5
392+
$highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Cell::columnIndexFromString($highestColumn); // e.g. 5
393393

394394
echo '<table>' . "\n";
395395
for ($row = 1; $row <= $highestRow; ++$row) {
@@ -459,7 +459,7 @@ value binder in PhpSpreadsheet:
459459
require_once 'src/Boostrap.php';
460460

461461
// Set value binder
462-
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
462+
\PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
463463

464464
// Create new Spreadsheet object
465465
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

docs/topics/reading-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ these values during the load process within a Value Binder.
575575

576576
A Value Binder is a class that implement the
577577
\PhpOffice\PhpSpreadsheet\Cell\IValueBinder interface. It must contain a
578-
bindValue() method that accepts a \PhpOffice\PhpSpreadsheet\Cell and a
578+
bindValue() method that accepts a `\PhpOffice\PhpSpreadsheet\Cell\Cell` and a
579579
value as arguments, and return a boolean true or false that indicates
580580
whether the workbook cell has been populated with the value or not. The
581581
Advanced Value Binder implements such a class: amongst other tests, it
@@ -593,7 +593,7 @@ loader logic when reading unformatted text files.
593593

594594
``` php
595595
/** Tell PhpSpreadsheet that we want to use the Advanced Value Binder **/
596-
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
596+
\PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
597597

598598
$inputFileType = 'Csv';
599599
$inputFileName = './sampleData/example1.tsv';

docs/topics/recipes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ method that suits you the best. Here are some examples:
7171
``` php
7272

7373
// MySQL-like timestamp '2008-12-31' or date string
74-
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
74+
\PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
7575

7676
$spreadsheet->getActiveSheet()
7777
->setCellValue('D1', '2008-12-31');
@@ -248,7 +248,7 @@ when it sees a newline character in a string that you are inserting in a
248248
cell. Just like Microsoft Office Excel. Try this:
249249

250250
``` php
251-
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
251+
\PhpOffice\PhpSpreadsheet\Cell\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() );
252252

253253
$spreadsheet->getActiveSheet()->getCell('A1')->setValue("hello\nworld");
254254
```
@@ -743,13 +743,13 @@ easy manner.
743743
### Valid array keys for style `applyFromArray()`
744744

745745
The following table lists the valid array keys for
746-
\PhpOffice\PhpSpreadsheet\Style applyFromArray() classes. If the "Maps
746+
`\PhpOffice\PhpSpreadsheet\Style\Style::applyFromArray()` classes. If the "Maps
747747
to property" column maps a key to a setter, the value provided for that
748748
key will be applied directly. If the "Maps to property" column maps a
749749
key to a getter, the value provided for that key will be applied as
750750
another style array.
751751

752-
**\PhpOffice\PhpSpreadsheet\Style**
752+
**\PhpOffice\PhpSpreadsheet\Style\Style**
753753

754754
Array key | Maps to property
755755
-------------|-------------------

samples/Basic/02_Types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\RichText;
3+
use PhpOffice\PhpSpreadsheet\RichText\RichText;
44
use PhpOffice\PhpSpreadsheet\Shared\Date;
55
use PhpOffice\PhpSpreadsheet\Spreadsheet;
66
use PhpOffice\PhpSpreadsheet\Style\Color;

samples/Basic/09_Pagebreaks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use PhpOffice\PhpSpreadsheet\Spreadsheet;
4-
use PhpOffice\PhpSpreadsheet\Worksheet;
4+
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
55

66
require __DIR__ . '/../Header.php';
77

samples/Basic/13_Calculation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Calculation;
3+
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
44
use PhpOffice\PhpSpreadsheet\Spreadsheet;
55

66
mt_srand(1234567890);

samples/Basic/13_CalculationCyclicFormulae.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Calculation;
3+
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
44
use PhpOffice\PhpSpreadsheet\Spreadsheet;
55

66
require __DIR__ . '/../Header.php';

samples/Basic/18_Extendedcalculation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use PhpOffice\PhpSpreadsheet\Calculation;
3+
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
44
use PhpOffice\PhpSpreadsheet\Spreadsheet;
55

66
require __DIR__ . '/../Header.php';

samples/Basic/23_Sharedstyles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
use PhpOffice\PhpSpreadsheet\Spreadsheet;
4-
use PhpOffice\PhpSpreadsheet\Style;
54
use PhpOffice\PhpSpreadsheet\Style\Border;
65
use PhpOffice\PhpSpreadsheet\Style\Fill;
6+
use PhpOffice\PhpSpreadsheet\Style\Style;
77

88
require __DIR__ . '/../Header.php';
99

0 commit comments

Comments
 (0)