Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions JF.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
58 changes: 58 additions & 0 deletions PhpWord/Autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/

namespace PhpOffice\PhpWord;

/**
* Autoloader
*/
class Autoloader
{
/** @const string */
const NAMESPACE_PREFIX = 'PhpOffice\\PhpWord\\';

/**
* Register
*
* @param bool $throw
* @param bool $prepend
* @return void
*/
public static function register($throw = true, $prepend = false)
{
spl_autoload_register(array(new self, 'autoload'), $throw, $prepend);
}

/**
* Autoload
*
* @param string $class
* @return void
*/
public static function autoload($class)
{
$prefixLength = strlen(self::NAMESPACE_PREFIX);
if (0 === strncmp(self::NAMESPACE_PREFIX, $class, $prefixLength)) {
$file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength));
$file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
if (file_exists($file)) {
/** @noinspection PhpIncludeInspection Dynamic includes */
require_once $file;
}
}
}
}
96 changes: 96 additions & 0 deletions PhpWord/Collection/AbstractCollection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Collection abstract class
*
* @since 0.10.0
*/
abstract class AbstractCollection
{
/**
* Items
*
* @var array
*/
private $items = array();

/**
* Get items
*
* @return array
*/
public function getItems()
{
return $this->items;
}

/**
* Get item by index
*
* @param int $index
* @return mixed
*/
public function getItem($index)
{
if (array_key_exists($index, $this->items)) {
return $this->items[$index];
} else {
return null;
}
}

/**
* Set item.
*
* @param int $index
* @param mixed $item
* @return void
*/
public function setItem($index, $item)
{
if (array_key_exists($index, $this->items)) {
$this->items[$index] = $item;
}
}

/**
* Add new item
*
* @param mixed $item
* @return int
*/
public function addItem($item)
{
$index = $this->countItems() + 1;
$this->items[$index] = $item;

return $index;
}

/**
* Get item count
*
* @return int
*/
public function countItems()
{
return count($this->items);
}
}
27 changes: 27 additions & 0 deletions PhpWord/Collection/Bookmarks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Bookmarks collection
*
* @since 0.12.0
*/
class Bookmarks extends AbstractCollection
{
}
27 changes: 27 additions & 0 deletions PhpWord/Collection/Charts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Charts collection
*
* @since 0.12.0
*/
class Charts extends AbstractCollection
{
}
27 changes: 27 additions & 0 deletions PhpWord/Collection/Endnotes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Endnotes collection
*
* @since 0.10.0
*/
class Endnotes extends AbstractCollection
{
}
27 changes: 27 additions & 0 deletions PhpWord/Collection/Footnotes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Footnotes collection
*
* @since 0.10.0
*/
class Footnotes extends AbstractCollection
{
}
27 changes: 27 additions & 0 deletions PhpWord/Collection/Titles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code. For the full list of
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/

namespace PhpOffice\PhpWord\Collection;

/**
* Titles collection
*
* @since 0.10.0
*/
class Titles extends AbstractCollection
{
}
Loading