Skip to content

Commit

Permalink
Make global usage of use instead of FQCN
Browse files Browse the repository at this point in the history
Closes #78
Closes #147
  • Loading branch information
titanrat authored and PowerKiKi committed May 17, 2017
1 parent 77199c9 commit 07455d2
Show file tree
Hide file tree
Showing 294 changed files with 3,915 additions and 2,974 deletions.
4 changes: 3 additions & 1 deletion bin/migrate-from-phpexcel
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php
use PhpOffice\PhpSpreadsheet\Helper\Migrator;

require_once __DIR__ . '/../src/Bootstrap.php';

$migrator = new \PhpOffice\PhpSpreadsheet\Helper\Migrator();
$migrator = new Migrator();
$migrator->migrate();
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DAVERAGE.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DCOUNT.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DGET.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DMAX.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DMIN.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DPRODUCT.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DSTDEV.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DSTDEVP.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DVAR.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/Database/DVARP.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/DateTime/DATE.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/DateTime/DATEVALUE.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/DateTime/TIME.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Calculations/DateTime/TIMEVALUE.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Spreadsheet;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -22,7 +24,7 @@
require_once __DIR__ . '/../../../../src/Bootstrap.php';

// Create new PhpSpreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();

// Add some data
Expand Down
6 changes: 4 additions & 2 deletions docs/Examples/Reader/exampleReader01.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -16,14 +18,14 @@
<body>

<h1>PhpSpreadsheet Reader Example #01</h1>
<h2>Simple File Reader using \PhpOffice\PhpSpreadsheet\IOFactory::load()</h2>
<h2>Simple File Reader using IOFactory::load()</h2>
<?php

require_once __DIR__ . '/../../../src/Bootstrap.php';

$inputFileName = './sampleData/example1.xls';
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
$spreadsheet = IOFactory::load($inputFileName);

echo '<hr />';

Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Reader/exampleReader02.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\Reader\Xls;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -24,7 +26,7 @@
$inputFileName = './sampleData/example1.xls';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using \PhpOffice\PhpSpreadsheet\Reader\Xls<br />';
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
$reader = new Xls();
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xml();
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Ods();
Expand Down
6 changes: 4 additions & 2 deletions docs/Examples/Reader/exampleReader03.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -16,7 +18,7 @@
<body>

<h1>PhpSpreadsheet Reader Example #03</h1>
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Return a Reader</h2>
<h2>Simple File Reader using the IOFactory to Return a Reader</h2>
<?php

require_once __DIR__ . '/../../../src/Bootstrap.php';
Expand All @@ -31,7 +33,7 @@
$inputFileName = './sampleData/example1.xls';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = IOFactory::createReader($inputFileType);
$spreadsheet = $reader->load($inputFileName);

echo '<hr />';
Expand Down
8 changes: 5 additions & 3 deletions docs/Examples/Reader/exampleReader04.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand All @@ -16,18 +18,18 @@
<body>

<h1>PhpSpreadsheet Reader Example #04</h1>
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Identify a Reader to Use</h2>
<h2>Simple File Reader using the IOFactory to Identify a Reader to Use</h2>
<?php

require_once __DIR__ . '/../../../src/Bootstrap.php';

$inputFileName = './sampleData/example1.xls';

$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName);
$inputFileType = IOFactory::identify($inputFileName);
echo 'File ',pathinfo($inputFileName, PATHINFO_BASENAME),' has been identified as an ',$inputFileType,' file<br />';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with the identified reader type<br />';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = IOFactory::createReader($inputFileType);
$spreadsheet = $reader->load($inputFileName);

echo '<hr />';
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Reader/exampleReader05.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand Down Expand Up @@ -29,7 +31,7 @@
$inputFileName = './sampleData/example1.xls';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = IOFactory::createReader($inputFileType);
echo 'Turning Formatting off for Load<br />';
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load($inputFileName);
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Reader/exampleReader06.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand Down Expand Up @@ -29,7 +31,7 @@
$inputFileName = './sampleData/example1.xls';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = IOFactory::createReader($inputFileType);
echo 'Loading all WorkSheets<br />';
$reader->setLoadAllSheets();
$spreadsheet = $reader->load($inputFileName);
Expand Down
4 changes: 3 additions & 1 deletion docs/Examples/Reader/exampleReader07.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use PhpOffice\PhpSpreadsheet\IOFactory;

error_reporting(E_ALL);
set_time_limit(0);

Expand Down Expand Up @@ -30,7 +32,7 @@
$sheetname = 'Data Sheet #2';

echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = IOFactory::createReader($inputFileType);
echo 'Loading Sheet "',$sheetname,'" only<br />';
$reader->setLoadSheetsOnly($sheetname);
$spreadsheet = $reader->load($inputFileName);
Expand Down
Loading

0 comments on commit 07455d2

Please sign in to comment.