diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..5d6484ab --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: familytree365 diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 00000000..d47f9636 --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,11 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/familytree365/php-gedcom). + +## Pull Requests + +- **[PSR-4 Coding Standard.]** The easiest way to apply the conventions is to install [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). +- **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept up-to-date. +- **Create feature branches.** Don't ask us to pull from your master branch. +- **One pull request per feature.** If you want to do more than one thing, send multiple pull requests. +- **Send coherent history.** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..e662c786 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,5 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 797a99e3..8ce3350d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,19 @@ # php-gedcom + ![Latest Stable Version](https://img.shields.io/github/release/familytree365/php-gedcom.svg) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/familytree365/php-gedcom/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/familytree365/php-gedcom/?branch=master) +[![Build Status](https://scrutinizer-ci.com/g/familytree365/php-gedcom/badges/build.png?b=master)](https://scrutinizer-ci.com/g/familytree365/php-gedcom/build-status/master) +[![Code Intelligence Status](https://scrutinizer-ci.com/g/familytree365/php-gedcom/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence) +[![StyleCI](https://github.styleci.io/repos/262784020/shield?branch=master)](https://github.styleci.io/repos/262784020) +[![CodeFactor](https://www.codefactor.io/repository/github/familytree365/php-gedcom/badge/master)](https://www.codefactor.io/repository/github/familytree365/php-gedcom/overview/master) +[![codebeat badge](https://codebeat.co/badges/911f9e33-212a-4dfa-a860-751cdbbacff7)](https://codebeat.co/projects/github-com-modularphp-gedcom-php-gedcom-master) +[![Build Status](https://travis-ci.org/familytree365/php-gedcom.svg?branch=master)](https://travis-ci.org/familytree365/php-gedcom) + + + ## Requirements -* php-gedcom 1.0+ requires PHP 5.3 (or later). +* php-gedcom 1.0+ requires PHP 8.0 (or later). ## Installation @@ -14,7 +25,7 @@ To install php-gedcom in your project using composer, simply add the following r { "require": { - "oguz463/php-gedcom": "1.0.*" + "familytree365/php-gedcom": "1.0.*" } } @@ -24,15 +35,15 @@ If you are not using composer, you can download an archive of the source from Gi ```php spl_autoload_register(function ($class) { - $pathToPhpGedcom = __DIR__ . '/library/'; // TODO FIXME + $pathToGedcom = __DIR__ . '/library/'; // TODO FIXME - if (!substr(ltrim($class, '\\'), 0, 7) == 'PhpGedcom\\') { + if (!substr(ltrim($class, '\\'), 0, 7) == 'Gedcom\\') { return; } $class = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; - if (file_exists($pathToPhpGedcom . $class)) { - require_once($pathToPhpGedcom . $class); + if (file_exists($pathToGedcom . $class)) { + require_once($pathToGedcom . $class); } }); ``` @@ -42,8 +53,8 @@ spl_autoload_register(function ($class) { To parse a GEDCOM file and load it into a collection of PHP Objects, simply instantiate a new Parser object and pass it the file name to parse. The resulting Gedcom object will contain all the information stored within the supplied GEDCOM file: ```php -$parser = new \PhpGedcom\Parser(); -$gedcom = $parser->parse('tmp\gedcom.ged'); +$parser = new \Gedcom\Parser(); +$gedcom = $parser->parse('tmp.ged'); foreach ($gedcom->getIndi() as $individual) { echo $individual->getId() . ': ' . current($individual->getName())->getSurn() . diff --git a/composer.json b/composer.json index 81d3d2c8..9f519757 100644 --- a/composer.json +++ b/composer.json @@ -1,20 +1,26 @@ { - "name": "oguz463/php-gedcom", - "description": "A GEDCOM file parser (read + write) for PHP 5.3+", + "name": "cgdprojects/php-gedcom", + "description": "A GEDCOM file parser (read + write) for PHP 8.0+", "type": "library", "keywords": ["gedcom","parser"], - "homepage": "http://github.com/oguz463/php-gedcom", - "license": "GPL-3.0", + "homepage": "http://github.com/familytree365/php-gedcom", + "license": "MIT", "require": { - "php": ">=5.3" + "php": ">=8.0" }, "require-dev": { - "phpunit/PHPUnit": "3.7.*", - "squizlabs/php_codesniffer": "1.*" + "phpunit/phpunit": "9.*", + "squizlabs/php_codesniffer": "3.6.*", + "rector/rector": "^0.11.49" }, "autoload": { - "psr-0": { - "PhpGedcom\\": "library/" + "psr-4": { + "Gedcom\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GedcomTest\\": "tests/" } } } diff --git a/composer.lock b/composer.lock index 8e907109..980f3ae6 100644 --- a/composer.lock +++ b/composer.lock @@ -1,293 +1,1962 @@ { - "hash": "7a6ddf88d4aa9ca90a3535cce0bace3d", - "packages": [ - + "_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#installing-dependencies", + "This file is @generated automatically" ], + "content-hash": "38312646739c9b3b1718b9add4133108", + "packages": [], "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "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": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.12.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + }, + "time": "2021-07-21T10:44:31+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.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" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.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" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, + "time": "2020-09-17T18:55:26+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "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" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + }, + "time": "2021-03-17T13:42:18+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "0.12.95", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58", + "reference": "4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.95" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-08-20T12:53:41+00:00" + }, { "name": "phpunit/php-code-coverage", - "version": "1.2.7", + "version": "9.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f6293e1b30a2354e8428e004689671b83871edde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-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": "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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-28T07:26:59+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-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": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/191768ccd5c85513b4068bdbe99bb6390c7d54fb", + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.8" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-31T15:17:34+00:00" + }, + { + "name": "rector/rector", + "version": "0.11.49", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "fdf11ed923d79c1777f993ef755fc8fe111a25a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/fdf11ed923d79c1777f993ef755fc8fe111a25a2", + "reference": "fdf11ed923d79c1777f993ef755fc8fe111a25a2", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0", + "phpstan/phpstan": "0.12.95" + }, + "conflict": { + "phpstan/phpdoc-parser": "<=0.5.3", + "phpstan/phpstan": "<=0.12.82", + "rector/rector-cakephp": "*", + "rector/rector-doctrine": "*", + "rector/rector-nette": "*", + "rector/rector-phpunit": "*", + "rector/rector-prefixed": "*", + "rector/rector-symfony": "*" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.11-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Prefixed and PHP 7.1 downgraded version of rector/rector", + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/0.11.49" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2021-08-23T11:18:30+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-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": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "1.2.7" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-code-coverage/archive/1.2.7.zip", - "reference": "1.2.7", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-token-stream": ">=1.1.3@stable", - "phpunit/php-text-template": ">=1.1.1@stable" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, - "suggest": { + "require-dev": { "ext-dom": "*", - "ext-xdebug": ">=2.0.5" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" }, - "time": "2012-12-02 14:54:55", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "testing", - "coverage", - "xunit" - ] + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.3.3", + "name": "sebastian/lines-of-code", + "version": "1.0.3", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "1.3.3" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3", - "reference": "1.3.3", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { - "php": ">=5.3.3" + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "time": "2012-10-11 04:44:38", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ - "File/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "filesystem", - "iterator" - ] + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.1.4", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-text-template.git", - "reference": "1.1.4" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", - "reference": "1.1.4", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "time": "2012-10-31 11:15:28", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ] + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.4", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-timer.git", - "reference": "1.0.4" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", - "reference": "1.0.4", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "time": "2012-10-11 04:45:58", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Utility class for timing", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "timer" - ] + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.1.5", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1.1.5" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", - "reference": "1.1.5", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "time": "2012-10-11 04:47:14", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "tokenizer" - ] + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "phpunit/phpunit", - "version": "3.7.13", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/phpunit.git", - "reference": "3.7.13" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.13.zip", - "reference": "3.7.13", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-code-coverage": ">=1.2.1", - "phpunit/php-timer": ">=1.0.2", - "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", - "symfony/yaml": ">=2.1.0,<2.2.0", - "ext-dom": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*" + "php": ">=7.3" }, - "suggest": { - "phpunit/php-invoker": ">=1.1.0", - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*" + "require-dev": { + "phpunit/phpunit": "^9.0" }, - "time": "2013-01-13 10:21:19", - "bin": [ - "composer/bin/phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -298,89 +1967,105 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "testing", - "phpunit", - "xunit" - ] + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "1.2.3", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "1.2.3" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip", - "reference": "1.2.3", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" - }, - "suggest": { - "ext-soap": "*" + "php": ">=7.3" }, - "time": "2013-01-13 10:24:48", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ] + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "1.4.3", + "version": "3.6.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer", - "reference": "1.4.3" + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "dist": { "type": "zip", - "url": "https://github.com/squizlabs/PHP_CodeSniffer/archive/1.4.3.zip", - "reference": "1.4.3", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { - "php": ">=5.1.2" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, - "time": "2012-12-04 03:15:31", "bin": [ - "scripts/phpcs" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", - "autoload": { - "classmap": [ - "." - ] + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -392,61 +2077,215 @@ "role": "lead" } ], - "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ - "standards", - "phpcs" - ] + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-04-09T00:54:41+00:00" }, { - "name": "symfony/yaml", - "version": "v2.1.7", - "target-dir": "Symfony/Component/Yaml", + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml", - "reference": "v2.1.7" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Yaml/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" }, - "time": "2013-01-17 21:21:51", "type": "library", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml": "" + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": [ - - ] + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=8.0" + }, + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/library/PhpGedcom/Parser/Fam/Anul.php b/library/PhpGedcom/Parser/Fam/Anul.php deleted file mode 100644 index 74468ab0..00000000 --- a/library/PhpGedcom/Parser/Fam/Anul.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Anul extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Cens.php b/library/PhpGedcom/Parser/Fam/Cens.php deleted file mode 100644 index 73a1b384..00000000 --- a/library/PhpGedcom/Parser/Fam/Cens.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Cens extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Div.php b/library/PhpGedcom/Parser/Fam/Div.php deleted file mode 100644 index bc6e07c0..00000000 --- a/library/PhpGedcom/Parser/Fam/Div.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Div extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Enga.php b/library/PhpGedcom/Parser/Fam/Enga.php deleted file mode 100644 index c145b273..00000000 --- a/library/PhpGedcom/Parser/Fam/Enga.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Enga extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Even.php b/library/PhpGedcom/Parser/Fam/Even.php deleted file mode 100644 index 06aa3beb..00000000 --- a/library/PhpGedcom/Parser/Fam/Even.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Even extends \PhpGedcom\Parser\Component -{ - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) - { - $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - - $even = new \PhpGedcom\Record\Fam\Even(); - - if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { - $even->setType(trim($record[1])); - } - - $parser->forward(); - - while (!$parser->eof()) { - $record = $parser->getCurrentLineRecord(); - $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - - if ($currentDepth <= $depth) { - $parser->back(); - break; - } - - switch ($recordType) { - case 'TYPE': - $even->setType(trim($record[2])); - break; - case 'DATE': - $even->setDate(trim($record[2])); - break; - case 'PLAC': - $plac = \PhpGedcom\Parser\Indi\Even\Plac::parse($parser); - $even->setPlac($plac); - break; - case 'ADDR': - $addr = \PhpGedcom\Parser\Addr::parse($parser); - $even->setAddr($addr); - break; - case 'PHON': - $phone = \PhpGedcom\Parser\Phon::parse($parser); - $even->addPhone($phone); - break; - case 'CAUS': - $even->setCaus(trim($record[2])); - break; - case 'AGE': - $even->setAge(trim($record[2])); - break; - case 'AGNC': - $even->setAgnc(trim($record[2])); - break; - case 'HUSB': - $husb = \PhpGedcom\Parser\Fam\Even\Husb::parse($parser); - $even->setHusb($husb); - break; - case 'WIFE': - $wife = \PhpGedcom\Parser\Fam\Even\Wife::parse($parser); - $even->setWife($wife); - break; - case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); - $even->addSour($sour); - break; - case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); - $even->addObje($obje); - break; - case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); - if ($note) { - $even->addNote($note); - } - break; - default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); - } - - $parser->forward(); - } - - return $even; - } -} diff --git a/library/PhpGedcom/Parser/Fam/Marb.php b/library/PhpGedcom/Parser/Fam/Marb.php deleted file mode 100644 index 001a19e3..00000000 --- a/library/PhpGedcom/Parser/Fam/Marb.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Marb extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Marc.php b/library/PhpGedcom/Parser/Fam/Marc.php deleted file mode 100644 index 7d45b9bc..00000000 --- a/library/PhpGedcom/Parser/Fam/Marc.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Marc extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Marl.php b/library/PhpGedcom/Parser/Fam/Marl.php deleted file mode 100644 index fb5949b8..00000000 --- a/library/PhpGedcom/Parser/Fam/Marl.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Marl extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Marr.php b/library/PhpGedcom/Parser/Fam/Marr.php deleted file mode 100644 index a81dcac5..00000000 --- a/library/PhpGedcom/Parser/Fam/Marr.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Marr extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Fam/Mars.php b/library/PhpGedcom/Parser/Fam/Mars.php deleted file mode 100644 index f219369b..00000000 --- a/library/PhpGedcom/Parser/Fam/Mars.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Fam; - -/** - * - * - */ -class Mars extends \PhpGedcom\Parser\Fam\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi.php b/library/PhpGedcom/Parser/Indi.php deleted file mode 100644 index eb6ba70b..00000000 --- a/library/PhpGedcom/Parser/Indi.php +++ /dev/null @@ -1,196 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser; - -/** - * - * - */ -class Indi extends \PhpGedcom\Parser\Component -{ - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) - { - $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; - } - - $indi = new \PhpGedcom\Record\Indi(); - $indi->setId($identifier); - - $parser->getGedcom()->addIndi($indi); - - $parser->forward(); - - while (!$parser->eof()) { - $record = $parser->getCurrentLineRecord(); - $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - - if ($currentDepth <= $depth) { - $parser->back(); - break; - } - - switch ($recordType) { - case '_UID': - $indi->setUid(trim($record[2])); - break; - case 'NAME': - $name = \PhpGedcom\Parser\Indi\Name::parse($parser); - $indi->addName($name); - break; - case 'ALIA': - $indi->addAlia($parser->normalizeIdentifier($record[2])); - break; - case 'SEX': - $indi->setSex(trim($record[2])); - break; - case 'RIN': - $indi->setRin(trim($record[2])); - break; - case 'RESN': - $indi->setResn(trim($record[2])); - break; - case 'RFN': - $indi->setRfn(trim($record[2])); - break; - case 'AFN': - $indi->setAfn(trim($record[2])); - break; - case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); - $indi->setChan($chan); - break; - case 'FAMS': - $fams = \PhpGedcom\Parser\Indi\Fams::parse($parser); - if ($fams) { - $indi->addFams($fams); - } - break; - case 'FAMC': - $famc = \PhpGedcom\Parser\Indi\Famc::parse($parser); - if ($famc) { - $indi->addFamc($famc); - } - break; - case 'ASSO': - $asso = \PhpGedcom\Parser\Indi\Asso::parse($parser); - $indi->addAsso($asso); - break; - case 'ANCI': - $indi->addAnci($parser->normalizeIdentifier($record[2])); - break; - case 'DESI': - $indi->addDesi($parser->normalizeIdentifier($record[2])); - break; - case 'SUBM': - $indi->addSubm($parser->normalizeIdentifier($record[2])); - break; - case 'REFN': - $ref = \PhpGedcom\Parser\Refn::parse($parser); - $indi->addRefn($ref); - break; - case 'BAPL': - case 'CONL': - case 'ENDL': - case 'SLGC': - $className = ucfirst(strtolower($recordType)); - $class = '\\PhpGedcom\\Parser\\Indi\\' . $className; - - $lds = $class::parse($parser); - $indi->{'set' . $recordType}($lds); - break; - case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); - $indi->addObje($obje); - break; - case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); - if ($note) { - $indi->addNote($note); - } - break; - case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); - $indi->addSour($sour); - break; - case 'ADOP': - case 'BIRT': - case 'BAPM': - case 'BARM': - case 'BASM': - case 'BLES': - case 'BURI': - case 'CENS': - case 'CHR': - case 'CHRA': - case 'CONF': - case 'CREM': - case 'DEAT': - case 'EMIG': - case 'FCOM': - case 'GRAD': - case 'IMMI': - case 'NATU': - case 'ORDN': - case 'RETI': - case 'PROB': - case 'WILL': - case 'EVEN': - $className = ucfirst(strtolower($recordType)); - $class = '\\PhpGedcom\\Parser\\Indi\\' . $className; - - $event = $class::parse($parser); - $indi->addEven($event); - break; - case 'CAST': - case 'DSCR': - case 'EDUC': - case 'IDNO': - case 'NATI': - case 'NCHI': - case 'NMR': - case 'OCCU': - case 'PROP': - case 'RELI': - case 'RESI': - case 'SSN': - case 'TITL': - $className = ucfirst(strtolower($recordType)); - $class = '\\PhpGedcom\\Parser\\Indi\\' . $className; - - $att = $class::parse($parser); - $indi->addAttr($att); - break; - default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); - } - - $parser->forward(); - } - - return $indi; - } -} diff --git a/library/PhpGedcom/Parser/Indi/Bapm.php b/library/PhpGedcom/Parser/Indi/Bapm.php deleted file mode 100644 index 57a18c56..00000000 --- a/library/PhpGedcom/Parser/Indi/Bapm.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Bapm extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Barm.php b/library/PhpGedcom/Parser/Indi/Barm.php deleted file mode 100644 index 9ff70285..00000000 --- a/library/PhpGedcom/Parser/Indi/Barm.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Barm extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Basm.php b/library/PhpGedcom/Parser/Indi/Basm.php deleted file mode 100644 index 6e055d72..00000000 --- a/library/PhpGedcom/Parser/Indi/Basm.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Basm extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Bles.php b/library/PhpGedcom/Parser/Indi/Bles.php deleted file mode 100644 index bf913000..00000000 --- a/library/PhpGedcom/Parser/Indi/Bles.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Bles extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Buri.php b/library/PhpGedcom/Parser/Indi/Buri.php deleted file mode 100644 index 0a430784..00000000 --- a/library/PhpGedcom/Parser/Indi/Buri.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Buri extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Cast.php b/library/PhpGedcom/Parser/Indi/Cast.php deleted file mode 100644 index a069d8d9..00000000 --- a/library/PhpGedcom/Parser/Indi/Cast.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Cast extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Cens.php b/library/PhpGedcom/Parser/Indi/Cens.php deleted file mode 100644 index c4f7a7b8..00000000 --- a/library/PhpGedcom/Parser/Indi/Cens.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Cens extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Chra.php b/library/PhpGedcom/Parser/Indi/Chra.php deleted file mode 100644 index 3fc584a9..00000000 --- a/library/PhpGedcom/Parser/Indi/Chra.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Chra extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Conf.php b/library/PhpGedcom/Parser/Indi/Conf.php deleted file mode 100644 index 012604d3..00000000 --- a/library/PhpGedcom/Parser/Indi/Conf.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Conf extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Crem.php b/library/PhpGedcom/Parser/Indi/Crem.php deleted file mode 100644 index b6c65a9d..00000000 --- a/library/PhpGedcom/Parser/Indi/Crem.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Crem extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Deat.php b/library/PhpGedcom/Parser/Indi/Deat.php deleted file mode 100644 index 09a535ab..00000000 --- a/library/PhpGedcom/Parser/Indi/Deat.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Deat extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Dscr.php b/library/PhpGedcom/Parser/Indi/Dscr.php deleted file mode 100644 index bfea1218..00000000 --- a/library/PhpGedcom/Parser/Indi/Dscr.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Dscr extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Educ.php b/library/PhpGedcom/Parser/Indi/Educ.php deleted file mode 100644 index cf11f840..00000000 --- a/library/PhpGedcom/Parser/Indi/Educ.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Educ extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Emig.php b/library/PhpGedcom/Parser/Indi/Emig.php deleted file mode 100644 index 0e316ac7..00000000 --- a/library/PhpGedcom/Parser/Indi/Emig.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Emig extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Even.php b/library/PhpGedcom/Parser/Indi/Even.php deleted file mode 100644 index 77cdd2e1..00000000 --- a/library/PhpGedcom/Parser/Indi/Even.php +++ /dev/null @@ -1,126 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -use PhpGedcom\Parser\Chan; - -/** - * - * - */ -class Even extends \PhpGedcom\Parser\Component -{ - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) - { - $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(empty($record[1])){ - $parser->skipToNextLevel($depth); - return null; - } - - $even = null; - - if (strtoupper(trim($record[1])) != 'EVEN') { - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); - $even = new $className(); - } else { - $even = new \PhpGedcom\Record\Indi\Even(); - } - - if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { - $even->setType(trim($record[1])); - } - - $parser->forward(); - - while (!$parser->eof()) { - $record = $parser->getCurrentLineRecord(); - $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - - if ($currentDepth <= $depth) { - $parser->back(); - break; - } - - switch ($recordType) { - case 'TYPE': - $even->setType(trim($record[2])); - break; - case 'DATE': - $even->setDate(trim($record[2])); - break; - case 'PLAC': - $plac = \PhpGedcom\Parser\Indi\Even\Plac::parse($parser); - $even->setPlac($plac); - break; - case 'ADDR': - $even->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); - break; - case 'PHON': - $phone = \PhpGedcom\Parser\Phone::parse($parser); - $even->addPhone($phone); - break; - case 'CAUS': - $even->setCaus(trim($record[2])); - break; - case 'AGE': - $even->setAge(trim($record[2])); - break; - case 'AGNC': - $even->setAgnc(trim($record[2])); - break; - case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); - $even->addSour($sour); - break; - case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); - $even->addObje($obje); - break; - case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); - if ($note) { - $even->addNote($note); - } - break; - case 'CHAN': - $change = Chan::parse($parser); - $even->setChan($change); - break; - default: - $self = get_called_class(); - $method = 'parse' . $recordType; - - if (method_exists($self, $method)) { - $self::$method($parser, $even); - } else { - $parser->logUnhandledRecord($self . ' @ ' . __LINE__); - $parser->skipToNextLevel($currentDepth); - } - } - - $parser->forward(); - } - - return $even; - } -} diff --git a/library/PhpGedcom/Parser/Indi/Fcom.php b/library/PhpGedcom/Parser/Indi/Fcom.php deleted file mode 100644 index 574632c9..00000000 --- a/library/PhpGedcom/Parser/Indi/Fcom.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Fcom extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Grad.php b/library/PhpGedcom/Parser/Indi/Grad.php deleted file mode 100644 index f2b903de..00000000 --- a/library/PhpGedcom/Parser/Indi/Grad.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Grad extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Idno.php b/library/PhpGedcom/Parser/Indi/Idno.php deleted file mode 100644 index 70ea56e4..00000000 --- a/library/PhpGedcom/Parser/Indi/Idno.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Idno extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Immi.php b/library/PhpGedcom/Parser/Indi/Immi.php deleted file mode 100644 index a775ffaa..00000000 --- a/library/PhpGedcom/Parser/Indi/Immi.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Immi extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Nati.php b/library/PhpGedcom/Parser/Indi/Nati.php deleted file mode 100644 index 2fdcb17e..00000000 --- a/library/PhpGedcom/Parser/Indi/Nati.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Nati extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Natu.php b/library/PhpGedcom/Parser/Indi/Natu.php deleted file mode 100644 index 9d7db0da..00000000 --- a/library/PhpGedcom/Parser/Indi/Natu.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Natu extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Nchi.php b/library/PhpGedcom/Parser/Indi/Nchi.php deleted file mode 100644 index 7543fcaa..00000000 --- a/library/PhpGedcom/Parser/Indi/Nchi.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Nchi extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Nmr.php b/library/PhpGedcom/Parser/Indi/Nmr.php deleted file mode 100644 index d939f1b7..00000000 --- a/library/PhpGedcom/Parser/Indi/Nmr.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Nmr extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Occu.php b/library/PhpGedcom/Parser/Indi/Occu.php deleted file mode 100644 index 9ebed462..00000000 --- a/library/PhpGedcom/Parser/Indi/Occu.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Occu extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Ordn.php b/library/PhpGedcom/Parser/Indi/Ordn.php deleted file mode 100644 index cdfa72af..00000000 --- a/library/PhpGedcom/Parser/Indi/Ordn.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Ordn extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Prob.php b/library/PhpGedcom/Parser/Indi/Prob.php deleted file mode 100644 index e266ff87..00000000 --- a/library/PhpGedcom/Parser/Indi/Prob.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Prob extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Prop.php b/library/PhpGedcom/Parser/Indi/Prop.php deleted file mode 100644 index 69d2cb96..00000000 --- a/library/PhpGedcom/Parser/Indi/Prop.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Prop extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Reli.php b/library/PhpGedcom/Parser/Indi/Reli.php deleted file mode 100644 index 766f6e57..00000000 --- a/library/PhpGedcom/Parser/Indi/Reli.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Reli extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Resi.php b/library/PhpGedcom/Parser/Indi/Resi.php deleted file mode 100644 index 991f3759..00000000 --- a/library/PhpGedcom/Parser/Indi/Resi.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Resi extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Reti.php b/library/PhpGedcom/Parser/Indi/Reti.php deleted file mode 100644 index b010fe5e..00000000 --- a/library/PhpGedcom/Parser/Indi/Reti.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Reti extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Ssn.php b/library/PhpGedcom/Parser/Indi/Ssn.php deleted file mode 100644 index 01e4caca..00000000 --- a/library/PhpGedcom/Parser/Indi/Ssn.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Ssn extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Titl.php b/library/PhpGedcom/Parser/Indi/Titl.php deleted file mode 100644 index 8ba3c2e0..00000000 --- a/library/PhpGedcom/Parser/Indi/Titl.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Titl extends \PhpGedcom\Parser\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Parser/Indi/Will.php b/library/PhpGedcom/Parser/Indi/Will.php deleted file mode 100644 index 4173fdb7..00000000 --- a/library/PhpGedcom/Parser/Indi/Will.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Parser\Indi; - -/** - * - * - */ -class Will extends \PhpGedcom\Parser\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Chan.php b/library/PhpGedcom/Record/Chan.php deleted file mode 100644 index 05026fdf..00000000 --- a/library/PhpGedcom/Record/Chan.php +++ /dev/null @@ -1,93 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record; - -use PhpGedcom\Record; - -/** - * Class Chan - * @package PhpGedcom\Record - */ -class Chan extends Record -{ - /** - * @var string - */ - protected $date; - - /** - * @var string - */ - protected $time; - - /** - * @var array - */ - protected $note = array(); - - /** - * @param string $date - * @return Chan - */ - public function setDate($date = '') - { - $this->date = $date; - return $this; - } - - /** - * @return string - */ - public function getDate() - { - return $this->date; - } - - /** - * @param Record\NoteRef $note - * @return Chan - */ - public function addNote($note = []) - { - $this->note[] = $note; - return $this; - } - - /** - * @return array - */ - public function getNote() - { - return $this->note; - } - - /** - * @param string $time - * @return Chan - */ - public function setTime($time = '') - { - $this->time = $time; - return $this; - } - - /** - * @return string - */ - public function getTime() - { - return $this->time; - } -} diff --git a/library/PhpGedcom/Record/Fam.php b/library/PhpGedcom/Record/Fam.php deleted file mode 100644 index 5ad42682..00000000 --- a/library/PhpGedcom/Record/Fam.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record; - -/** - * - * - */ -class Fam extends \PhpGedcom\Record implements Noteable, Sourceable, Objectable -{ - /** - * - */ - protected $_id = null; - - /** - * - */ - protected $_chan = null; - - /** - * - */ - protected $_husb = null; - - /** - * - */ - protected $_wife = null; - - /** - * - */ - protected $_nchi = null; - - /** - * - */ - protected $_chil = array(); - - /** - * - */ - protected $_even = array(); - - /** - * - */ - protected $_slgs = array(); - - /** - * - */ - protected $_subm = array(); - - /** - * - */ - protected $_refn = array(); - - /** - * - */ - protected $_rin = null; - - /** - * - */ - protected $_note = array(); - - /** - * - */ - protected $_sour = array(); - - /** - * - */ - protected $_obje = array(); - - /** - * - */ - public function addEven($even = []) - { - $this->_even[$even->getType()] = $even; - } - - /** - * @return array - */ - public function getAllEven() - { - return $this->_even; - } - - /** - * @return array - */ - public function getEven($key = '') - { - if(isset($this->_even[strtoupper($key)])) - return $this->_even[strtoupper($key)]; - } - - /** - * - */ - public function addSlgs($slgs = []) - { - $this->_slgs[] = $slgs; - } - - /** - * - * - */ - public function addRefn($refn = []) - { - $this->_refn[] = $refn; - } - - /** - * - */ - public function addNote($note = []) - { - $this->_note[] = $note; - } - - /** - * - */ - public function addSour($sour = []) - { - $this->_sour[] = $sour; - } - - /** - * - */ - public function addObje($obje = []) - { - $this->_obje[] = $obje; - } -} diff --git a/library/PhpGedcom/Record/Fam/Anul.php b/library/PhpGedcom/Record/Fam/Anul.php deleted file mode 100644 index 2a3c8ef6..00000000 --- a/library/PhpGedcom/Record/Fam/Anul.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Anul extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Cens.php b/library/PhpGedcom/Record/Fam/Cens.php deleted file mode 100644 index 1a8ee4a8..00000000 --- a/library/PhpGedcom/Record/Fam/Cens.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Cens extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Enga.php b/library/PhpGedcom/Record/Fam/Enga.php deleted file mode 100644 index 8ef9efb1..00000000 --- a/library/PhpGedcom/Record/Fam/Enga.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Enga extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Even.php b/library/PhpGedcom/Record/Fam/Even.php deleted file mode 100644 index 878a83e2..00000000 --- a/library/PhpGedcom/Record/Fam/Even.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -use \PhpGedcom\Record\Objectable; -use \PhpGedcom\Record\Sourceable; -use \PhpGedcom\Record\Noteable; - -/** - * - */ -class Even extends \PhpGedcom\Record implements Objectable, Sourceable, Noteable -{ - protected $_type = null; - protected $_date = null; - protected $_plac = null; - protected $_caus = null; - protected $_age = null; - - protected $_addr = null; - - protected $_phon = array(); - - protected $_agnc = null; - - protected $_husb = null; - protected $_wife = null; - - /** - * - */ - protected $_obje = array(); - - /** - * - */ - protected $_sour = array(); - - /** - * - */ - protected $_note = array(); - - /** - * - */ - public function addPhon($phon = []) - { - $this->_phon[] = $phon; - } - - /** - * - */ - public function addObje($obje = []) - { - $this->_obje[] = $obje; - } - - /** - * - */ - public function addSour($sour = []) - { - $this->_sour[] = $sour; - } - - /** - * - */ - public function addNote($note = []) - { - $this->_note[] = $note; - } -} diff --git a/library/PhpGedcom/Record/Fam/Even/Husb.php b/library/PhpGedcom/Record/Fam/Even/Husb.php deleted file mode 100644 index 1b0a63d6..00000000 --- a/library/PhpGedcom/Record/Fam/Even/Husb.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam\Even; - -/** - * - */ -class Husb extends \PhpGedcom\Record -{ - protected $_age = null; -} diff --git a/library/PhpGedcom/Record/Fam/Even/Wife.php b/library/PhpGedcom/Record/Fam/Even/Wife.php deleted file mode 100644 index 53e4e566..00000000 --- a/library/PhpGedcom/Record/Fam/Even/Wife.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam\Even; - -/** - * - */ -class Wife extends \PhpGedcom\Record -{ - protected $_age = null; -} diff --git a/library/PhpGedcom/Record/Fam/Marb.php b/library/PhpGedcom/Record/Fam/Marb.php deleted file mode 100644 index d86bc453..00000000 --- a/library/PhpGedcom/Record/Fam/Marb.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Marb extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Marc.php b/library/PhpGedcom/Record/Fam/Marc.php deleted file mode 100644 index 39cbcf33..00000000 --- a/library/PhpGedcom/Record/Fam/Marc.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Marc extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Marl.php b/library/PhpGedcom/Record/Fam/Marl.php deleted file mode 100644 index b84382e3..00000000 --- a/library/PhpGedcom/Record/Fam/Marl.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Marl extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Marr.php b/library/PhpGedcom/Record/Fam/Marr.php deleted file mode 100644 index 08669880..00000000 --- a/library/PhpGedcom/Record/Fam/Marr.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Marr extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Fam/Mars.php b/library/PhpGedcom/Record/Fam/Mars.php deleted file mode 100644 index 515e1597..00000000 --- a/library/PhpGedcom/Record/Fam/Mars.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Fam; - -/** - * - */ -class Mars extends \PhpGedcom\Record\Fam\Even -{ -} diff --git a/library/PhpGedcom/Record/Head/Char.php b/library/PhpGedcom/Record/Head/Char.php deleted file mode 100644 index 483f941e..00000000 --- a/library/PhpGedcom/Record/Head/Char.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Record\Head; - -/** - * - */ -class Char extends \PhpGedcom\Record -{ - protected $_char = null; - protected $_vers = null; -} diff --git a/library/PhpGedcom/Record/Head/Date.php b/library/PhpGedcom/Record/Head/Date.php deleted file mode 100644 index ff43532c..00000000 --- a/library/PhpGedcom/Record/Head/Date.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Head; - -/** - * - */ -class Date extends \PhpGedcom\Record -{ - protected $_date = null; - protected $_time = null; -} diff --git a/library/PhpGedcom/Record/Head/Sour/Data.php b/library/PhpGedcom/Record/Head/Sour/Data.php deleted file mode 100644 index 3247160e..00000000 --- a/library/PhpGedcom/Record/Head/Sour/Data.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Record\Head\Sour; - -/** - * - */ -class Data extends \PhpGedcom\Record -{ - protected $_data = null; - protected $_date = null; - protected $_copr = null; -} diff --git a/library/PhpGedcom/Record/Indi/Adop.php b/library/PhpGedcom/Record/Indi/Adop.php deleted file mode 100644 index ccc6ade1..00000000 --- a/library/PhpGedcom/Record/Indi/Adop.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Adop extends \PhpGedcom\Record\Indi\Even -{ - protected $_adop = null; - protected $_famc = null; -} diff --git a/library/PhpGedcom/Record/Indi/Attr.php b/library/PhpGedcom/Record/Indi/Attr.php deleted file mode 100644 index fac64c5b..00000000 --- a/library/PhpGedcom/Record/Indi/Attr.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -use \PhpGedcom\Record\Sourceable; -use \PhpGedcom\Record\Noteable; -use \PhpGedcom\Record\Objectable; - -/** - * - */ -class Attr extends \PhpGedcom\Record\Indi\Even implements Sourceable, Noteable, Objectable -{ - protected $type = null; - protected $_attr = null; - - /** - * - */ - protected $sour = array(); - - /** - * - */ - protected $note = array(); - - /** - * - */ - protected $obje = array(); - - /** - * - */ - public function addSour($sour = []) - { - $this->sour[] = $sour; - } - - /** - * - */ - public function addNote($note = []) - { - $this->note[] = $note; - } - - /** - * - */ - public function addObje($obje = []) - { - $this->obje[] = $obje; - } -} diff --git a/library/PhpGedcom/Record/Indi/Bapm.php b/library/PhpGedcom/Record/Indi/Bapm.php deleted file mode 100644 index 54db28e1..00000000 --- a/library/PhpGedcom/Record/Indi/Bapm.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Bapm extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Barm.php b/library/PhpGedcom/Record/Indi/Barm.php deleted file mode 100644 index e1a5591b..00000000 --- a/library/PhpGedcom/Record/Indi/Barm.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Barm extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Basm.php b/library/PhpGedcom/Record/Indi/Basm.php deleted file mode 100644 index a108f07f..00000000 --- a/library/PhpGedcom/Record/Indi/Basm.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Basm extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Bles.php b/library/PhpGedcom/Record/Indi/Bles.php deleted file mode 100644 index 326b47e0..00000000 --- a/library/PhpGedcom/Record/Indi/Bles.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Bles extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Buri.php b/library/PhpGedcom/Record/Indi/Buri.php deleted file mode 100644 index bb4e2e4c..00000000 --- a/library/PhpGedcom/Record/Indi/Buri.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Buri extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Cast.php b/library/PhpGedcom/Record/Indi/Cast.php deleted file mode 100644 index bd699f42..00000000 --- a/library/PhpGedcom/Record/Indi/Cast.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Cast extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Cens.php b/library/PhpGedcom/Record/Indi/Cens.php deleted file mode 100644 index 2645250d..00000000 --- a/library/PhpGedcom/Record/Indi/Cens.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Cens extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Chr.php b/library/PhpGedcom/Record/Indi/Chr.php deleted file mode 100644 index 297965f1..00000000 --- a/library/PhpGedcom/Record/Indi/Chr.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Chr extends \PhpGedcom\Record\Indi\Even -{ - protected $_famc = null; -} diff --git a/library/PhpGedcom/Record/Indi/Chra.php b/library/PhpGedcom/Record/Indi/Chra.php deleted file mode 100644 index 27c5801b..00000000 --- a/library/PhpGedcom/Record/Indi/Chra.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Chra extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Conf.php b/library/PhpGedcom/Record/Indi/Conf.php deleted file mode 100644 index 92e8de1e..00000000 --- a/library/PhpGedcom/Record/Indi/Conf.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Conf extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Crem.php b/library/PhpGedcom/Record/Indi/Crem.php deleted file mode 100644 index 82fe24bc..00000000 --- a/library/PhpGedcom/Record/Indi/Crem.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Crem extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Deat.php b/library/PhpGedcom/Record/Indi/Deat.php deleted file mode 100644 index 52cdf269..00000000 --- a/library/PhpGedcom/Record/Indi/Deat.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Deat extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Dscr.php b/library/PhpGedcom/Record/Indi/Dscr.php deleted file mode 100644 index a0352b10..00000000 --- a/library/PhpGedcom/Record/Indi/Dscr.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Dscr extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Educ.php b/library/PhpGedcom/Record/Indi/Educ.php deleted file mode 100644 index e4de5efa..00000000 --- a/library/PhpGedcom/Record/Indi/Educ.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Educ extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Emig.php b/library/PhpGedcom/Record/Indi/Emig.php deleted file mode 100644 index 1405bfb2..00000000 --- a/library/PhpGedcom/Record/Indi/Emig.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Emig extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Fcom.php b/library/PhpGedcom/Record/Indi/Fcom.php deleted file mode 100644 index bb7da01f..00000000 --- a/library/PhpGedcom/Record/Indi/Fcom.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Fcom extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Grad.php b/library/PhpGedcom/Record/Indi/Grad.php deleted file mode 100644 index ae5baad7..00000000 --- a/library/PhpGedcom/Record/Indi/Grad.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Grad extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Idno.php b/library/PhpGedcom/Record/Indi/Idno.php deleted file mode 100644 index b9395a36..00000000 --- a/library/PhpGedcom/Record/Indi/Idno.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Idno extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Immi.php b/library/PhpGedcom/Record/Indi/Immi.php deleted file mode 100644 index 7312fece..00000000 --- a/library/PhpGedcom/Record/Indi/Immi.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Immi extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Name.php b/library/PhpGedcom/Record/Indi/Name.php deleted file mode 100644 index 47508b24..00000000 --- a/library/PhpGedcom/Record/Indi/Name.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Name extends \PhpGedcom\Record implements \PhpGedcom\Record\Sourceable -{ - protected $_name = null; - protected $_npfx = null; - protected $_givn = null; - protected $_nick = null; - protected $_spfx = null; - protected $_surn = null; - protected $_nsfx = null; - - /** - * - */ - protected $_note = array(); - - /** - * - */ - protected $_sour = array(); - - /** - * - */ - public function addSour($sour = []) - { - $this->_sour[] = $sour; - } - - /** - * - */ - public function addNote($note = []) - { - $this->_note[] = $note; - } -} diff --git a/library/PhpGedcom/Record/Indi/Nati.php b/library/PhpGedcom/Record/Indi/Nati.php deleted file mode 100644 index d7dfd62b..00000000 --- a/library/PhpGedcom/Record/Indi/Nati.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Nati extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Natu.php b/library/PhpGedcom/Record/Indi/Natu.php deleted file mode 100644 index 06e85df4..00000000 --- a/library/PhpGedcom/Record/Indi/Natu.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Natu extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Nchi.php b/library/PhpGedcom/Record/Indi/Nchi.php deleted file mode 100644 index 157fb6b3..00000000 --- a/library/PhpGedcom/Record/Indi/Nchi.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Nchi extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Nmr.php b/library/PhpGedcom/Record/Indi/Nmr.php deleted file mode 100644 index 50ac5022..00000000 --- a/library/PhpGedcom/Record/Indi/Nmr.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Nmr extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Note.php b/library/PhpGedcom/Record/Indi/Note.php deleted file mode 100644 index 7d43efca..00000000 --- a/library/PhpGedcom/Record/Indi/Note.php +++ /dev/null @@ -1,18 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Record\Indi; - -class Note extends \PhpGedcom\Record\NoteRefAbstract -{ -} diff --git a/library/PhpGedcom/Record/Indi/Occu.php b/library/PhpGedcom/Record/Indi/Occu.php deleted file mode 100644 index 3a1e4ced..00000000 --- a/library/PhpGedcom/Record/Indi/Occu.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Occu extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Ordn.php b/library/PhpGedcom/Record/Indi/Ordn.php deleted file mode 100644 index 1f452979..00000000 --- a/library/PhpGedcom/Record/Indi/Ordn.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Ordn extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Prob.php b/library/PhpGedcom/Record/Indi/Prob.php deleted file mode 100644 index 4484c429..00000000 --- a/library/PhpGedcom/Record/Indi/Prob.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Prob extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Prop.php b/library/PhpGedcom/Record/Indi/Prop.php deleted file mode 100644 index fa929767..00000000 --- a/library/PhpGedcom/Record/Indi/Prop.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Prop extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Reli.php b/library/PhpGedcom/Record/Indi/Reli.php deleted file mode 100644 index 0c2d27f2..00000000 --- a/library/PhpGedcom/Record/Indi/Reli.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Reli extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Resi.php b/library/PhpGedcom/Record/Indi/Resi.php deleted file mode 100644 index f2848473..00000000 --- a/library/PhpGedcom/Record/Indi/Resi.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Resi extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Reti.php b/library/PhpGedcom/Record/Indi/Reti.php deleted file mode 100644 index 321a4c8f..00000000 --- a/library/PhpGedcom/Record/Indi/Reti.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Reti extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/Indi/Ssn.php b/library/PhpGedcom/Record/Indi/Ssn.php deleted file mode 100644 index 52b35b8f..00000000 --- a/library/PhpGedcom/Record/Indi/Ssn.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Ssn extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Titl.php b/library/PhpGedcom/Record/Indi/Titl.php deleted file mode 100644 index 901141db..00000000 --- a/library/PhpGedcom/Record/Indi/Titl.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Titl extends \PhpGedcom\Record\Indi\Attr -{ -} diff --git a/library/PhpGedcom/Record/Indi/Will.php b/library/PhpGedcom/Record/Indi/Will.php deleted file mode 100644 index 61a1f1a9..00000000 --- a/library/PhpGedcom/Record/Indi/Will.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Indi; - -/** - * - */ -class Will extends \PhpGedcom\Record\Indi\Even -{ -} diff --git a/library/PhpGedcom/Record/ObjeRef.php b/library/PhpGedcom/Record/ObjeRef.php deleted file mode 100644 index eb56fc86..00000000 --- a/library/PhpGedcom/Record/ObjeRef.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record; - -/** - * - */ -class ObjeRef extends \PhpGedcom\Record implements Noteable -{ - /** - * - */ - protected $_isRef = false; - - /** - * - */ - protected $_obje = null; - - /** - * - */ - protected $_form = null; - - /** - * - */ - protected $_titl = null; - - /** - * - */ - protected $_file = null; - - /** - * - */ - protected $_note = array(); - - /** - * - */ - public function setIsReference($isReference = true) - { - $this->_isRef = $isReference; - } - - /** - * - */ - public function getIsReference() - { - return $this->_isRef; - } - - /** - * - */ - public function addNote($note = []) - { - $this->_note[] = $note; - } -} diff --git a/library/PhpGedcom/Record/Sour/Data.php b/library/PhpGedcom/Record/Sour/Data.php deleted file mode 100644 index f7644ed6..00000000 --- a/library/PhpGedcom/Record/Sour/Data.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Sour; - -use \PhpGedcom\Record\Noteable; - -/** - * - */ -class Data extends \PhpGedcom\Record implements Noteable -{ - protected $_even = array(); - protected $_agnc = null; - protected $_date = null; - - protected $_text = array(); - - /** - * - */ - protected $_note = array(); - - /** - * - */ - public function addText($text = []) - { - $this->_text[] = $text; - } - - /** - * - */ - public function addNote($note = []) - { - $this->_note[] = $note; - } -} diff --git a/library/PhpGedcom/Record/Sour/Data/Even.php b/library/PhpGedcom/Record/Sour/Data/Even.php deleted file mode 100644 index 060ea019..00000000 --- a/library/PhpGedcom/Record/Sour/Data/Even.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\Sour\Data; - -/** - * - */ -class Even extends \PhpGedcom\Record -{ - protected $_date = null; - protected $_plac = null; -} diff --git a/library/PhpGedcom/Record/SourRef.php b/library/PhpGedcom/Record/SourRef.php deleted file mode 100644 index 41ba1597..00000000 --- a/library/PhpGedcom/Record/SourRef.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record; - -/** - * - */ -class SourRef extends \PhpGedcom\Record -{ - protected $_isRef = false; - - protected $_sour = null; - protected $_page = null; - protected $_even = null; - protected $_data = null; - protected $_quay = null; - protected $_text = null; - - protected $_obje = array(); - protected $_note = array(); -} diff --git a/library/PhpGedcom/Record/SourRef/Even.php b/library/PhpGedcom/Record/SourRef/Even.php deleted file mode 100644 index cc7dfbfe..00000000 --- a/library/PhpGedcom/Record/SourRef/Even.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Record\SourRef; - -/** - * - */ -class Even extends \PhpGedcom\Record -{ - protected $_even = null; - protected $_role = null; -} diff --git a/library/PhpGedcom/Writer.php b/library/PhpGedcom/Writer.php deleted file mode 100644 index 0e1524d9..00000000 --- a/library/PhpGedcom/Writer.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom; - -use \PhpGedcom\Gedcom; -use \PhpGedcom\Writer\Head; - -/** - * - */ -class Writer -{ - const GEDCOM55 = 'gedcom5.5'; - - protected $_output = null; - - /** - * - * @param \PhpGedcom\Gedcom $gedcom The GEDCOM object - * @param string $format The format to convert the GEDCOM object to - * @return string The contents of the document in the converted format - */ - public static function convert(Gedcom $gedcom, $format = self::GEDCOM55) - { - $head = $gedcom->getHead(); - - $output = Head::convert($head, $format); - - return $output; - } -} diff --git a/library/PhpGedcom/Writer/Addr.php b/library/PhpGedcom/Writer/Addr.php deleted file mode 100644 index 200272f3..00000000 --- a/library/PhpGedcom/Writer/Addr.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Writer; - -/** - * - */ -class Addr -{ - /** - * @param \PhpGedcom\Record\Addr $addr - * @param string $format - * @param int $level - * @return string - */ - public static function convert(\PhpGedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1) - { - $addrs = explode("\n", $addr->addr); - - $output = "{$level} ADDR " . $addrs[0] . "\n"; - - array_shift($addrs); - - foreach ($addrs as $cont) { - $output .= ($level+1) . " CONT " . $cont . "\n"; - } - - $output .= ($level+1) . " ADR1 " . $addr->adr1 . "\n" . - ($level+1) . " ADR2 " . $addr->adr2 . "\n" . - ($level+1) . " CITY " . $addr->city . "\n" . - ($level+1) . " STAE " . $addr->stae . "\n" . - ($level+1) . " POST " . $addr->post . "\n" . - ($level+1) . " CTRY " . $addr->ctry . "\n"; - - return $output; - } -} diff --git a/library/PhpGedcom/Writer/Head.php b/library/PhpGedcom/Writer/Head.php deleted file mode 100644 index 47874d63..00000000 --- a/library/PhpGedcom/Writer/Head.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Writer; - -/** - * - */ -class Head -{ - /** - * @param \PhpGedcom\Record\Head $head - * @param string $format - * @return string - */ - public static function convert(\PhpGedcom\Record\Head &$head, $format = self::GEDCOM55) - { - $output = "0 HEAD\n" . - - ($head->getSour() ? Head\Sour::convert($head->getSour(), $format) : '') . - //"1 DEST " . $head-> . "\n" . - "1 DATE " . date("d M Y") . "\n" . - "2 TIME " . date("H:i:s") . "\n"; - - /* - +1 SUBM @@ {1:1} - +1 SUBN @@ {0:1} - +1 FILE {0:1} - +1 COPR {0:1} - +1 GEDC {1:1} - +2 VERS {1:1} - +2 FORM {1:1} - +1 CHAR {1:1} - +2 VERS {0:1} - +1 LANG {0:1} - +1 PLAC {0:1} - +2 FORM {1:1} - +1 NOTE {0:1} - +2 [CONT|CONC] {0:M} - */ - - return $output; - } -} diff --git a/library/PhpGedcom/Writer/Head/Sour.php b/library/PhpGedcom/Writer/Head/Sour.php deleted file mode 100644 index e218170d..00000000 --- a/library/PhpGedcom/Writer/Head/Sour.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Writer\Head; - -/** - * - */ -class Sour -{ - /** - * @param \PhpGedcom\Record\Head\Sour $sour - * @param string $format - * @param int $level - * @return string - */ - public static function convert(\PhpGedcom\Record\Head\Sour &$sour, $format = self::GEDCOM55, $level = 0) - { - $output = "1 SOUR " . $sour->sour . "\n" . - "2 VERS " . $sour->vers . "\n" . - \PhpGedcom\Writer\Head\Sour\Corp::convert($sour->corp, $format, 2) . - // TODO DATA; - ""; - - /* - +2 DATA {0:1} - +3 DATE {0:1} - +3 COPR {0:1} - */ - - return $output; - } -} diff --git a/library/PhpGedcom/Writer/Head/Sour/Corp.php b/library/PhpGedcom/Writer/Head/Sour/Corp.php deleted file mode 100644 index d1e8b418..00000000 --- a/library/PhpGedcom/Writer/Head/Sour/Corp.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 - * @link http://github.com/mrkrstphr/php-gedcom - */ - -namespace PhpGedcom\Writer\Head\Sour; - -/** - * - */ -class Corp -{ - /** - * @param \PhpGedcom\Record\Head\Sour\Corp $corp - * @param string $format - * @param int $level - * @return string - */ - public static function convert(\PhpGedcom\Record\Head\Sour\Corp &$corp, $format = self::GEDCOM55, $level = 2) - { - $output = "{$level} CORP " . $corp->corp . "\n" . - \PhpGedcom\Writer\Addr::convert($corp->addr, $format, $level + 1); - - foreach ($corp->phon as $phon) { - $output .= \PhpGedcom\Writer\Phon::convert($phon, $format, $level + 1); - } - - return $output; - } -} diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..5d5ce730 --- /dev/null +++ b/rector.php @@ -0,0 +1,22 @@ +import(SetList::PHP_80); + // get parameters + $parameters = $containerConfigurator->parameters(); + + // Define what rule sets will be applied + $containerConfigurator->import(SetList::DEAD_CODE); + + // get services (needed for register a single rule) + // $services = $containerConfigurator->services(); + + // register a single rule + // $services->set(TypedPropertyRector::class); +}; diff --git a/library/PhpGedcom/Gedcom.php b/src/Gedcom.php similarity index 68% rename from library/PhpGedcom/Gedcom.php rename to src/Gedcom.php index b5e317df..20cca366 100644 --- a/library/PhpGedcom/Gedcom.php +++ b/src/Gedcom.php @@ -1,131 +1,123 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom; +namespace Gedcom; /** - * Class Gedcom - * @package PhpGedcom + * Class Gedcom. */ class Gedcom { /** * Stores the header information of the GEDCOM file. * - * @var \PhpGedcom\Record\Head + * @var \Gedcom\Record\Head */ protected $head; /** * Stores the submission information for the GEDCOM file. * - * @var \PhpGedcom\Record\Subn + * @var \Gedcom\Record\Subn */ protected $subn; /** * Stores sources cited throughout the GEDCOM file. * - * @var \PhpGedcom\Record\Sour[] + * @var \Gedcom\Record\Sour[] */ - protected $sour = array(); + protected $sour = []; /** * Stores all the individuals contained within the GEDCOM file. * - * @var \PhpGedcom\Record\Indi[] + * @var \Gedcom\Record\Indi[] */ - protected $indi = array(); + protected $indi = []; /** * Stores all the individuals contained within the GEDCOM file. * * @var array */ - protected $uid2indi = array(); + protected $uid2indi = []; /** * Stores all the families contained within the GEDCOM file. * - * @var \PhpGedcom\Record\Fam[] + * @var \Gedcom\Record\Fam[] */ - protected $fam = array(); + protected $fam = []; /** * Stores all the notes contained within the GEDCOM file that are not inline. * - * @var \PhpGedcom\Record\Note[] + * @var \Gedcom\Record\Note[] */ - protected $note = array(); + protected $note = []; /** * Stores all repositories that are contained within the GEDCOM file and referenced by sources. * - * @var \PhpGedcom\Record\Repo[] + * @var \Gedcom\Record\Repo[] */ - protected $repo = array(); + protected $repo = []; /** * Stores all the media objects that are contained within the GEDCOM file. * - * @var \PhpGedcom\Record\Obje[] + * @var \Gedcom\Record\Obje[] */ - protected $obje = array(); + protected $obje = []; /** * Stores information about all the submitters to the GEDCOM file. * - * @var \PhpGedcom\Record\Subm[] + * @var \Gedcom\Record\Subm[] */ - protected $subm = array(); + protected $subm = []; /** * Retrieves the header record of the GEDCOM file. - * - * @param Record\Head $head */ - public function setHead(Record\Head $head) + public function setHead(\Gedcom\Record\Head $head) { $this->head = $head; } /** * Retrieves the submission record of the GEDCOM file. - * - * @param Record\Subn $subn */ - public function setSubn(Record\Subn $subn) + public function setSubn(\Gedcom\Record\Subn $subn) { $this->subn = $subn; } /** * Adds a source to the collection of sources. - * - * @param Record\Sour $sour */ - public function addSour(Record\Sour $sour) + public function addSour(\Gedcom\Record\Sour $sour) { $this->sour[$sour->getSour()] = $sour; } /** * Adds an individual to the collection of individuals. - * - * @param Record\Indi $indi */ - public function addIndi(Record\Indi $indi) + public function addIndi(\Gedcom\Record\Indi $indi) { $this->indi[$indi->getId()] = $indi; if ($indi->getUid()) { @@ -135,50 +127,40 @@ public function addIndi(Record\Indi $indi) /** * Adds a family to the collection of families. - * - * @param Record\Fam $fam */ - public function addFam(Record\Fam $fam) + public function addFam(\Gedcom\Record\Fam $fam) { $this->fam[$fam->getId()] = $fam; } /** * Adds a note to the collection of notes. - * - * @param Record\Note $note */ - public function addNote(Record\Note $note) + public function addNote(\Gedcom\Record\Note $note) { $this->note[$note->getId()] = $note; } /** * Adds a repository to the collection of repositories. - * - * @param Record\Repo $repo */ - public function addRepo(Record\Repo $repo) + public function addRepo(\Gedcom\Record\Repo $repo) { $this->repo[$repo->getRepo()] = $repo; } /** * Adds an object to the collection of objects. - * - * @param Record\Obje $obje */ - public function addObje(Record\Obje $obje) + public function addObje(\Gedcom\Record\Obje $obje) { $this->obje[$obje->getId()] = $obje; } /** * Adds a submitter record to the collection of submitters. - * - * @param Record\Subm $subm */ - public function addSubm(Record\Subm $subm) + public function addSubm(\Gedcom\Record\Subm $subm) { $this->subm[$subm->getSubm()] = $subm; } @@ -186,7 +168,7 @@ public function addSubm(Record\Subm $subm) /** * Gets the header information of the GEDCOM file. * - * @return Record\Head + * @return \Gedcom\Record\Head */ public function getHead() { @@ -196,7 +178,7 @@ public function getHead() /** * Gets the submission record of the GEDCOM file. * - * @return Record\Subn + * @return \Gedcom\Record\Subn */ public function getSubn() { @@ -206,7 +188,7 @@ public function getSubn() /** * Gets the collection of submitters to the GEDCOM file. * - * @return \PhpGedcom\Record\Subm[] + * @return \Gedcom\Record\Subm[] */ public function getSubm() { @@ -216,7 +198,7 @@ public function getSubm() /** * Gets the collection of individuals stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Indi[] + * @return \Gedcom\Record\Indi[] */ public function getIndi() { @@ -226,7 +208,7 @@ public function getIndi() /** * Gets the collection of families stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Fam[] + * @return \Gedcom\Record\Fam[] */ public function getFam() { @@ -236,7 +218,7 @@ public function getFam() /** * Gets the collection of repositories stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Repo[] + * @return \Gedcom\Record\Repo[] */ public function getRepo() { @@ -246,7 +228,7 @@ public function getRepo() /** * Gets the collection of sources stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Sour[] + * @return \Gedcom\Record\Sour[] */ public function getSour() { @@ -256,7 +238,7 @@ public function getSour() /** * Gets the collection of note stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Note[] + * @return \Gedcom\Record\Note[] */ public function getNote() { @@ -266,7 +248,7 @@ public function getNote() /** * Gets the collection of objects stored in the GEDCOM file. * - * @return \PhpGedcom\Record\Obje[] + * @return \Gedcom\Record\Obje[] */ public function getObje() { diff --git a/library/PhpGedcom/Parser.php b/src/Parser.php similarity index 56% rename from library/PhpGedcom/Parser.php rename to src/Parser.php index eb22212e..3c3ee40c 100644 --- a/library/PhpGedcom/Parser.php +++ b/src/Parser.php @@ -1,79 +1,46 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom; +namespace Gedcom; -/** - * - */ class Parser { - /** - * - */ - protected $_file = null; + protected $_file; - /** - * - */ - protected $_gedcom = null; + protected $_gedcom; - /** - * - */ - protected $_errorLog = array(); + protected $_errorLog = []; - /** - * - */ - protected $_linesParsed = 0; + protected $_linesParsed = 0; - /** - * - */ - protected $_line = ''; + protected $_line = ''; - /** - * - */ - protected $_lineRecord = null; + protected $_lineRecord; - /** - * - */ - protected $_linePices = 0; + protected $_linePieces = 0; - /** - * - */ - protected $_returnedLine = ''; + protected $_returnedLine = ''; - /** - * - */ - public function __construct(\PhpGedcom\Gedcom $gedcom = null) + public function __construct(Gedcom $gedcom = null) { if (!is_null($gedcom)) { $this->_gedcom = $gedcom; } else { - $this->_gedcom = new \PhpGedcom\Gedcom(); + $this->_gedcom = new Gedcom(); } } - /** - * - */ public function forward() { // if there was a returned line by back(), set that as our current @@ -92,9 +59,6 @@ public function forward() return $this; } - /** - * - */ public function back() { // our parser object encountered a line it wasn't meant to parse @@ -118,37 +82,30 @@ public function skipToNextLevel($level) while ($currentDepth > $level) { $this->forward(); $record = $this->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; } $this->back(); } - /** - * - */ public function getGedcom() { return $this->_gedcom; } - /** - * - */ public function eof() { return feof($this->_file); } /** - * * @return string */ public function parseMultiLineRecord() { $record = $this->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; $data = isset($record[2]) ? trim($record[2]) : ''; $this->forward(); @@ -156,7 +113,7 @@ public function parseMultiLineRecord() while (!$this->eof()) { $record = $this->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $this->back(); @@ -164,21 +121,21 @@ public function parseMultiLineRecord() } switch ($recordType) { - case 'CONT': - $data .= "\n"; + case 'CONT': + $data .= "\n"; - if (isset($record[2])) { - $data .= trim($record[2]); - } - break; - case 'CONC': - if (isset($record[2])) { - $data .= ' ' . trim($record[2]); - } - break; - default: - $this->back(); - break 2; + if (isset($record[2])) { + $data .= trim($record[2]); + } + break; + case 'CONC': + if (isset($record[2])) { + $data .= ' '.trim($record[2]); + } + break; + default: + $this->back(); + break 2; } $this->forward(); @@ -188,7 +145,6 @@ public function parseMultiLineRecord() } /** - * * @return string The current line */ public function getCurrentLine() @@ -196,9 +152,6 @@ public function getCurrentLine() return $this->_line; } - /** - * - */ public function getCurrentLineRecord($pieces = 3) { if (!is_null($this->_lineRecord)) { @@ -219,60 +172,47 @@ public function getCurrentLineRecord($pieces = 3) return $this->_lineRecord; } - /** - * - */ protected function logError($error) { $this->_errorLog[] = $error; } - /** - * - */ public function logUnhandledRecord($additionalInfo = '') { $this->logError( - $this->_linesParsed . ': (Unhandled) ' . trim(implode('|', $this->getCurrentLineRecord())) . - (!empty($additionalInfo) ? ' - ' . $additionalInfo : '') + $this->_linesParsed.': (Unhandled) '.trim(implode('|', $this->getCurrentLineRecord())). + (!empty($additionalInfo) ? ' - '.$additionalInfo : '') ); } public function logSkippedRecord($additionalInfo = '') { $this->logError( - $this->_linesParsed . ': (Skipping) ' . trim(implode('|', $this->getCurrentLineRecord())) . - (!empty($additionalInfo) ? ' - ' . $additionalInfo : '') + $this->_linesParsed.': (Skipping) '.trim(implode('|', $this->getCurrentLineRecord())). + (!empty($additionalInfo) ? ' - '.$additionalInfo : '') ); } - /** - * - */ public function getErrors() { return $this->_errorLog; } - /** - * - */ public function normalizeIdentifier($identifier) { $identifier = trim($identifier); - $identifier = trim($identifier, '@'); - return $identifier; + return trim($identifier, '@'); } /** - * * @param string $fileName + * * @return Gedcom */ public function parse($fileName) { - $this->_file = fopen($fileName, 'r'); #explode("\n", mb_convert_encoding($contents, 'UTF-8')); + $this->_file = fopen($fileName, 'r'); //explode("\n", mb_convert_encoding($contents, 'UTF-8')); if (!$this->_file) { return null; @@ -287,43 +227,43 @@ public function parse($fileName) continue; } - $depth = (int)$record[0]; + $depth = (int) $record[0]; // We only process 0 level records here. Sub levels are processed // in methods for those data types (individuals, sources, etc) if ($depth == 0) { // Although not always an identifier (HEAD,TRLR): - if(isset($record[1])) - $identifier = $this->normalizeIdentifier($record[1]); - + if (isset($record[1])) { + $this->normalizeIdentifier($record[1]); + } if (isset($record[1]) && trim($record[1]) == 'HEAD') { - Parser\Head::parse($this); - } else if (isset($record[2]) && trim($record[2]) == 'SUBN') { - Parser\Subn::parse($this); - } else if (isset($record[2]) && trim($record[2]) == 'SUBM') { - Parser\Subm::parse($this); - } else if (isset($record[2]) && $record[2] == 'SOUR') { - Parser\Sour::parse($this); - } else if (isset($record[2]) && $record[2] == 'INDI') { - Parser\Indi::parse($this); - } else if (isset($record[2]) && $record[2] == 'FAM') { - Parser\Fam::parse($this); - } else if (isset($record[2]) && substr(trim($record[2]), 0, 4) == 'NOTE') { - Parser\Note::parse($this); - } else if (isset($record[2]) && $record[2] == 'REPO') { - Parser\Repo::parse($this); - } else if (isset($record[2]) && $record[2] == 'OBJE') { - Parser\Obje::parse($this); - } else if (isset($record[1]) && trim($record[1]) == 'TRLR') { + \Gedcom\Parser\Head::parse($this); + } elseif (isset($record[2]) && trim($record[2]) == 'SUBN') { + \Gedcom\Parser\Subn::parse($this); + } elseif (isset($record[2]) && trim($record[2]) == 'SUBM') { + \Gedcom\Parser\Subm::parse($this); + } elseif (isset($record[2]) && $record[2] == 'SOUR') { + \Gedcom\Parser\Sour::parse($this); + } elseif (isset($record[2]) && $record[2] == 'INDI') { + \Gedcom\Parser\Indi::parse($this); + } elseif (isset($record[2]) && $record[2] == 'FAM') { + \Gedcom\Parser\Fam::parse($this); + } elseif (isset($record[2]) && substr(trim($record[2]), 0, 4) == 'NOTE') { + \Gedcom\Parser\Note::parse($this); + } elseif (isset($record[2]) && $record[2] == 'REPO') { + \Gedcom\Parser\Repo::parse($this); + } elseif (isset($record[2]) && $record[2] == 'OBJE') { + \Gedcom\Parser\Obje::parse($this); + } elseif (isset($record[1]) && trim($record[1]) == 'TRLR') { // EOF break; } else { - $this->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $this->logUnhandledRecord(self::class.' @ '.__LINE__); } } else { - $this->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $this->logUnhandledRecord(self::class.' @ '.__LINE__); } $this->forward(); diff --git a/library/PhpGedcom/Parser/Addr.php b/src/Parser/Addr.php similarity index 63% rename from library/PhpGedcom/Parser/Addr.php rename to src/Parser/Addr.php index 1b0160e9..2dcfa390 100644 --- a/library/PhpGedcom/Parser/Addr.php +++ b/src/Parser/Addr.php @@ -1,44 +1,35 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Addr extends \PhpGedcom\Parser\Component +class Addr extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; $line = isset($record[2]) ? trim($record[2]) : ''; - $addr = new \PhpGedcom\Record\Addr(); + $addr = new \Gedcom\Record\Addr(); $addr->setAddr($line); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtolower(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -46,16 +37,16 @@ public static function parse(\PhpGedcom\Parser $parser) } if ($addr->hasAttribute($recordType)) { - $addr->{'set' . $recordType}(trim($record[2])); + $addr->{'set'.$recordType}(trim($record[2])); } else { if ($recordType == 'cont') { // FIXME: Can have CONT on multiple attributes - $addr->setAddr($addr->getAddr() . "\n"); + $addr->setAddr($addr->getAddr()."\n"); if (isset($record[2])) { - $addr->setAddr($addr->getAddr() . trim($record[2])); + $addr->setAddr($addr->getAddr().trim($record[2])); } } else { - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } } diff --git a/src/Parser/Birt.php b/src/Parser/Birt.php new file mode 100644 index 00000000..4cc08d5a --- /dev/null +++ b/src/Parser/Birt.php @@ -0,0 +1,57 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Birt extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + + $birt = new \Gedcom\Record\Birt(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = trim($record[1]); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $birt->setDate(trim($record[2])); + break; + case '_DATI': + $birt->setDati(trim($record[2])); + break; + case 'PLAC': + $birt->setPlac(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $birt; + } +} diff --git a/src/Parser/Buri.php b/src/Parser/Buri.php new file mode 100644 index 00000000..2bf72b8c --- /dev/null +++ b/src/Parser/Buri.php @@ -0,0 +1,57 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Buri extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + + $buri = new \Gedcom\Record\Buri(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = trim($record[1]); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $buri->setDate(trim($record[2])); + break; + case '_DATI': + $buri->setDati(trim($record[2])); + break; + case 'PLAC': + $buri->setPlac(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $buri; + } +} diff --git a/library/PhpGedcom/Parser/Caln.php b/src/Parser/Caln.php similarity index 55% rename from library/PhpGedcom/Parser/Caln.php rename to src/Parser/Caln.php index 75466449..0f5762f1 100644 --- a/library/PhpGedcom/Parser/Caln.php +++ b/src/Parser/Caln.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Caln extends \PhpGedcom\Parser\Component +class Caln extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $identifier = $parser->normalizeIdentifier($record[2]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $identifier = $parser->normalizeIdentifier($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $caln = new \PhpGedcom\Record\Caln(); + $caln = new \Gedcom\Record\Caln(); $caln->setCaln($identifier); $parser->forward(); @@ -45,7 +36,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtolower(trim($record[1])); - $lineDepth = (int)$record[0]; + $lineDepth = (int) $record[0]; if ($lineDepth <= $depth) { $parser->back(); @@ -53,9 +44,9 @@ public static function parse(\PhpGedcom\Parser $parser) } if ($caln->hasAttribute($recordType)) { - $caln->{'set' . $recordType}(trim($record[2])); + $caln->{'set'.$recordType}(trim($record[2])); } else { - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Chan.php b/src/Parser/Chan.php similarity index 68% rename from library/PhpGedcom/Parser/Chan.php rename to src/Parser/Chan.php index ca34d2f2..f7886fc5 100644 --- a/library/PhpGedcom/Parser/Chan.php +++ b/src/Parser/Chan.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Chan extends \PhpGedcom\Parser\Component +class Chan extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; $parser->forward(); - $chan = new \PhpGedcom\Record\Chan(); + $chan = new \Gedcom\Record\Chan(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = trim($record[1]); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -52,18 +43,21 @@ public static function parse(\PhpGedcom\Parser $parser) $chan->setTime(trim($record[2])); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $chan->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); } + $date = $chan->getYear().'-'.$chan->getMonth().'-'.$chan->getDay(); + $chan->setDatetime($date); + return $chan; } } diff --git a/src/Parser/Chr.php b/src/Parser/Chr.php new file mode 100644 index 00000000..dba2bb13 --- /dev/null +++ b/src/Parser/Chr.php @@ -0,0 +1,54 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Chr extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + + $chr = new \Gedcom\Record\Chr(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = trim($record[1]); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $chr->setDate(trim($record[2])); + break; + case 'PLAC': + $chr->setPlac(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $chr; + } +} diff --git a/library/PhpGedcom/Record/Fam/Div.php b/src/Parser/Component.php similarity index 67% rename from library/PhpGedcom/Record/Fam/Div.php rename to src/Parser/Component.php index 7ecafca2..3660e82d 100644 --- a/library/PhpGedcom/Record/Fam/Div.php +++ b/src/Parser/Component.php @@ -1,22 +1,22 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Fam; +namespace Gedcom\Parser; -/** - * - */ -class Div extends \PhpGedcom\Record\Fam\Even +abstract class Component { + public static function parse(\Gedcom\Parser $parser) + { + } } diff --git a/src/Parser/Date.php b/src/Parser/Date.php new file mode 100644 index 00000000..8dfacb49 --- /dev/null +++ b/src/Parser/Date.php @@ -0,0 +1,44 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Date extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + $record = $parser->getCurrentLineRecord(); + + if (isset($record[1])) { + $dat = new \Gedcom\Record\Date(); + if (!empty($record[2])) { + $dat->setDate($record[2]); + } + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + if ($dat->getYear() && $dat->getMonth() && $dat->getDay()) { + return $dat->getYear().'-'.substr("0{$dat->getMonth()}", -2).'-'.substr("0{$dat->getDay()}", -2); + } + + return $dat->getYear(); + } +} diff --git a/src/Parser/Deat.php b/src/Parser/Deat.php new file mode 100644 index 00000000..0f989ded --- /dev/null +++ b/src/Parser/Deat.php @@ -0,0 +1,60 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Deat extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + + $deat = new \Gedcom\Record\Deat(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = trim($record[1]); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $deat->setDate(trim($record[2])); + break; + case '_DATI': + $deat->setDati(trim($record[2])); + break; + case 'PLAC': + $deat->setPlac(trim($record[2])); + break; + case 'CAUS': + $deat->setCaus(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $deat; + } +} diff --git a/library/PhpGedcom/Parser/Fam.php b/src/Parser/Fam.php similarity index 71% rename from library/PhpGedcom/Parser/Fam.php rename to src/Parser/Fam.php index 5f9f3dfb..3b56c45c 100644 --- a/library/PhpGedcom/Parser/Fam.php +++ b/src/Parser/Fam.php @@ -1,26 +1,22 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Fam extends \PhpGedcom\Parser\Component +class Fam extends \Gedcom\Parser\Component { - protected static $_eventTypes = array( + protected static $_eventTypes = [ 'ANUL', 'CENS', 'DIV', @@ -30,26 +26,22 @@ class Fam extends \PhpGedcom\Parser\Component 'MARB', 'MARC', 'MARL', - 'MARS' - ); + 'MARS', + ]; - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $fam = new \PhpGedcom\Record\Fam(); + $fam = new \Gedcom\Record\Fam(); $fam->setId($identifier); $parser->getGedcom()->addFam($fam); @@ -58,7 +50,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -67,6 +59,26 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { + case 'RESN': + $fam->setResn(trim($record[2])); + break; + case 'EVEN': + case 'ANUL': + case 'CENS': + case 'DIV': + case 'DIVF': + case 'ENGA': + case 'MARR': + case 'MARB': + case 'MARC': + case 'MARL': + case 'MARS': + $className = ucfirst(strtolower($recordType)); + $class = '\\Gedcom\\Parser\\Fam\\'.$className; + + $even = $class::parse($parser); + $fam->addEven($even); + break; case 'HUSB': $fam->setHusb($parser->normalizeIdentifier($record[2])); break; @@ -82,54 +94,38 @@ public static function parse(\PhpGedcom\Parser $parser) case 'SUBM': $fam->addSubm($parser->normalizeIdentifier($record[2])); break; - case 'RIN': - $fam->setRin(trim($record[2])); - break; - case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); - $fam->setChan($chan); - break; case 'SLGS': - $slgs = \PhpGedcom\Parser\Fam\Slgs::parse($parser); + $slgs = \Gedcom\Parser\Fam\Slgs::parse($parser); $fam->addSlgs($slgs); break; case 'REFN': - $ref = \PhpGedcom\Parser\Refn::parse($parser); + $ref = \Gedcom\Parser\Refn::parse($parser); $fam->addRefn($ref); break; + case 'RIN': + $fam->setRin(trim($record[2])); + break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $fam->setChan($chan); + break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $fam->addNote($note); } break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $fam->addSour($sour); break; case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); + $obje = \Gedcom\Parser\ObjeRef::parse($parser); $fam->addObje($obje); break; - case 'EVEN': - case 'ANUL': - case 'CENS': - case 'DIV': - case 'DIVF': - case 'ENGA': - case 'MARR': - case 'MARB': - case 'MARC': - case 'MARL': - case 'MARS': - $className = ucfirst(strtolower($recordType)); - $class = '\\PhpGedcom\\Parser\\Fam\\' . $className; - $even = $class::parse($parser); - $fam->addEven($even); - break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Fam/Anul.php b/src/Parser/Fam/Anul.php new file mode 100644 index 00000000..c1ea4c8b --- /dev/null +++ b/src/Parser/Fam/Anul.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Anul extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Cens.php b/src/Parser/Fam/Cens.php new file mode 100644 index 00000000..5dc64ce4 --- /dev/null +++ b/src/Parser/Fam/Cens.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Cens extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Div.php b/src/Parser/Fam/Div.php new file mode 100644 index 00000000..d899a3e4 --- /dev/null +++ b/src/Parser/Fam/Div.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Div extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Divf.php b/src/Parser/Fam/Divf.php new file mode 100644 index 00000000..7517eee0 --- /dev/null +++ b/src/Parser/Fam/Divf.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Divf extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Enga.php b/src/Parser/Fam/Enga.php new file mode 100644 index 00000000..dcdbe168 --- /dev/null +++ b/src/Parser/Fam/Enga.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Enga extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Even.php b/src/Parser/Fam/Even.php new file mode 100644 index 00000000..3358afb7 --- /dev/null +++ b/src/Parser/Fam/Even.php @@ -0,0 +1,103 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Even extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $even = new \Gedcom\Record\Fam\Even(); + + if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { + $even->setType(trim($record[1])); + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'TYPE': + $even->setType(trim($record[2])); + break; + case 'DATE': + $dat = \Gedcom\Parser\Date::parse($parser); + $even->setDate($dat); + //$even->setDate(trim($record[2])); + break; + case 'PLAC': + $plac = \Gedcom\Parser\Plac::parse($parser); + $even->setPlac($plac); + break; + case 'ADDR': + $addr = \Gedcom\Parser\Addr::parse($parser); + $even->setAddr($addr); + break; + case 'PHON': + $phone = \Gedcom\Parser\Phon::parse($parser); + $even->addPhone($phone); + break; + case 'CAUS': + $even->setCaus(trim($record[2])); + break; + case 'AGE': + $even->setAge(trim($record[2])); + break; + case 'AGNC': + $even->setAgnc(trim($record[2])); + break; + case 'HUSB': + $husb = \Gedcom\Parser\Fam\Even\Husb::parse($parser); + $even->setHusb($husb); + break; + case 'WIFE': + $wife = \Gedcom\Parser\Fam\Even\Wife::parse($parser); + $even->setWife($wife); + break; + case 'SOUR': + $sour = \Gedcom\Parser\SourRef::parse($parser); + $even->addSour($sour); + break; + case 'OBJE': + $obje = \Gedcom\Parser\ObjeRef::parse($parser); + $even->addObje($obje); + break; + case 'NOTE': + $note = \Gedcom\Parser\NoteRef::parse($parser); + if ($note) { + $even->addNote($note); + } + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $even; + } +} diff --git a/library/PhpGedcom/Parser/Fam/Even/Husb.php b/src/Parser/Fam/Even/Husb.php similarity index 62% rename from library/PhpGedcom/Parser/Fam/Even/Husb.php rename to src/Parser/Fam/Even/Husb.php index c07123d8..af251300 100644 --- a/library/PhpGedcom/Parser/Fam/Even/Husb.php +++ b/src/Parser/Fam/Even/Husb.php @@ -1,60 +1,51 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Fam\Even; +namespace Gedcom\Parser\Fam\Even; -/** - * - * - */ -class Husb extends \PhpGedcom\Parser\Component +class Husb extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - - $husband = new \PhpGedcom\Record\Fam\Even\Husb(); - + $depth = (int) $record[0]; + + $husband = new \Gedcom\Record\Fam\Even\Husb(); + $parser->forward(); - + while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - + $currentDepth = (int) $record[0]; + if ($currentDepth <= $depth) { $parser->back(); break; } - + switch ($recordType) { case 'AGE': $husband->setAge(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } - + $parser->forward(); } - + return $husband; } } diff --git a/library/PhpGedcom/Parser/Fam/Even/Wife.php b/src/Parser/Fam/Even/Wife.php similarity index 62% rename from library/PhpGedcom/Parser/Fam/Even/Wife.php rename to src/Parser/Fam/Even/Wife.php index d2951fae..c1da3c02 100644 --- a/library/PhpGedcom/Parser/Fam/Even/Wife.php +++ b/src/Parser/Fam/Even/Wife.php @@ -1,60 +1,51 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Fam\Even; +namespace Gedcom\Parser\Fam\Even; -/** - * - * - */ -class Wife extends \PhpGedcom\Parser\Component +class Wife extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - - $wife = new \PhpGedcom\Record\Fam\Even\Wife(); - + $depth = (int) $record[0]; + + $wife = new \Gedcom\Record\Fam\Even\Wife(); + $parser->forward(); - + while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - + $currentDepth = (int) $record[0]; + if ($currentDepth <= $depth) { $parser->back(); break; } - + switch ($recordType) { case 'AGE': $wife->setAge(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } - + $parser->forward(); } - + return $wife; } } diff --git a/src/Parser/Fam/Marb.php b/src/Parser/Fam/Marb.php new file mode 100644 index 00000000..546220f1 --- /dev/null +++ b/src/Parser/Fam/Marb.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Marb extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Marc.php b/src/Parser/Fam/Marc.php new file mode 100644 index 00000000..128df44b --- /dev/null +++ b/src/Parser/Fam/Marc.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Marc extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Marl.php b/src/Parser/Fam/Marl.php new file mode 100644 index 00000000..98be66e3 --- /dev/null +++ b/src/Parser/Fam/Marl.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Marl extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Marr.php b/src/Parser/Fam/Marr.php new file mode 100644 index 00000000..274fa47f --- /dev/null +++ b/src/Parser/Fam/Marr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Marr extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/src/Parser/Fam/Mars.php b/src/Parser/Fam/Mars.php new file mode 100644 index 00000000..2a9eba93 --- /dev/null +++ b/src/Parser/Fam/Mars.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam; + +class Mars extends \Gedcom\Parser\Fam\Even +{ +} diff --git a/library/PhpGedcom/Parser/Fam/Slgs.php b/src/Parser/Fam/Slgs.php similarity index 68% rename from library/PhpGedcom/Parser/Fam/Slgs.php rename to src/Parser/Fam/Slgs.php index 52491834..474945f4 100644 --- a/library/PhpGedcom/Parser/Fam/Slgs.php +++ b/src/Parser/Fam/Slgs.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Fam; +namespace Gedcom\Parser\Fam; -/** - * - * - */ -class Slgs extends \PhpGedcom\Parser\Component +class Slgs extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $slgs = new \PhpGedcom\Record\Fam\Slgs(); + $slgs = new \Gedcom\Record\Fam\Slgs(); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -46,7 +37,8 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'STAT': - $slgs->setStat(trim($record[2])); + $stat = \Gedcom\Parser\Fam\Slgs\Stat::parse($parser); + $slgs->setStat($stat); break; case 'DATE': $slgs->setDate(trim($record[2])); @@ -58,17 +50,17 @@ public static function parse(\PhpGedcom\Parser $parser) $slgs->setTemp(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $slgs->addSour($sour); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $slgs->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Fam/Slgs/Stat.php b/src/Parser/Fam/Slgs/Stat.php new file mode 100644 index 00000000..ec163e86 --- /dev/null +++ b/src/Parser/Fam/Slgs/Stat.php @@ -0,0 +1,59 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Fam\Slgs; + +class Stat extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_stat = $record[2]; + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $stat = new \Gedcom\Record\Fam\Slgs\Stat(); + $stat->setStat($_stat); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $stat->setDate(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $stat; + } +} diff --git a/library/PhpGedcom/Parser/Head.php b/src/Parser/Head.php similarity index 65% rename from library/PhpGedcom/Parser/Head.php rename to src/Parser/Head.php index fe81360a..c5686b41 100644 --- a/library/PhpGedcom/Parser/Head.php +++ b/src/Parser/Head.php @@ -1,45 +1,37 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; - +namespace Gedcom\Parser; -/** - * - * - */ -class Head extends \PhpGedcom\Parser\Component +class Head extends \Gedcom\Parser\Component { - /** - * - * @param \PhpGedcom\Parser $parser - * @return \PhpGedcom\Record\Head + * @return \Gedcom\Record\Head */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $head = new \PhpGedcom\Record\Head(); + $head = new \Gedcom\Record\Head(); $parser->getGedcom()->setHead($head); @@ -47,7 +39,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -57,12 +49,9 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'SOUR': - $sour = \PhpGedcom\Parser\Head\Sour::parse($parser); + $sour = \Gedcom\Parser\Head\Sour::parse($parser); $head->setSour($sour); break; - case 'DEST': - $head->setDest(trim($record[2])); - break; case 'SUBM': $head->setSubm($parser->normalizeIdentifier($record[2])); break; @@ -82,26 +71,26 @@ public static function parse(\PhpGedcom\Parser $parser) $head->setLang(trim($record[2])); break; case 'DATE': - $date = \PhpGedcom\Parser\Head\Date::parse($parser); + $date = \Gedcom\Parser\Head\Date::parse($parser); $head->setDate($date); break; case 'GEDC': - $gedc = \PhpGedcom\Parser\Head\Gedc::parse($parser); + $gedc = \Gedcom\Parser\Head\Gedc::parse($parser); $head->setGedc($gedc); break; case 'CHAR': - $char = \PhpGedcom\Parser\Head\Char::parse($parser); + $char = \Gedcom\Parser\Head\Char::parse($parser); $head->setChar($char); break; case 'PLAC': - $plac = \PhpGedcom\Parser\Head\Plac::parse($parser); + $plac = \Gedcom\Parser\Head\Plac::parse($parser); $head->setPlac($plac); break; case 'NOTE': $head->setNote($parser->parseMultiLineRecord()); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Char.php b/src/Parser/Head/Char.php similarity index 59% rename from library/PhpGedcom/Parser/Head/Char.php rename to src/Parser/Head/Char.php index 02788dac..97ae49ea 100644 --- a/library/PhpGedcom/Parser/Head/Char.php +++ b/src/Parser/Head/Char.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head; +namespace Gedcom\Parser\Head; -/** - * - * - */ -class Char extends \PhpGedcom\Parser\Component +class Char extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $char = new \PhpGedcom\Record\Head\Char(); - $char->setChar(trim($record[2])); + $depth = (int) $record[0]; + if (isset($record[2])) { + $char = new \Gedcom\Record\Head\Char(); + $char->setChar(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } - else{ - $parser->skipToNextLevel($depth); - return null; - } - $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -56,7 +46,7 @@ public static function parse(\PhpGedcom\Parser $parser) $char->setVers(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Date.php b/src/Parser/Head/Date.php similarity index 59% rename from library/PhpGedcom/Parser/Head/Date.php rename to src/Parser/Head/Date.php index 23ee5ed0..b0a28873 100644 --- a/library/PhpGedcom/Parser/Head/Date.php +++ b/src/Parser/Head/Date.php @@ -1,41 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head; +namespace Gedcom\Parser\Head; -/** - * - * - */ -class Date extends \PhpGedcom\Parser\Component +class Date extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $date = new \PhpGedcom\Record\Head\Date(); - $date->setDate(trim($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $date = new \Gedcom\Record\Head\Date(); + $date->setDate(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } $parser->forward(); @@ -43,7 +34,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -55,7 +46,7 @@ public static function parse(\PhpGedcom\Parser $parser) $date->setTime(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Gedc.php b/src/Parser/Head/Gedc.php similarity index 65% rename from library/PhpGedcom/Parser/Head/Gedc.php rename to src/Parser/Head/Gedc.php index f65862b5..f74c7cbe 100644 --- a/library/PhpGedcom/Parser/Head/Gedc.php +++ b/src/Parser/Head/Gedc.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head; +namespace Gedcom\Parser\Head; -/** - * - * - */ -class Gedc extends \PhpGedcom\Parser\Component +class Gedc extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $gedc = new \PhpGedcom\Record\Head\Gedc(); + $gedc = new \Gedcom\Record\Head\Gedc(); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -46,13 +37,13 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'VERS': - $gedc->setVers(trim($record[2])); + $gedc->setVersion(trim($record[2])); break; case 'FORM': $gedc->setForm(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Plac.php b/src/Parser/Head/Plac.php similarity index 66% rename from library/PhpGedcom/Parser/Head/Plac.php rename to src/Parser/Head/Plac.php index e857abe4..541132f9 100644 --- a/library/PhpGedcom/Parser/Head/Plac.php +++ b/src/Parser/Head/Plac.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head; +namespace Gedcom\Parser\Head; -/** - * - * - */ -class Plac extends \PhpGedcom\Parser\Component +class Plac extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $plac = new \PhpGedcom\Record\Head\Plac(); + $plac = new \Gedcom\Record\Head\Plac(); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -49,7 +40,7 @@ public static function parse(\PhpGedcom\Parser $parser) $plac->setForm(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Sour.php b/src/Parser/Head/Sour.php similarity index 61% rename from library/PhpGedcom/Parser/Head/Sour.php rename to src/Parser/Head/Sour.php index e13a9214..739ea5f6 100644 --- a/library/PhpGedcom/Parser/Head/Sour.php +++ b/src/Parser/Head/Sour.php @@ -1,41 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head; +namespace Gedcom\Parser\Head; -/** - * - * - */ -class Sour extends \PhpGedcom\Parser\Component +class Sour extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $source = new \PhpGedcom\Record\Head\Sour(); - $source->setSour(trim($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $source = new \Gedcom\Record\Head\Sour(); + $source->setSour(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } $parser->forward(); @@ -43,7 +34,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -58,15 +49,15 @@ public static function parse(\PhpGedcom\Parser $parser) $source->setName(trim($record[2])); break; case 'CORP': - $corp = \PhpGedcom\Parser\Head\Sour\Corp::parse($parser); + $corp = \Gedcom\Parser\Head\Sour\Corp::parse($parser); $source->setCorp($corp); break; case 'DATA': - $data = \PhpGedcom\Parser\Head\Sour\Data::parse($parser); + $data = Parser\Head\Sour\Data::parse($parser); $source->setData($data); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Sour/Corp.php b/src/Parser/Head/Sour/Corp.php similarity index 58% rename from library/PhpGedcom/Parser/Head/Sour/Corp.php rename to src/Parser/Head/Sour/Corp.php index acb15595..10cb5aab 100644 --- a/library/PhpGedcom/Parser/Head/Sour/Corp.php +++ b/src/Parser/Head/Sour/Corp.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head\Sour; +namespace Gedcom\Parser\Head\Sour; -/** - * - * - */ -class Corp extends \PhpGedcom\Parser\Component +class Corp extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $corp = new \PhpGedcom\Record\Head\Sour\Corp(); - $corp->setCorp(trim($record[2])); + $depth = (int) $record[0]; + if (isset($record[2])) { + $corp = new \Gedcom\Record\Head\Sour\Corp(); + $corp->setCorp(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } - else{ - $parser->skipToNextLevel($depth); - return null; - } - $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -53,13 +43,13 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'ADDR': - $corp->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); + $corp->setAddr(\Gedcom\Parser\Addr::parse($parser)); break; case 'PHON': $corp->addPhon(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Head/Sour/Data.php b/src/Parser/Head/Sour/Data.php similarity index 62% rename from library/PhpGedcom/Parser/Head/Sour/Data.php rename to src/Parser/Head/Sour/Data.php index 2884fc98..58090a24 100644 --- a/library/PhpGedcom/Parser/Head/Sour/Data.php +++ b/src/Parser/Head/Sour/Data.php @@ -1,41 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Head\Sour; +namespace Gedcom\Parser\Head\Sour; -/** - * - * - */ -class Data extends \PhpGedcom\Parser\Component +class Data extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $data = new \PhpGedcom\Record\Head\Sour\Data(); - $data->setData(trim($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $data = new \Gedcom\Record\Head\Sour\Data(); + $data->setData(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } $parser->forward(); @@ -43,7 +34,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -58,7 +49,7 @@ public static function parse(\PhpGedcom\Parser $parser) $data->setCopr(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Indi.php b/src/Parser/Indi.php new file mode 100644 index 00000000..88b57514 --- /dev/null +++ b/src/Parser/Indi.php @@ -0,0 +1,204 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Indi extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $indi = new \Gedcom\Record\Indi(); + $indi->setId($identifier); + + $parser->getGedcom()->addIndi($indi); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + if ($recordType == 'BURI') { + $a = ''; + } + + switch ($recordType) { + case '_UID': + $indi->setUid(trim($record[2])); + break; + case 'RESN': + $indi->setResn(trim($record[2])); + break; + case 'NAME': + $name = \Gedcom\Parser\Indi\Name::parse($parser); + $indi->addName($name); + break; + case 'SEX': + $indi->setSex(isset($record[2]) ? trim($record[2]) : ''); + break; + case 'ADOP': + case 'BIRT': + $birt = \Gedcom\Parser\Birt::parse($parser); + $indi->setBirt($birt); + break; + case 'BAPM': + case 'BARM': + case 'BASM': + case 'BLES': + case 'BURI': + $buri = \Gedcom\Parser\Buri::parse($parser); + $indi->setBuri($buri); + break; + case 'CENS': + case 'CHR': + $chr = \Gedcom\Parser\Chr::parse($parser); + $indi->setChr($chr); + break; + case 'CHRA': + case 'CONF': + case 'CREM': + case 'DEAT': + $deat = \Gedcom\Parser\Deat::parse($parser); + $indi->setDeat($deat); + break; + case 'EMIG': + case 'FCOM': + case 'GRAD': + case 'IMMI': + case 'NATU': + case 'ORDN': + case 'RETI': + case 'PROB': + case 'WILL': + case 'EVEN': + $className = ucfirst(strtolower($recordType)); + $class = '\\Gedcom\\Parser\\Indi\\'.$className; + + $event = $class::parse($parser); + $indi->addEven($event); + break; + case 'CAST': + case 'DSCR': + case 'EDUC': + case 'IDNO': + case 'NATI': + case 'NCHI': + case 'NMR': + case 'OCCU': + case 'PROP': + case 'RELI': + case 'RESI': + case 'SSN': + case 'TITL': + $className = ucfirst(strtolower($recordType)); + $class = '\\Gedcom\\Parser\\Indi\\'.$className; + + $att = $class::parse($parser); + $indi->addAttr($att); + break; + case 'BAPL': + case 'CONL': + case 'ENDL': + case 'SLGC': + $className = ucfirst(strtolower($recordType)); + $class = '\\Gedcom\\Parser\\Indi\\'.$className; + + $lds = $class::parse($parser); + $indi->{'add'.$recordType}[] = $lds; + break; + case 'FAMC': + $famc = \Gedcom\Parser\Indi\Famc::parse($parser); + if ($famc) { + $indi->addFamc($famc); + } + break; + case 'FAMS': + $fams = \Gedcom\Parser\Indi\Fams::parse($parser); + if ($fams) { + $indi->addFams($fams); + } + break; + case 'SUBM': + $indi->addSubm($parser->normalizeIdentifier($record[2])); + break; + case 'ASSO': + $asso = \Gedcom\Parser\Indi\Asso::parse($parser); + $indi->addAsso($asso); + break; + case 'ALIA': + $indi->addAlia($parser->normalizeIdentifier($record[2])); + break; + case 'ANCI': + $indi->addAnci($parser->normalizeIdentifier($record[2])); + break; + case 'DESI': + $indi->addDesi($parser->normalizeIdentifier($record[2])); + break; + case 'RFN': + $indi->setRfn(trim($record[2])); + break; + case 'AFN': + $indi->setAfn(trim($record[2])); + break; + case 'REFN': + $ref = \Gedcom\Parser\Refn::parse($parser); + $indi->addRefn($ref); + break; + case 'RIN': + $indi->setRin(trim($record[2])); + break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $indi->setChan($chan); + break; + case 'NOTE': + $note = \Gedcom\Parser\NoteRef::parse($parser); + if ($note) { + $indi->addNote($note); + } + break; + case 'SOUR': + $sour = \Gedcom\Parser\SourRef::parse($parser); + $indi->addSour($sour); + break; + case 'OBJE': + $obje = \Gedcom\Parser\ObjeRef::parse($parser); + $indi->addObje($obje); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $indi; + } +} diff --git a/library/PhpGedcom/Parser/Indi/Adop.php b/src/Parser/Indi/Adop.php similarity index 64% rename from library/PhpGedcom/Parser/Indi/Adop.php rename to src/Parser/Indi/Adop.php index 020a89ce..81b5a775 100644 --- a/library/PhpGedcom/Parser/Indi/Adop.php +++ b/src/Parser/Indi/Adop.php @@ -1,36 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Adop extends \PhpGedcom\Parser\Indi\Even +class Adop extends \Gedcom\Parser\Indi\Even { public static function parseAdop($parser, $even) { $record = $parser->getCurrentLineRecord(); - if(isset($record[1])) - $even->setAdop(trim($record[2])); + if (isset($record[1])) { + $even->setAdop(trim($record[2])); + } } public static function parseFamc($parser, $even) { $record = $parser->getCurrentLineRecord(); - if(isset($record[1])) - $even->setFamc(trim($record[2])); + if (isset($record[1])) { + $even->setFamc(trim($record[2])); + } } } diff --git a/library/PhpGedcom/Parser/Indi/Asso.php b/src/Parser/Indi/Asso.php similarity index 59% rename from library/PhpGedcom/Parser/Indi/Asso.php rename to src/Parser/Indi/Asso.php index 8313244b..4fc024a1 100644 --- a/library/PhpGedcom/Parser/Indi/Asso.php +++ b/src/Parser/Indi/Asso.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Asso extends \PhpGedcom\Parser\Component +class Asso extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $asso = new \PhpGedcom\Record\Indi\Asso(); - $asso->setIndi($parser->normalizeIdentifier($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; - } + $depth = (int) $record[0]; + if (isset($record[2])) { + $asso = new \Gedcom\Record\Indi\Asso(); + $asso->setIndi($parser->normalizeIdentifier($record[2])); + } else { + $parser->skipToNextLevel($depth); + return null; + } $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -56,17 +46,17 @@ public static function parse(\PhpGedcom\Parser $parser) $asso->setRela(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $asso->addSour($sour); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $asso->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Indi/Attr.php b/src/Parser/Indi/Attr.php similarity index 64% rename from library/PhpGedcom/Parser/Indi/Attr.php rename to src/Parser/Indi/Attr.php index 4aa99a48..070d75a9 100644 --- a/library/PhpGedcom/Parser/Indi/Attr.php +++ b/src/Parser/Indi/Attr.php @@ -1,45 +1,35 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -abstract class Attr extends \PhpGedcom\Parser\Component +abstract class Attr extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); - $attr = new $className(); + $depth = (int) $record[0]; + if (isset($record[1])) { + $className = '\\Gedcom\\Record\\Indi\\'.ucfirst(strtolower(trim($record[1]))); + $attr = new $className(); - $attr->setType(trim($record[1])); - } - else{ - $parser->skipToNextLevel($depth); - return null; - } + $attr->setType(trim($record[1])); + } else { + $parser->skipToNextLevel($depth); + return null; + } if (isset($record[2])) { $attr->setAttr(trim($record[2])); @@ -50,7 +40,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -65,14 +55,14 @@ public static function parse(\PhpGedcom\Parser $parser) $attr->setDate(trim($record[2])); break; case 'PLAC': - $plac = \PhpGedcom\Parser\Indi\Even\Plac::parse($parser); + $plac = \Gedcom\Parser\Indi\Even\Plac::parse($parser); $attr->setPlac($plac); break; case 'ADDR': - $attr->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); + $attr->setAddr(\Gedcom\Parser\Addr::parse($parser)); break; case 'PHON': - $phone = \PhpGedcom\Parser\Phon::parse($parser); + $phone = \Gedcom\Parser\Phon::parse($parser); $attr->addPhon($phone); break; case 'CAUS': @@ -85,21 +75,21 @@ public static function parse(\PhpGedcom\Parser $parser) $attr->setAgnc(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $attr->addSour($sour); break; case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); + $obje = \Gedcom\Parser\ObjeRef::parse($parser); $attr->addObje($obje); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $attr->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Indi/Bapl.php b/src/Parser/Indi/Bapl.php similarity index 75% rename from library/PhpGedcom/Parser/Indi/Bapl.php rename to src/Parser/Indi/Bapl.php index 9407880b..90cf2e3f 100644 --- a/library/PhpGedcom/Parser/Indi/Bapl.php +++ b/src/Parser/Indi/Bapl.php @@ -1,22 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - */ class Bapl extends Lds { } diff --git a/src/Parser/Indi/Bapm.php b/src/Parser/Indi/Bapm.php new file mode 100644 index 00000000..1f6cd5b6 --- /dev/null +++ b/src/Parser/Indi/Bapm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Bapm extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Barm.php b/src/Parser/Indi/Barm.php new file mode 100644 index 00000000..7ba1a0e0 --- /dev/null +++ b/src/Parser/Indi/Barm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Barm extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Basm.php b/src/Parser/Indi/Basm.php new file mode 100644 index 00000000..f741fe32 --- /dev/null +++ b/src/Parser/Indi/Basm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Basm extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Birt.php b/src/Parser/Indi/Birt.php similarity index 65% rename from library/PhpGedcom/Parser/Indi/Birt.php rename to src/Parser/Indi/Birt.php index 2b31cf50..06a04483 100644 --- a/library/PhpGedcom/Parser/Indi/Birt.php +++ b/src/Parser/Indi/Birt.php @@ -1,29 +1,26 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Birt extends \PhpGedcom\Parser\Indi\Even +class Birt extends \Gedcom\Parser\Indi\Even { public static function parseFamc($parser, $even) { $record = $parser->getCurrentLineRecord(); - if(isset($record[2])) - $even->setFamc(trim($record[2])); + if (isset($record[2])) { + $even->setFamc(trim($record[2])); + } } } diff --git a/src/Parser/Indi/Bles.php b/src/Parser/Indi/Bles.php new file mode 100644 index 00000000..ab8a3d5e --- /dev/null +++ b/src/Parser/Indi/Bles.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Bles extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Buri.php b/src/Parser/Indi/Buri.php new file mode 100644 index 00000000..a2b67218 --- /dev/null +++ b/src/Parser/Indi/Buri.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Buri extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Cast.php b/src/Parser/Indi/Cast.php new file mode 100644 index 00000000..67601506 --- /dev/null +++ b/src/Parser/Indi/Cast.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Cast extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Cens.php b/src/Parser/Indi/Cens.php new file mode 100644 index 00000000..22c16b8e --- /dev/null +++ b/src/Parser/Indi/Cens.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Cens extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Chr.php b/src/Parser/Indi/Chr.php similarity index 65% rename from library/PhpGedcom/Parser/Indi/Chr.php rename to src/Parser/Indi/Chr.php index 26adfb09..c71bc8fd 100644 --- a/library/PhpGedcom/Parser/Indi/Chr.php +++ b/src/Parser/Indi/Chr.php @@ -1,30 +1,26 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Chr extends \PhpGedcom\Parser\Indi\Even +class Chr extends \Gedcom\Parser\Indi\Even { public static function parseFamc($parser, $even) { $record = $parser->getCurrentLineRecord(); - if(isset($record[2])){ - $even->setFamc(trim($record[2])); + if (isset($record[2])) { + $even->setFamc(trim($record[2])); } } } diff --git a/src/Parser/Indi/Chra.php b/src/Parser/Indi/Chra.php new file mode 100644 index 00000000..9c0ac676 --- /dev/null +++ b/src/Parser/Indi/Chra.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Chra extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Conf.php b/src/Parser/Indi/Conf.php new file mode 100644 index 00000000..1a14cdd4 --- /dev/null +++ b/src/Parser/Indi/Conf.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Conf extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Record/Indi/Conl.php b/src/Parser/Indi/Conl.php similarity index 75% rename from library/PhpGedcom/Record/Indi/Conl.php rename to src/Parser/Indi/Conl.php index 7489a13a..0a770c5c 100644 --- a/library/PhpGedcom/Record/Indi/Conl.php +++ b/src/Parser/Indi/Conl.php @@ -1,22 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Parser\Indi; -/** - * - */ class Conl extends Lds { } diff --git a/src/Parser/Indi/Crem.php b/src/Parser/Indi/Crem.php new file mode 100644 index 00000000..21cdfb25 --- /dev/null +++ b/src/Parser/Indi/Crem.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Crem extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Deat.php b/src/Parser/Indi/Deat.php new file mode 100644 index 00000000..bbd9da2a --- /dev/null +++ b/src/Parser/Indi/Deat.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Deat extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Dscr.php b/src/Parser/Indi/Dscr.php new file mode 100644 index 00000000..13992f22 --- /dev/null +++ b/src/Parser/Indi/Dscr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Dscr extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Educ.php b/src/Parser/Indi/Educ.php new file mode 100644 index 00000000..24d2360e --- /dev/null +++ b/src/Parser/Indi/Educ.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Educ extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Emig.php b/src/Parser/Indi/Emig.php new file mode 100644 index 00000000..df56f001 --- /dev/null +++ b/src/Parser/Indi/Emig.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Emig extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Record/Indi/Endl.php b/src/Parser/Indi/Endl.php similarity index 75% rename from library/PhpGedcom/Record/Indi/Endl.php rename to src/Parser/Indi/Endl.php index 6d39e10b..bc0552a7 100644 --- a/library/PhpGedcom/Record/Indi/Endl.php +++ b/src/Parser/Indi/Endl.php @@ -1,22 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Parser\Indi; -/** - * - */ class Endl extends Lds { } diff --git a/src/Parser/Indi/Even.php b/src/Parser/Indi/Even.php new file mode 100644 index 00000000..eb357257 --- /dev/null +++ b/src/Parser/Indi/Even.php @@ -0,0 +1,121 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Even extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (empty($record[1])) { + $parser->skipToNextLevel($depth); + + return null; + } + + if (strtoupper(trim($record[1])) != 'EVEN') { + $className = '\Gedcom\Record\Indi\\'.ucfirst(strtolower(trim($record[1]))); + $even = new $className(); + } else { + $even = new \Gedcom\Record\Indi\Even(); + } + + if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { + $even->setType(trim($record[1])); + } + + // ensures we capture any data following the EVEN type + if (isset($record[2]) && !empty($record[2])) { + $even->setAttr(trim($record[2])); + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'TYPE': + $even->setType(trim($record[2])); + break; + case 'DATE': + $dat = \Gedcom\Parser\Date::parse($parser); + $even->setDate($dat); + //$even->setDate(trim($record[2])) + break; + case 'PLAC': + $plac = \Gedcom\Parser\Plac::parse($parser); + $even->setPlac($plac); + break; + case 'ADDR': + $even->setAddr(\Gedcom\Parser\Addr::parse($parser)); + break; + case 'PHON': + $phone = \Gedcom\Parser\Phon::parse($parser); + $even->addPhone($phone); + break; + case 'CAUS': + $even->setCaus(trim($record[2])); + break; + case 'AGE': + $even->setAge(trim($record[2])); + break; + case 'AGNC': + $even->setAgnc(trim($record[2])); + break; + case 'SOUR': + $sour = \Gedcom\Parser\SourRef::parse($parser); + $even->addSour($sour); + break; + case 'OBJE': + $obje = \Gedcom\Parser\ObjeRef::parse($parser); + $even->addObje($obje); + break; + case 'NOTE': + $note = \Gedcom\Parser\NoteRef::parse($parser); + if ($note) { + $even->addNote($note); + } + break; + case 'CHAN': + $change = \Gedcom\Parser\Chan::parse($parser); + $even->setChan($change); + break; + default: + $self = get_called_class(); + $method = 'parse'.$recordType; + + if (method_exists($self, $method)) { + $self::$method($parser, $even); + } else { + $parser->logUnhandledRecord($self.' @ '.__LINE__); + $parser->skipToNextLevel($currentDepth); + } + } + + $parser->forward(); + } + + return $even; + } +} diff --git a/library/PhpGedcom/Parser/Indi/Even/Plac.php b/src/Parser/Indi/Even/Plac.php similarity index 67% rename from library/PhpGedcom/Parser/Indi/Even/Plac.php rename to src/Parser/Indi/Even/Plac.php index cc31defb..dbc1d318 100644 --- a/library/PhpGedcom/Parser/Indi/Even/Plac.php +++ b/src/Parser/Indi/Even/Plac.php @@ -1,36 +1,27 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi\Even; +namespace Gedcom\Parser\Indi\Even; -/** - * - * - */ -class Plac extends \PhpGedcom\Parser\Component +class Plac extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $plac = new \PhpGedcom\Record\Indi\Even\Plac(); + $plac = new \Gedcom\Record\Indi\Even\Plac(); if (isset($record[2])) { $plac->setPlac(trim($record[2])); @@ -41,7 +32,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -53,17 +44,17 @@ public static function parse(\PhpGedcom\Parser $parser) $plac->setForm(trim($record[2])); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $plac->addNote($note); } break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $plac->addSour($sour); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Indi/Famc.php b/src/Parser/Indi/Famc.php similarity index 70% rename from library/PhpGedcom/Parser/Indi/Famc.php rename to src/Parser/Indi/Famc.php index 78ed4763..86da0696 100644 --- a/library/PhpGedcom/Parser/Indi/Famc.php +++ b/src/Parser/Indi/Famc.php @@ -1,44 +1,36 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Famc extends \PhpGedcom\Parser\Component +class Famc extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; if (count($record) < 3) { - $parser->logSkippedRecord('Missing family information; ' . get_class(), ' @ ' . __LINE__); + $parser->logSkippedRecord('Missing family information; '.self::class, ' @ '.__LINE__); $parser->skipToNextLevel($depth); + return null; } $famc = $parser->normalizeIdentifier($record[2]); - $fam = new \PhpGedcom\Record\Indi\Famc(); + $fam = new \Gedcom\Record\Indi\Famc(); $fam->setFamc($famc); $parser->forward(); @@ -46,7 +38,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -58,13 +50,13 @@ public static function parse(\PhpGedcom\Parser $parser) $fam->setPedi(trim($record[2])); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $fam->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Indi/Fams.php b/src/Parser/Indi/Fams.php similarity index 68% rename from library/PhpGedcom/Parser/Indi/Fams.php rename to src/Parser/Indi/Fams.php index 2cff0d4a..f3a79eac 100644 --- a/library/PhpGedcom/Parser/Indi/Fams.php +++ b/src/Parser/Indi/Fams.php @@ -1,44 +1,36 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Fams extends \PhpGedcom\Parser\Component +class Fams extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; if (count($record) < 3) { - $parser->logSkippedRecord('Missing family information; ' . get_class(), ' @ ' . __LINE__); + $parser->logSkippedRecord('Missing family information; '.self::class, ' @ '.__LINE__); $parser->skipToNextLevel($depth); + return null; } $fams = $parser->normalizeIdentifier($record[2]); - $fam = new \PhpGedcom\Record\Indi\Fams(); + $fam = new \Gedcom\Record\Indi\Fams(); $fam->setFams($fams); $parser->forward(); @@ -46,7 +38,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -55,13 +47,13 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $fam->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Indi/Fcom.php b/src/Parser/Indi/Fcom.php new file mode 100644 index 00000000..7382330a --- /dev/null +++ b/src/Parser/Indi/Fcom.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Fcom extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Grad.php b/src/Parser/Indi/Grad.php new file mode 100644 index 00000000..481a4cc3 --- /dev/null +++ b/src/Parser/Indi/Grad.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Grad extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Idno.php b/src/Parser/Indi/Idno.php new file mode 100644 index 00000000..9337f19c --- /dev/null +++ b/src/Parser/Indi/Idno.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Idno extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Immi.php b/src/Parser/Indi/Immi.php new file mode 100644 index 00000000..69e05fbc --- /dev/null +++ b/src/Parser/Indi/Immi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Immi extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Lds.php b/src/Parser/Indi/Lds.php similarity index 66% rename from library/PhpGedcom/Parser/Indi/Lds.php rename to src/Parser/Indi/Lds.php index d1f5e0d2..056480ac 100644 --- a/library/PhpGedcom/Parser/Indi/Lds.php +++ b/src/Parser/Indi/Lds.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -abstract class Lds extends \PhpGedcom\Parser\Component +abstract class Lds extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); - $lds = new $className(); - } - else{ - $parser->skipToNextLevel($depth); - return null; - } + $depth = (int) $record[0]; + if (isset($record[1])) { + $className = 'GedcomRecordIndi'.ucfirst(strtolower(trim($record[1]))); + $lds = new $className(); + } else { + $parser->skipToNextLevel($depth); + return null; + } $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -65,23 +55,23 @@ public static function parse(\PhpGedcom\Parser $parser) $lds->setTemp(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $lds->addSour($sour); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $lds->addNote($note); } break; default: $self = get_called_class(); - $method = 'parse' . $recordType; + $method = 'parse'.$recordType; if (method_exists($self, $method)) { $self::$method($parser, $lds); } else { - $parser->logUnhandledRecord($self . ' @ ' . __LINE__); + $parser->logUnhandledRecord($self.' @ '.__LINE__); } } diff --git a/library/PhpGedcom/Parser/Indi/Name.php b/src/Parser/Indi/Name.php similarity index 63% rename from library/PhpGedcom/Parser/Indi/Name.php rename to src/Parser/Indi/Name.php index 08038b92..3f6e7cb7 100644 --- a/library/PhpGedcom/Parser/Indi/Name.php +++ b/src/Parser/Indi/Name.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ -class Name extends \PhpGedcom\Parser\Component +class Name extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $name = new \PhpGedcom\Record\Indi\Name(); - $name->setName(trim($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; - } + $depth = (int) $record[0]; + if (isset($record[2])) { + $name = new \Gedcom\Record\Indi\Name(); + $name->setName(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + return null; + } $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -56,6 +46,9 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { + case 'TYPE': + $name->setType(trim($record[2])); + break; case 'NPFX': $name->setNpfx(trim($record[2])); break; @@ -75,17 +68,23 @@ public static function parse(\PhpGedcom\Parser $parser) $name->setNsfx(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $name->addSour($sour); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $name->addNote($note); } break; + case 'FONE': + $name->setFone(\Parser\Indi\Name\Fone::parse($parser)); + break; + case 'ROMN': + $name->setRomn(\Parser\Indi\Name\Romn::parse($parser)); + break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Indi/Name/Fone.php b/src/Parser/Indi/Name/Fone.php new file mode 100644 index 00000000..a1f5e409 --- /dev/null +++ b/src/Parser/Indi/Name/Fone.php @@ -0,0 +1,77 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi\Name; + +class Fone extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $fone = new \Gedcom\Record\Indi\Name\Fone(); + $fone->setFone(trim($record[2])); + } else { + return null; + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + if (!isset($record[2])) { + $record[2] = ''; + } + + switch ($recordType) { + case 'TYPE': + $fone->setType(trim($record[2])); + break; + case 'NPFX': + $fone->setNpfx(trim($record[2])); + break; + case 'GIVN': + $fone->setGivn(trim($record[2])); + break; + case 'NICK': + $fone->setNick(trim($record[2])); + break; + case 'SPFX': + $fone->setSpfx(trim($record[2])); + break; + case 'SURN': + $fone->setSurn(trim($record[2])); + break; + case 'NSFX': + $fone->setNsfx(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $fone; + } +} diff --git a/src/Parser/Indi/Name/Romn.php b/src/Parser/Indi/Name/Romn.php new file mode 100644 index 00000000..ba4bc786 --- /dev/null +++ b/src/Parser/Indi/Name/Romn.php @@ -0,0 +1,79 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi\Name; + +class Romn extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $romn = new \Gedcom\Record\Indi\Name\Romn(); + $romn->setRomn(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + if (!isset($record[2])) { + $record[2] = ''; + } + + switch ($recordType) { + case 'TYPE': + $romn->setRomn(trim($record[2])); + break; + case 'NPFX': + $romn->setNpfx(trim($record[2])); + break; + case 'GIVN': + $romn->setGivn(trim($record[2])); + break; + case 'NICK': + $romn->setNick(trim($record[2])); + break; + case 'SPFX': + $romn->setSpfx(trim($record[2])); + break; + case 'SURN': + $romn->setSurn(trim($record[2])); + break; + case 'NSFX': + $romn->setNsfx(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $romn; + } +} diff --git a/src/Parser/Indi/Nati.php b/src/Parser/Indi/Nati.php new file mode 100644 index 00000000..6454232d --- /dev/null +++ b/src/Parser/Indi/Nati.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Nati extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Natu.php b/src/Parser/Indi/Natu.php new file mode 100644 index 00000000..8f2ef838 --- /dev/null +++ b/src/Parser/Indi/Natu.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Natu extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Nchi.php b/src/Parser/Indi/Nchi.php new file mode 100644 index 00000000..67b5c7cd --- /dev/null +++ b/src/Parser/Indi/Nchi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Nchi extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Nmr.php b/src/Parser/Indi/Nmr.php new file mode 100644 index 00000000..302c4e85 --- /dev/null +++ b/src/Parser/Indi/Nmr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Nmr extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Occu.php b/src/Parser/Indi/Occu.php new file mode 100644 index 00000000..9398d458 --- /dev/null +++ b/src/Parser/Indi/Occu.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Occu extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Ordn.php b/src/Parser/Indi/Ordn.php new file mode 100644 index 00000000..08f5d25f --- /dev/null +++ b/src/Parser/Indi/Ordn.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Ordn extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Prob.php b/src/Parser/Indi/Prob.php new file mode 100644 index 00000000..4e6c11cb --- /dev/null +++ b/src/Parser/Indi/Prob.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Prob extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/src/Parser/Indi/Prop.php b/src/Parser/Indi/Prop.php new file mode 100644 index 00000000..d20201d4 --- /dev/null +++ b/src/Parser/Indi/Prop.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Prop extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Reli.php b/src/Parser/Indi/Reli.php new file mode 100644 index 00000000..1ca4b9f8 --- /dev/null +++ b/src/Parser/Indi/Reli.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Reli extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Resi.php b/src/Parser/Indi/Resi.php new file mode 100644 index 00000000..a42b7682 --- /dev/null +++ b/src/Parser/Indi/Resi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Resi extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Reti.php b/src/Parser/Indi/Reti.php new file mode 100644 index 00000000..48b27e42 --- /dev/null +++ b/src/Parser/Indi/Reti.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Reti extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Slgc.php b/src/Parser/Indi/Slgc.php similarity index 79% rename from library/PhpGedcom/Parser/Indi/Slgc.php rename to src/Parser/Indi/Slgc.php index d22d5c6a..b358d341 100644 --- a/library/PhpGedcom/Parser/Indi/Slgc.php +++ b/src/Parser/Indi/Slgc.php @@ -1,28 +1,21 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Parser\Indi; -/** - * - * - */ class Slgc extends Lds { - /** - * - */ public static function parseFamc($parser, $slgc) { $record = $parser->getCurrentLineRecord(); diff --git a/src/Parser/Indi/Ssn.php b/src/Parser/Indi/Ssn.php new file mode 100644 index 00000000..0be0589f --- /dev/null +++ b/src/Parser/Indi/Ssn.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Ssn extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Titl.php b/src/Parser/Indi/Titl.php new file mode 100644 index 00000000..0a95d476 --- /dev/null +++ b/src/Parser/Indi/Titl.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Titl extends \Gedcom\Parser\Indi\Attr +{ +} diff --git a/src/Parser/Indi/Will.php b/src/Parser/Indi/Will.php new file mode 100644 index 00000000..337d6f81 --- /dev/null +++ b/src/Parser/Indi/Will.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Indi; + +class Will extends \Gedcom\Parser\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Note.php b/src/Parser/Note.php similarity index 61% rename from library/PhpGedcom/Parser/Note.php rename to src/Parser/Note.php index 963caf43..70a2da1f 100644 --- a/library/PhpGedcom/Parser/Note.php +++ b/src/Parser/Note.php @@ -1,56 +1,45 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Note extends \PhpGedcom\Parser\Component +class Note extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(4); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $note = new \PhpGedcom\Record\Note(); + $note = new \Gedcom\Record\Note(); $note->setId($identifier); if (isset($record[3])) { $note->setNote($record[3]); } - $parser->getGedcom()->addNote($note); - $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -59,39 +48,39 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { - case 'RIN': - $note->setRin(trim($record[2])); - break; case 'CONT': - $note->setNote($note->getNote() . "\n"); - + $note->setNote($note->getNote()."\n"); if (isset($record[2])) { - $note->setNote($note->getNote() . $record[2]); + $note->setNote($note->getNote().$record[2]); } break; case 'CONC': if (isset($record[2])) { - $note->setNote($note->getNote() . $record[2]); + $note->setNote($note->getNote().$record[2]); } break; case 'REFN': - $refn = \PhpGedcom\Parser\Refn::parse($parser); + $refn = \Gedcom\Parser\Refn::parse($parser); $note->addRefn($refn); break; - case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); - $note->setChan($chan); + case 'RIN': + $note->setRin(trim($record[2])); break; case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $note->addSour($sour); break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $note->setChan($chan); + break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); } + $parser->getGedcom()->addNote($note); return $note; } diff --git a/library/PhpGedcom/Parser/NoteRef.php b/src/Parser/NoteRef.php similarity index 69% rename from library/PhpGedcom/Parser/NoteRef.php rename to src/Parser/NoteRef.php index 4008543e..bfbd4966 100644 --- a/library/PhpGedcom/Parser/NoteRef.php +++ b/src/Parser/NoteRef.php @@ -1,37 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - */ -class NoteRef extends \PhpGedcom\Parser\Component +class NoteRef extends \Gedcom\Parser\Component { - /** - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $note = new \PhpGedcom\Record\NoteRef(); + $note = new \Gedcom\Record\NoteRef(); if (count($record) < 3) { - $parser->logSkippedRecord('Missing note information; ' . get_class(), ' @ ' . __LINE__); + $parser->logSkippedRecord('Missing note information; '.self::class, ' @ '.__LINE__); $parser->skipToNextLevel($depth); + return null; } @@ -39,7 +34,7 @@ public static function parse(\PhpGedcom\Parser $parser) $note->setIsReference(true); $note->setNote($parser->normalizeIdentifier($record[2])); } else { - $before = $parser->getCurrentLine(); + $parser->getCurrentLine(); $note->setIsReference(false); $note->setNote($parser->parseMultiLineRecord()); } @@ -49,7 +44,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -58,11 +53,11 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'SOUR': - $sour = \PhpGedcom\Parser\SourRef::parse($parser); + $sour = \Gedcom\Parser\SourRef::parse($parser); $note->addSour($sour); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Obje.php b/src/Parser/Obje.php similarity index 55% rename from library/PhpGedcom/Parser/Obje.php rename to src/Parser/Obje.php index f06c6995..db6a9668 100644 --- a/library/PhpGedcom/Parser/Obje.php +++ b/src/Parser/Obje.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Obje extends \PhpGedcom\Parser\Component +class Obje extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); $depth = (int) $record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $obje = new \PhpGedcom\Record\Obje(); + $obje = new \Gedcom\Record\Obje(); $obje->setId($identifier); $parser->getGedcom()->addObje($obje); @@ -55,40 +46,32 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { - case 'FORM': - $obje->setForm(trim($record[2])); - break; - case 'TITL': - $obje->setTitl(trim($record[2])); - break; - case 'OBJE': - $obje->setForm($parser->normalizeIdentifier($record[2])); - break; - case 'RIN': - $obje->setRin(trim($record[2])); + case 'FILE': + $obje->setFile(trim($record[2])); break; case 'REFN': - $refn = \PhpGedcom\Parser\Refn::parse($parser); + $refn = \Gedcom\Parser\Refn::parse($parser); $obje->addRefn($refn); break; - case 'BLOB': - $obje->setBlob($parser->parseMultiLineRecord()); + case 'RIN': + $obje->setRin(trim($record[2])); break; + case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $obje->addNote($note); } break; + case 'SOUR': + case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); + $chan = \Gedcom\Parser\Chan::parse($parser); $obje->setChan($chan); break; - case 'FILE': - $obje->setFile(trim($record[2])); - break; + default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/ObjeRef.php b/src/Parser/ObjeRef.php similarity index 56% rename from library/PhpGedcom/Parser/ObjeRef.php rename to src/Parser/ObjeRef.php index 41d545d8..609b474a 100644 --- a/library/PhpGedcom/Parser/ObjeRef.php +++ b/src/Parser/ObjeRef.php @@ -1,77 +1,61 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class ObjeRef extends \PhpGedcom\Parser\Component +class ObjeRef extends \Gedcom\Parser\Component { - /** - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - - $obje = new \PhpGedcom\Record\ObjeRef(); - + $depth = (int) $record[0]; + + $obje = new \Gedcom\Record\ObjeRef(); + if (isset($record[2])) { $obje->setIsReference(true); $obje->setObje($parser->normalizeIdentifier($record[2])); } else { $obje->setIsReference(false); } - + $parser->forward(); - + while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; - + $currentDepth = (int) $record[0]; + if ($currentDepth <= $depth) { $parser->back(); break; } - + switch ($recordType) { case 'TITL': $obje->setTitl(trim($record[2])); break; case 'FILE': - $obje->setFile(trim($record[2])); - break; - case 'FORM': - $obje->setForm(trim($record[2])); - break; - case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); - if ($note) { - $obje->addNote($note); - } + $obje->setFile(\Gedcom\Parser\ObjeRef\File::parse($parser)); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } - + $parser->forward(); } - + return $obje; } } diff --git a/src/Parser/ObjeRef/File.php b/src/Parser/ObjeRef/File.php new file mode 100644 index 00000000..b0710380 --- /dev/null +++ b/src/Parser/ObjeRef/File.php @@ -0,0 +1,56 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\ObjeRef; + +class File extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $file = new \Gedcom\Record\ObjeRef\File(); + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $file->setFile($record[2]); + } else { + return null; + } + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'FORM': + $file->setDate(\Parser\ObjeRef\File\Form::parse($parser)); + break; + case 'TITL': + $file->setTitl(trim($record[2])); + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $file; + } +} diff --git a/src/Parser/ObjeRef/File/Form.php b/src/Parser/ObjeRef/File/Form.php new file mode 100644 index 00000000..307d0047 --- /dev/null +++ b/src/Parser/ObjeRef/File/Form.php @@ -0,0 +1,59 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\ObjeRef\File; + +class Form extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $form = new \Gedcom\Record\ObjeRef\File\Form(); + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $form->setForm($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'MEDI': + $form->setMedi(trim($record[2])); + break; + case 'TYPE': + $form->setType(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $form; + } +} diff --git a/library/PhpGedcom/Parser/Phon.php b/src/Parser/Phon.php similarity index 57% rename from library/PhpGedcom/Parser/Phon.php rename to src/Parser/Phon.php index fc1d5718..82ed5f6c 100644 --- a/library/PhpGedcom/Parser/Phon.php +++ b/src/Parser/Phon.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Phon extends \PhpGedcom\Parser\Component +class Phon extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $phone = new \PhpGedcom\Record\Phon(); - $phone->setPhon(trim($record[2])); + $depth = (int) $record[0]; + if (isset($record[2])) { + $phone = new \Gedcom\Record\Phon(); + $phone->setPhon(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } - else{ - $parser->skipToNextLevel($depth); - return null; - } - $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -53,7 +43,7 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Plac.php b/src/Parser/Plac.php new file mode 100644 index 00000000..6a4e8af5 --- /dev/null +++ b/src/Parser/Plac.php @@ -0,0 +1,76 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser; + +class Plac extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_plac = trim($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $plac = new \Gedcom\Record\Plac(); + $plac->setPlac($_plac); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $currentDepth = (int) $record[0]; + $recordType = strtoupper(trim($record[1])); + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'FORM': + $plac->setForm(trim($record[2])); + break; + case 'FONE': + $fone = \Gedcom\Parser\Plac\Fone::parse($parser); + $plac->setFone($fone); + break; + case 'ROMN': + $romn = \Gedcom\Parser\Plac\Romn::parse($parser); + $plac->setRomn($romn); + break; + case 'NOTE': + if ($note = \Gedcom\Parser\NoteRef::parse($parser)) { + $plac->addNote($note); + } + break; + case 'MAP': + $map = \Gedcom\Parser\Plac\Map::parse($parser); + $plac->setMap($map); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $plac; + } +} diff --git a/src/Parser/Plac/Fone.php b/src/Parser/Plac/Fone.php new file mode 100644 index 00000000..314301ff --- /dev/null +++ b/src/Parser/Plac/Fone.php @@ -0,0 +1,59 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Plac; + +class Fone extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_fone = trim($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $fone = new \Gedcom\Record\Plac\Fone(); + $fone->setPlac($_fone); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $currentDepth = (int) $record[0]; + $recordType = strtoupper(trim($record[1])); + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'TYPE': + $fone->setType(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $fone; + } +} diff --git a/src/Parser/Plac/Map.php b/src/Parser/Plac/Map.php new file mode 100644 index 00000000..a7cf39d8 --- /dev/null +++ b/src/Parser/Plac/Map.php @@ -0,0 +1,54 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Plac; + +class Map extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $map = new \Gedcom\Record\Plac\Map(); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $currentDepth = (int) $record[0]; + $recordType = strtoupper(trim($record[1])); + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'LATI': + $map->setLati(trim($record[2])); + break; + case 'LONG': + $map->setLong(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $map; + } +} diff --git a/src/Parser/Plac/Romn.php b/src/Parser/Plac/Romn.php new file mode 100644 index 00000000..2bc9e442 --- /dev/null +++ b/src/Parser/Plac/Romn.php @@ -0,0 +1,59 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Plac; + +class Romn extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_romn = trim($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; + } + + $romn = new \Gedcom\Record\Plac\Romn(); + $romn->setPlac($_romn); + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $currentDepth = (int) $record[0]; + $recordType = strtoupper(trim($record[1])); + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'TYPE': + $romn->setType(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $romn; + } +} diff --git a/library/PhpGedcom/Parser/Refn.php b/src/Parser/Refn.php similarity index 60% rename from library/PhpGedcom/Parser/Refn.php rename to src/Parser/Refn.php index e391a9ed..6791ea21 100644 --- a/library/PhpGedcom/Parser/Refn.php +++ b/src/Parser/Refn.php @@ -1,50 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Refn extends \PhpGedcom\Parser\Component +class Refn extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $refn = new \PhpGedcom\Record\Refn(); - $refn->setRefn(trim($record[2])); + $depth = (int) $record[0]; + if (isset($record[2])) { + $refn = new \Gedcom\Record\Refn(); + $refn->setRefn(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } - else{ - $parser->skipToNextLevel($depth); - return null; - } - $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -56,7 +46,7 @@ public static function parse(\PhpGedcom\Parser $parser) $refn->setType(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Repo.php b/src/Parser/Repo.php similarity index 57% rename from library/PhpGedcom/Parser/Repo.php rename to src/Parser/Repo.php index dd1dddc6..39486e9f 100644 --- a/library/PhpGedcom/Parser/Repo.php +++ b/src/Parser/Repo.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Repo extends \PhpGedcom\Parser\Component +class Repo extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $repo = new \PhpGedcom\Record\Repo(); + $repo = new \Gedcom\Record\Repo(); $repo->setRepo($identifier); $parser->getGedcom()->addRepo($repo); @@ -46,7 +37,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -59,31 +50,39 @@ public static function parse(\PhpGedcom\Parser $parser) $repo->setName(trim($record[2])); break; case 'ADDR': - $addr = \PhpGedcom\Parser\Addr::parse($parser); + $addr = \Gedcom\Parser\Addr::parse($parser); $repo->setAddr($addr); break; case 'PHON': - $phon = \PhpGedcom\Parser\Phon::parse($parser); - $repo->addPhon($phon); + $repo->addPhon(trim($record[2])); + break; + case 'EMAIL': + $repo->addEmail(trim($record[2])); + break; + case 'FAX': + $repo->addFax(trim($record[2])); + break; + case 'WWW': + $repo->addWww(trim($record[2])); break; case 'NOTE': - if ($note = \PhpGedcom\Parser\NoteRef::parse($parser)) { + if ($note = \Gedcom\Parser\NoteRef::parse($parser)) { $repo->addNote($note); } break; case 'REFN': - $refn = \PhpGedcom\Parser\Refn::parse($parser); + $refn = \Gedcom\Parser\Refn::parse($parser); $repo->addRefn($refn); break; - case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); - $repo->setChan($chan); - break; case 'RIN': $repo->setRin(trim($record[2])); break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $repo->setChan($chan); + break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/RepoRef.php b/src/Parser/RepoRef.php similarity index 57% rename from library/PhpGedcom/Parser/RepoRef.php rename to src/Parser/RepoRef.php index 8fe419cc..63af5d91 100644 --- a/library/PhpGedcom/Parser/RepoRef.php +++ b/src/Parser/RepoRef.php @@ -1,50 +1,41 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class RepoRef extends \PhpGedcom\Parser\Component +class RepoRef extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $identifier = $parser->normalizeIdentifier($record[2]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $identifier = $parser->normalizeIdentifier($record[2]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $repo = new \PhpGedcom\Record\RepoRef(); + $repo = new \Gedcom\Record\RepoRef(); $repo->setRepo($identifier); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -54,16 +45,16 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'CALN': - $repo->addCaln(\PhpGedcom\Parser\Caln::parse($parser)); + $repo->addCaln(\Parser\Caln::parse($parser)); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $repo->addNote($note); } break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Sour.php b/src/Parser/Sour.php similarity index 67% rename from library/PhpGedcom/Parser/Sour.php rename to src/Parser/Sour.php index e5970a8b..71164d62 100644 --- a/library/PhpGedcom/Parser/Sour.php +++ b/src/Parser/Sour.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Sour extends \PhpGedcom\Parser\Component +class Sour extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $sour = new \PhpGedcom\Record\Sour(); + $sour = new \Gedcom\Record\Sour(); $sour->setSour($identifier); $parser->getGedcom()->addSour($sour); @@ -46,7 +37,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -55,50 +46,50 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { - case 'TITL': - $sour->setTitl($parser->parseMultilineRecord()); - break; - case 'RIN': - $sour->setRin(trim($record[2])); + case 'DATA': + $sour->setData(\Gedcom\Parser\Sour\Data::parse($parser)); break; case 'AUTH': $sour->setAuth($parser->parseMultilineRecord()); break; - case 'TEXT': - $sour->setText($parser->parseMultilineRecord()); + case 'TITL': + $sour->setTitl($parser->parseMultilineRecord()); + break; + case 'ABBR': + $sour->setAbbr(trim($record[2])); break; case 'PUBL': $sour->setPubl($parser->parseMultilineRecord()); break; - case 'ABBR': - $sour->setAbbr(trim($record[2])); + case 'TEXT': + $sour->setText($parser->parseMultilineRecord()); break; case 'REPO': - $sour->setRepo(\PhpGedcom\Parser\RepoRef::parse($parser)); + $sour->setRepo(\Gedcom\Parser\Sour\Repo::parse($parser)); + break; + case 'REFN': + $refn = \Gedcom\Parser\Refn::parse($parser); + $sour->addRefn($refn); + break; + case 'RIN': + $sour->setRin(trim($record[2])); + break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $sour->setChan($chan); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $sour->addNote($note); } break; - case 'DATA': - $sour->setData(\PhpGedcom\Parser\Sour\Data::parse($parser)); - break; case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); + $obje = \Gedcom\Parser\ObjeRef::parse($parser); $sour->addObje($obje); break; - case 'REFN': - $refn = \PhpGedcom\Parser\Refn::parse($parser); - $sour->addRefn($refn); - break; - case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); - $sour->setChan($chan); - break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Sour/Data.php b/src/Parser/Sour/Data.php similarity index 66% rename from library/PhpGedcom/Parser/Sour/Data.php rename to src/Parser/Sour/Data.php index ed8e3edc..b2ad6085 100644 --- a/library/PhpGedcom/Parser/Sour/Data.php +++ b/src/Parser/Sour/Data.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Sour; +namespace Gedcom\Parser\Sour; -/** - * - * - */ -class Data extends \PhpGedcom\Parser\Component +class Data extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $data = new \PhpGedcom\Record\Sour\Data(); + $data = new \Gedcom\Record\Sour\Data(); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -46,25 +37,25 @@ public static function parse(\PhpGedcom\Parser $parser) switch ($recordType) { case 'EVEN': - $data->addEven(\PhpGedcom\Parser\Sour\Data\Even::parse($parser)); + $data->addEven(\Gedcom\Parser\Sour\Data\Even::parse($parser)); break; - case 'DATE': + case 'DATE': // not in 5.5.1 $data->setDate(trim($record[2])); break; case 'AGNC': $data->setAgnc(trim($record[2])); break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $data->addNote($note); } break; - case 'TEXT': + case 'TEXT': // not in 5.5.1 $data->setText($parser->parseMultiLineRecord()); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Sour/Data/Even.php b/src/Parser/Sour/Data/Even.php similarity index 68% rename from library/PhpGedcom/Parser/Sour/Data/Even.php rename to src/Parser/Sour/Data/Even.php index dbdef80d..10d5975d 100644 --- a/library/PhpGedcom/Parser/Sour/Data/Even.php +++ b/src/Parser/Sour/Data/Even.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Sour\Data; +namespace Gedcom\Parser\Sour\Data; -/** - * - * - */ -class Even extends \PhpGedcom\Parser\Component +class Even extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; + $depth = (int) $record[0]; - $even = new \PhpGedcom\Record\Sour\Data\Even(); + $even = new \Gedcom\Record\Sour\Data\Even(); $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -52,7 +43,7 @@ public static function parse(\PhpGedcom\Parser $parser) $even->setPlac(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/Sour/Repo.php b/src/Parser/Sour/Repo.php new file mode 100644 index 00000000..f725b70e --- /dev/null +++ b/src/Parser/Sour/Repo.php @@ -0,0 +1,57 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Sour; + +class Repo extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $repo = new \Gedcom\Record\Sour\Repo(); + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_repo = $parser->normalizeIdentifier($record[2]); + $repo->setRepo($_repo); + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'NOTE': + $repo->addNote(\Gedcom\Parser\NoteRef::parse($parser)); + break; + case 'CALN': + $repo->addCaln(\Gedcom\Parser\Sour\Repo\Caln::parse($parser)); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $repo; + } +} diff --git a/src/Parser/Sour/Repo/Caln.php b/src/Parser/Sour/Repo/Caln.php new file mode 100644 index 00000000..96b83f06 --- /dev/null +++ b/src/Parser/Sour/Repo/Caln.php @@ -0,0 +1,56 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\Sour\Repo; + +class Caln extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $caln = new \Gedcom\Record\Sour\Repo\Caln(); + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + if (isset($record[2])) { + $_caln = $record[2]; + $caln->setCaln($_caln); + } else { + return null; + } + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'MEDI': + $caln->setMedi(trim($record[2])); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $caln; + } +} diff --git a/library/PhpGedcom/Parser/SourRef.php b/src/Parser/SourRef.php similarity index 55% rename from library/PhpGedcom/Parser/SourRef.php rename to src/Parser/SourRef.php index 2d075f27..3498b607 100644 --- a/library/PhpGedcom/Parser/SourRef.php +++ b/src/Parser/SourRef.php @@ -1,49 +1,40 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class SourRef extends \PhpGedcom\Parser\Component +class SourRef extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $sour = new \PhpGedcom\Record\SourRef(); - $sour->setSour($record[2]); + $depth = (int) $record[0]; + if (isset($record[2])) { + $sour = new \Gedcom\Record\SourRef(); + $sour->setSour($parser->normalizeIdentifier($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } - else{ - $parser->skipToNextLevel($depth); - return null; - } $parser->forward(); while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -51,42 +42,36 @@ public static function parse(\PhpGedcom\Parser $parser) } switch ($recordType) { - case 'CONT': - $sour->setSour($sour->getSour() . "\n"); - - if (isset($record[2])) { - $sour->setSour($sour->getSour() . $record[2]); - } + case 'PAGE': + $sour->setPage(trim($record[2])); break; - case 'CONC': - if (isset($record[2])) { - $sour->setSour($sour->getSour() . $record[2]); - } + case 'EVEN': + $even = \Gedcom\Parser\SourRef\Even::parse($parser); + $sour->setEven($even); + break; + case 'DATA': + $sour->setData(\Gedcom\Parser\SourRef\Data::parse($parser)); break; case 'TEXT': $sour->setText($parser->parseMultiLineRecord()); break; + case 'OBJE': + $obje = \Gedcom\Parser\ObjeRef::parse($parser); + if ($obje) { + $sour->addNote($obje); + } + break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $sour->addNote($note); } break; - case 'DATA': - $sour->setData(\PhpGedcom\Parser\Sour\Data::parse($parser)); - break; case 'QUAY': $sour->setQuay(trim($record[2])); break; - case 'PAGE': - $sour->setPage(trim($record[2])); - break; - case 'EVEN': - $even = \PhpGedcom\Parser\SourRef\Even::parse($parser); - $sour->setEven($even); - break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/src/Parser/SourRef/Data.php b/src/Parser/SourRef/Data.php new file mode 100644 index 00000000..05ac8ce0 --- /dev/null +++ b/src/Parser/SourRef/Data.php @@ -0,0 +1,53 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Parser\SourRef; + +class Data extends \Gedcom\Parser\Component +{ + public static function parse(\Gedcom\Parser $parser) + { + $data = new \Gedcom\Record\SourRef\Data(); + $record = $parser->getCurrentLineRecord(); + $depth = (int) $record[0]; + + $parser->forward(); + + while (!$parser->eof()) { + $record = $parser->getCurrentLineRecord(); + $recordType = strtoupper(trim($record[1])); + $currentDepth = (int) $record[0]; + + if ($currentDepth <= $depth) { + $parser->back(); + break; + } + + switch ($recordType) { + case 'DATE': + $data->setDate(trim($record[2])); + break; + case 'TEXT': + $data->setText($parser->parseMultiLineRecord()); + break; + default: + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); + } + + $parser->forward(); + } + + return $data; + } +} diff --git a/library/PhpGedcom/Parser/SourRef/Even.php b/src/Parser/SourRef/Even.php similarity index 59% rename from library/PhpGedcom/Parser/SourRef/Even.php rename to src/Parser/SourRef/Even.php index b3ea1fc8..2724058b 100644 --- a/library/PhpGedcom/Parser/SourRef/Even.php +++ b/src/Parser/SourRef/Even.php @@ -1,41 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\SourRef; +namespace Gedcom\Parser\SourRef; -/** - * - * - */ -class Even extends \PhpGedcom\Parser\Component +class Even extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[2])){ - $even = new \PhpGedcom\Record\SourRef\Even(); - $even->setEven(trim($record[2])); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[2])) { + $even = new \Gedcom\Record\SourRef\Even(); + $even->setEven(trim($record[2])); + } else { + $parser->skipToNextLevel($depth); + + return null; } $parser->forward(); @@ -43,7 +34,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); $recordType = strtoupper(trim($record[1])); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; if ($currentDepth <= $depth) { $parser->back(); @@ -55,7 +46,7 @@ public static function parse(\PhpGedcom\Parser $parser) $even->setRole(trim($record[2])); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Subm.php b/src/Parser/Subm.php similarity index 59% rename from library/PhpGedcom/Parser/Subm.php rename to src/Parser/Subm.php index 6609a191..0699daa9 100644 --- a/library/PhpGedcom/Parser/Subm.php +++ b/src/Parser/Subm.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Subm extends \PhpGedcom\Parser\Component +class Subm extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $subm = new \PhpGedcom\Record\Subm(); + $subm = new \Gedcom\Record\Subm(); $subm->setSubm($identifier); $parser->getGedcom()->addSubm($subm); @@ -46,7 +37,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -59,25 +50,37 @@ public static function parse(\PhpGedcom\Parser $parser) $subm->setName(isset($record[2]) ? trim($record[2]) : ''); break; case 'ADDR': - $addr = \PhpGedcom\Parser\Addr::parse($parser); + $addr = \Gedcom\Parser\Addr::parse($parser); $subm->setAddr($addr); break; case 'PHON': - $phone = \PhpGedcom\Parser\Phon::parse($parser); + $phone = isset($record[2]) ? trim($record[2]) : ''; $subm->addPhon($phone); break; + case 'EMAIL': + $email = isset($record[2]) ? trim($record[2]) : ''; + $subm->addEmail($email); + break; + case 'FAX': + $fax = isset($record[2]) ? trim($record[2]) : ''; + $subm->addFax($fax); + break; + case 'WWW': + $www = isset($record[2]) ? trim($record[2]) : ''; + $subm->addWww($www); + break; case 'NOTE': - $note = \PhpGedcom\Parser\NoteRef::parse($parser); + $note = \Gedcom\Parser\NoteRef::parse($parser); if ($note) { $subm->addNote($note); } break; case 'OBJE': - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); + $obje = \Gedcom\Parser\ObjeRef::parse($parser); $subm->addObje($obje); break; case 'CHAN': - $chan = \PhpGedcom\Parser\Chan::parse($parser); + $chan = \Gedcom\Parser\Chan::parse($parser); $subm->setChan($chan); break; case 'RIN': @@ -90,7 +93,7 @@ public static function parse(\PhpGedcom\Parser $parser) $subm->addLang(isset($record[2]) ? trim($record[2]) : ''); break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Parser/Subn.php b/src/Parser/Subn.php similarity index 64% rename from library/PhpGedcom/Parser/Subn.php rename to src/Parser/Subn.php index 77e19b73..025e64a6 100644 --- a/library/PhpGedcom/Parser/Subn.php +++ b/src/Parser/Subn.php @@ -1,43 +1,34 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Parser; -/** - * - * - */ -class Subn extends \PhpGedcom\Parser\Component +class Subn extends \Gedcom\Parser\Component { - - /** - * - * - */ - public static function parse(\PhpGedcom\Parser $parser) + public static function parse(\Gedcom\Parser $parser) { $record = $parser->getCurrentLineRecord(); - $depth = (int)$record[0]; - if(isset($record[1])){ - $identifier = $parser->normalizeIdentifier($record[1]); - } - else{ - $parser->skipToNextLevel($depth); - return null; + $depth = (int) $record[0]; + if (isset($record[1])) { + $identifier = $parser->normalizeIdentifier($record[1]); + } else { + $parser->skipToNextLevel($depth); + + return null; } - $subn = new \PhpGedcom\Record\Subn(); + $subn = new \Gedcom\Record\Subn(); $subn->setSubn($identifier); $parser->getGedcom()->setSubn($subn); @@ -46,7 +37,7 @@ public static function parse(\PhpGedcom\Parser $parser) while (!$parser->eof()) { $record = $parser->getCurrentLineRecord(); - $currentDepth = (int)$record[0]; + $currentDepth = (int) $record[0]; $recordType = strtoupper(trim($record[1])); if ($currentDepth <= $depth) { @@ -76,8 +67,18 @@ public static function parse(\PhpGedcom\Parser $parser) case 'RIN': $subn->setRin(trim($record[2])); break; + case 'NOTE': + $note = \Gedcom\Parser\NoteRef::parse($parser); + if ($note) { + $subn->addNote($note); + } + break; + case 'CHAN': + $chan = \Gedcom\Parser\Chan::parse($parser); + $subn->setChan($chan); + break; default: - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); } $parser->forward(); diff --git a/library/PhpGedcom/Record.php b/src/Record.php similarity index 56% rename from library/PhpGedcom/Record.php rename to src/Record.php index 02dbed93..eb6a6924 100644 --- a/library/PhpGedcom/Record.php +++ b/src/Record.php @@ -1,38 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom; +namespace Gedcom; -/** - * - */ abstract class Record { - /** - * - */ public function __call($method, $args) { if (substr($method, 0, 3) == 'add') { $arr = strtolower(substr($method, 3)); - if (!property_exists($this, '_' . $arr) || !is_array($this->{'_' . $arr})) { - throw new \Exception('Unknown ' . get_class($this) . '::' . $arr); + if (!property_exists($this, '_'.$arr) || !is_array($this->{'_'.$arr})) { + throw new \Exception('Unknown '.$this::class.'::'.$arr); } if (!is_array($args)) { - throw new \Exception('Incorrect arguments to ' . $method); + throw new \Exception('Incorrect arguments to '.$method); } if (!isset($args[0])) { @@ -44,18 +38,18 @@ public function __call($method, $args) // Type safety? } - $this->{'_' . $arr}[] = $args[0]; + $this->{'_'.$arr}[] = $args[0]; return $this; } elseif (substr($method, 0, 3) == 'set') { $arr = strtolower(substr($method, 3)); - if (!property_exists($this, '_' . $arr)) { - throw new \Exception('Unknown ' . get_class($this) . '::' . $arr); + if (!property_exists($this, '_'.$arr)) { + throw new \Exception('Unknown '.$this::class.'::'.$arr); } if (!is_array($args)) { - throw new \Exception('Incorrect arguments to ' . $method); + throw new \Exception('Incorrect arguments to '.$method); } if (!isset($args[0])) { @@ -67,40 +61,47 @@ public function __call($method, $args) // Type safety? } - $this->{'_' . $arr} = $args[0]; + $this->{'_'.$arr} = $args[0]; return $this; } elseif (substr($method, 0, 3) == 'get') { $arr = strtolower(substr($method, 3)); - if (!property_exists($this, '_' . $arr)) { - throw new \Exception('Unknown ' . get_class($this) . '::' . $arr); + // hotfix getData + if ('data' == $arr) { + if (!property_exists($this, '_text')) { + throw new \Exception('Unknown '.$this::class.'::'.$arr); + } + + return $this->{'_text'}; + } + + if (!property_exists($this, '_'.$arr)) { + throw new \Exception('Unknown '.$this::class.'::'.$arr); } - return $this->{'_' . $arr}; + return $this->{'_'.$arr}; } else { - throw new \Exception('Unknown method called: ' . $method); + throw new \Exception('Unknown method called: '.$method); } } - /** - * - */ public function __set($var, $val) { // this class does not have any public vars - throw new \Exception('Undefined property ' . get_class() . '::' . $var); + throw new \Exception('Undefined property '.self::class.'::'.$var); } /** * Checks if this GEDCOM object has the provided attribute (ie, if the provided * attribute exists below the current object in its tree). * - * @param string $var The name of the attribute - * @return bool True if this object has the provided attribute + * @param string $var The name of the attribute + * + * @return bool True if this object has the provided attribute */ public function hasAttribute($var) { - return property_exists($this, '_' . $var) || property_Exists($this, $var); + return property_exists($this, '_'.$var) || property_exists($this, $var); } } diff --git a/library/PhpGedcom/Record/Addr.php b/src/Record/Addr.php similarity index 93% rename from library/PhpGedcom/Record/Addr.php rename to src/Record/Addr.php index d6a45707..0830aab3 100644 --- a/library/PhpGedcom/Record/Addr.php +++ b/src/Record/Addr.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Addr - * @package PhpGedcom\Record + * Class Addr. */ -class Addr extends Record +class Addr extends \Gedcom\Record { /** * @var string @@ -59,11 +56,13 @@ class Addr extends Record /** * @param string $addr + * * @return Addr */ public function setAddr($addr = '') { $this->addr = $addr; + return $this; } @@ -77,11 +76,13 @@ public function getAddr() /** * @param string $adr1 + * * @return Addr */ public function setAdr1($adr1 = '') { $this->adr1 = $adr1; + return $this; } @@ -95,11 +96,13 @@ public function getAdr1() /** * @param string $adr2 + * * @return Addr */ public function setAdr2($adr2 = '') { $this->adr2 = $adr2; + return $this; } @@ -113,11 +116,13 @@ public function getAdr2() /** * @param string $city + * * @return Addr */ public function setCity($city = '') { $this->city = $city; + return $this; } @@ -131,11 +136,13 @@ public function getCity() /** * @param string $stae + * * @return Addr */ public function setStae($stae = '') { $this->stae = $stae; + return $this; } @@ -149,11 +156,13 @@ public function getStae() /** * @param string $post + * * @return Addr */ public function setPost($post = '') { $this->post = $post; + return $this; } @@ -167,11 +176,13 @@ public function getPost() /** * @param string $ctry + * * @return Addr */ public function setCtry($ctry = '') { $this->ctry = $ctry; + return $this; } diff --git a/src/Record/Birt.php b/src/Record/Birt.php new file mode 100644 index 00000000..7ff93c1a --- /dev/null +++ b/src/Record/Birt.php @@ -0,0 +1,134 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +/** + * Class Chan. + */ +class Birt extends \Gedcom\Record +{ + private $months = [ + 'JAN' => '01', 'FEB' => '02', 'MAR' => '03', 'APR' => '04', 'MAY' => '05', 'JUN' => '06', + 'JUL' => '07', 'AUG' => '08', 'SEP' => '09', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12', + ]; + + public $date; + + public $month; + + public $year; + + public $dateFormatted; + + public $dati; + + public $plac; + + public function setDate($date) + { + $this->date = $date; + if ($this->getDay()) { + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); + } else { + $this->month = $this->getMonth(); + $this->year = $this->getYear(); + } + } + + public function getDateFormatted() + { + return $this->dateFormatted; + } + + public function getDate() + { + return $this->date; + } + + public function setDati($dati) + { + $this->dati = $dati; + } + + public function getDati() + { + return $this->dati; + } + + public function setPlac($plac) + { + $this->plac = $plac; + } + + public function getPlac() + { + return $this->plac; + } + + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return $day; + } + } + } + + return null; + } + + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/src/Record/Buri.php b/src/Record/Buri.php new file mode 100644 index 00000000..6f2b6c51 --- /dev/null +++ b/src/Record/Buri.php @@ -0,0 +1,134 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +/** + * Class Chan. + */ +class Buri extends \Gedcom\Record +{ + private $months = [ + 'JAN' => '01', 'FEB' => '02', 'MAR' => '03', 'APR' => '04', 'MAY' => '05', 'JUN' => '06', + 'JUL' => '07', 'AUG' => '08', 'SEP' => '09', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12', + ]; + + public $date; + + public $month; + + public $year; + + public $dateFormatted = null; + + public $dati; + + public $plac; + + public function setDate($date) + { + $this->date = $date; + if ($this->getDay()) { + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); + } else { + $this->month = $this->getMonth(); + $this->year = $this->getYear(); + } + } + + public function getDateFormatted() + { + return $this->dateFormatted; + } + + public function getDate() + { + return $this->date; + } + + public function setDati($dati) + { + $this->dati = $dati; + } + + public function getDati() + { + return $this->dati; + } + + public function setPlac($plac) + { + $this->plac = $plac; + } + + public function getPlac() + { + return $this->plac; + } + + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return $day; + } + } + } + + return null; + } + + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/library/PhpGedcom/Record/Caln.php b/src/Record/Caln.php similarity index 83% rename from library/PhpGedcom/Record/Caln.php rename to src/Record/Caln.php index 7e01e22a..5927b008 100644 --- a/library/PhpGedcom/Record/Caln.php +++ b/src/Record/Caln.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Caln - * @package PhpGedcom\Record + * Class Caln. */ -class Caln extends Record +class Caln extends \Gedcom\Record { /** * @var string @@ -34,11 +31,13 @@ class Caln extends Record /** * @param string $caln + * * @return Caln */ public function setCaln($caln = '') { $this->caln = $caln; + return $this; } @@ -52,11 +51,13 @@ public function getCaln() /** * @param string $medi + * * @return Caln */ public function setMedi($medi = '') { $this->medi = $medi; + return $this; } diff --git a/src/Record/Chan.php b/src/Record/Chan.php new file mode 100644 index 00000000..2b72b00f --- /dev/null +++ b/src/Record/Chan.php @@ -0,0 +1,195 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +use Gedcom\Record; + +/** + * Class Chan. + */ +class Chan extends \Gedcom\Record +{ + /** + * @var array + */ + private $months = [ + 'JAN' => '01', 'FEB' => '02', 'MAR' => '03', 'APR' => '04', 'MAY' => '05', 'JUN' => '06', + 'JUL' => '07', 'AUG' => '08', 'SEP' => '09', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12', + ]; + + /** + * @var string + */ + protected $date; + + /** + * @var string + */ + protected $time; + + /** + * @var string + */ + protected $datetime = ''; + + /** + * @var array + */ + protected $note = []; + + /** + * @param string $date + * + * @return Chan + */ + public function setDate($date = '') + { + $this->date = $date; + + return $this; + } + + /** + * @return string + */ + public function getDate() + { + return $this->date; + } + + /** + * @param Record\NoteRef $note + * + * @return Chan + */ + public function addNote($note = []) + { + $this->note[] = $note; + + return $this; + } + + /** + * @return array + */ + public function getNote() + { + return $this->note; + } + + /** + * @param string $time + * + * @return Chan + */ + public function setTime($time = '') + { + $this->time = $time; + + return $this; + } + + /** + * @return string + */ + public function getTime() + { + return $this->time; + } + + public function setDatetime($date = '') + { + $this->datetime = $date.' '.$this->time; + + return $this; + } + + public function getDatetime() + { + return $this->datetime; + } + + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + /** + * Return year part of date. + * + * @return int|null + */ + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + /** + * Return day part of date. + * + * @return int|null + */ + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return substr("0{$day}", -2); + } + } + } + + return null; + } + + /** + * Check if the first part is a prefix (eg 'BEF', 'ABT',). + * + * @param string $datePart Date part to be checked + * + * @return bool + */ + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/src/Record/Chr.php b/src/Record/Chr.php new file mode 100644 index 00000000..0ab31edd --- /dev/null +++ b/src/Record/Chr.php @@ -0,0 +1,113 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +/** + * Class Chan. + */ +class Chr extends \Gedcom\Record +{ + private $months = [ + 'JAN' => '01', 'FEB' => '02', 'MAR' => '03', 'APR' => '04', 'MAY' => '05', 'JUN' => '06', + 'JUL' => '07', 'AUG' => '08', 'SEP' => '09', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12', + ]; + + public $date; + + public $dateFormatted = null; + + public $plac; + + public function setDate($date) + { + $this->date = $date; + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); + } + + public function getDateFormatted() + { + return $this->dateFormatted; + } + + public function getDate() + { + return $this->date; + } + + public function setPlac($plac) + { + $this->plac = $plac; + } + + public function getPlac() + { + return $this->plac; + } + + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return $day; + } + } + } + + return null; + } + + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/library/PhpGedcom/Record/Data.php b/src/Record/Data.php similarity index 83% rename from library/PhpGedcom/Record/Data.php rename to src/Record/Data.php index 83425243..e600d5ce 100644 --- a/library/PhpGedcom/Record/Data.php +++ b/src/Record/Data.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Data - * @package PhpGedcom\Record + * Class Data. */ -class Data extends Record +class Data extends \Gedcom\Record { /** * @var string @@ -34,11 +31,13 @@ class Data extends Record /** * @param string $text + * * @return Data */ public function setText($text = '') { $this->text = $text; + return $this; } @@ -52,11 +51,13 @@ public function getText() /** * @param string $date + * * @return Data */ public function setDate($date = '') { $this->date = $date; + return $this; } diff --git a/src/Record/Date.php b/src/Record/Date.php new file mode 100644 index 00000000..6a8799ad --- /dev/null +++ b/src/Record/Date.php @@ -0,0 +1,131 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +/** + * Class Date. + */ +class Date extends \Gedcom\Record +{ + /** + * @var string + */ + protected $date; + + /** + * @var array + */ + private $months = [ + 'JAN' => 1, 'FEB' => 2, 'MAR' => 3, 'APR' => 4, 'MAY' => 5, 'JUN' => 6, + 'JUL' => 7, 'AUG' => 8, 'SEP' => 9, 'OCT' => 10, 'NOV' => 11, 'DEC' => 12, + ]; + + /** + * @param string $date Date array + * + * @return Date + */ + public function setDate($date) + { + $this->date = $date; + + return $this; + } + + /** + * @return null|string + */ + public function getDate() + { + return $this->date; + } + + /** + * Return month part of date. + * + * @return int|null + */ + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + /** + * Return year part of date. + * + * @return int|null + */ + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + /** + * Return day part of date. + * + * @return int|null + */ + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return $day; + } + } + } + + return null; + } + + /** + * Check if the first part is a prefix (eg 'BEF', 'ABT',). + * + * @param string $datePart Date part to be checked + * + * @return bool + */ + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/src/Record/Deat.php b/src/Record/Deat.php new file mode 100644 index 00000000..9b342313 --- /dev/null +++ b/src/Record/Deat.php @@ -0,0 +1,146 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +/** + * Class Chan. + */ +class Deat extends \Gedcom\Record +{ + private $months = [ + 'JAN' => '01', 'FEB' => '02', 'MAR' => '03', 'APR' => '04', 'MAY' => '05', 'JUN' => '06', + 'JUL' => '07', 'AUG' => '08', 'SEP' => '09', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12', + ]; + + public $date; + + public $month; + + public $year; + + public $dateFormatted = null; + + public $dati; + + public $plac; + + public $caus; + + public function setDate($date) + { + $this->date = $date; + if ($this->getDay()) { + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); + } else { + $this->month = $this->getMonth(); + $this->year = $this->getYear(); + } + } + + public function getDateFormatted() + { + return $this->dateFormatted; + } + + public function getDate() + { + return $this->date; + } + + public function setDati($dati) + { + $this->dati = $dati; + } + + public function getDati() + { + return $this->dati; + } + + public function setPlac($plac) + { + $this->plac = $plac; + } + + public function getPlac() + { + return $this->plac; + } + + public function setCaus($caus) + { + $this->caus = $caus; + } + + public function getCaus() + { + return $this->caus; + } + + public function getDay() + { + $record = explode(' ', $this->date); + if (!empty($record[0])) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + $day = (int) reset($record); + if ($day >= 1 && $day <= 31) { + return $day; + } + } + } + + return null; + } + + public function getMonth() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + foreach ($record as $part) { + if (isset($this->months[trim($part)])) { + return $this->months[trim($part)]; + } + } + } + + return null; + } + + public function getYear() + { + $record = explode(' ', $this->date); + if (count($record) > 0) { + if ($this->isPrefix($record[0])) { + unset($record[0]); + } + if (count($record) > 0) { + return (int) end($record); + } + } + + return null; + } + + private function isPrefix($datePart) + { + return in_array($datePart, ['FROM', 'TO', 'BEF', 'AFT', 'BET', 'AND', 'ABT', 'EST', 'CAL', 'INT']); + } +} diff --git a/src/Record/Fam.php b/src/Record/Fam.php new file mode 100644 index 00000000..bde80852 --- /dev/null +++ b/src/Record/Fam.php @@ -0,0 +1,96 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +class Fam extends \Gedcom\Record implements Noteable, Sourceable, Objectable +{ + protected $_id; + + protected $_resn; + + protected $_even = []; + + protected $_husb; + + protected $_wife; + + protected $_chil = []; + + protected $_nchi; + + protected $_subm = []; + + protected $_slgs = []; + + protected $_refn = []; + + protected $_rin; + + protected $_chan; + + protected $_note = []; + + protected $_sour = []; + + protected $_obje = []; + + public function addEven($even) + { + $this->_even[$even->getType()] = $even; + } + + /** + * @return array + */ + public function getAllEven() + { + return $this->_even; + } + + /** + * @return void|\Gedcom\Record\Fam\Even + */ + public function getEven($key = '') + { + if (isset($this->_even[strtoupper($key)])) { + return $this->_even[strtoupper($key)]; + } + } + + public function addSlgs($slgs = []) + { + $this->_slgs[] = $slgs; + } + + public function addRefn($refn = []) + { + $this->_refn[] = $refn; + } + + public function addNote($note = []) + { + $this->_note[] = $note; + } + + public function addSour($sour = []) + { + $this->_sour[] = $sour; + } + + public function addObje($obje = []) + { + $this->_obje[] = $obje; + } +} diff --git a/src/Record/Fam/Anul.php b/src/Record/Fam/Anul.php new file mode 100644 index 00000000..18e986b0 --- /dev/null +++ b/src/Record/Fam/Anul.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Anul extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Cens.php b/src/Record/Fam/Cens.php new file mode 100644 index 00000000..1c0259f5 --- /dev/null +++ b/src/Record/Fam/Cens.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Cens extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Div.php b/src/Record/Fam/Div.php new file mode 100644 index 00000000..b8cf7768 --- /dev/null +++ b/src/Record/Fam/Div.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Div extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Enga.php b/src/Record/Fam/Enga.php new file mode 100644 index 00000000..c23e9e9b --- /dev/null +++ b/src/Record/Fam/Enga.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Enga extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Even.php b/src/Record/Fam/Even.php new file mode 100644 index 00000000..36e88482 --- /dev/null +++ b/src/Record/Fam/Even.php @@ -0,0 +1,150 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +use Gedcom\Record\Noteable; +use Gedcom\Record\Objectable; +use Gedcom\Record\Sourceable; + +/** + * Event record. + * + * @method mixed getType() + * @method \Record\Date getDate() + * @method string getPlac() + */ +class Even extends \Gedcom\Record implements Objectable, Sourceable, Noteable +{ + protected $_type; + protected $_date; + protected $_plac; + protected $_caus; + protected $_age; + + protected $_addr; + + protected $_phon = []; + + protected $_agnc; + + protected $_husb; + protected $_wife; + + protected $_obje = []; + + protected $_sour = []; + + protected $_note = []; + + public function addPhon($phon = []) + { + $this->_phon[] = $phon; + } + + public function addObje($obje = []) + { + $this->_obje[] = $obje; + } + + public function addSour($sour = []) + { + $this->_sour[] = $sour; + } + + public function addNote($note = []) + { + $this->_note[] = $note; + } + + /** + * @return string + */ + public function getDate() + { + return $this->_date; + } + + /** + * @return \PhpGedcom\Record\Indi\Even\Plac + */ + public function getPlac() + { + return $this->_plac; + } + + /** + * @return array + */ + public function getSour() + { + return $this->_sour; + } + + /** + * @return array + */ + public function getNote() + { + return $this->_note; + } + + /** + * @return array + */ + public function getObje() + { + return $this->_obje; + } + + /** + * @return \PhpGedcom\Record\Addr + */ + public function getAddr() + { + return $this->_addr; + } + + /** + * @return string + */ + public function getAge() + { + return $this->_age; + } + + /** + * @return string + */ + public function getAgnc() + { + return $this->_agnc; + } + + /** + * @return string + */ + public function getCaus() + { + return $this->_caus; + } + + /** + * @return string + */ + public function getType() + { + return $this->_type; + } +} diff --git a/src/Record/Fam/Even/Husb.php b/src/Record/Fam/Even/Husb.php new file mode 100644 index 00000000..d3ad66eb --- /dev/null +++ b/src/Record/Fam/Even/Husb.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam\Even; + +class Husb extends \Gedcom\Record +{ + protected $_age; +} diff --git a/src/Record/Fam/Even/Wife.php b/src/Record/Fam/Even/Wife.php new file mode 100644 index 00000000..1f58cd40 --- /dev/null +++ b/src/Record/Fam/Even/Wife.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam\Even; + +class Wife extends \Gedcom\Record +{ + protected $_age; +} diff --git a/src/Record/Fam/Marb.php b/src/Record/Fam/Marb.php new file mode 100644 index 00000000..7e93d5c6 --- /dev/null +++ b/src/Record/Fam/Marb.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Marb extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Marc.php b/src/Record/Fam/Marc.php new file mode 100644 index 00000000..372421d2 --- /dev/null +++ b/src/Record/Fam/Marc.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Marc extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Marl.php b/src/Record/Fam/Marl.php new file mode 100644 index 00000000..a90150e7 --- /dev/null +++ b/src/Record/Fam/Marl.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Marl extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Marr.php b/src/Record/Fam/Marr.php new file mode 100644 index 00000000..c48ce5b6 --- /dev/null +++ b/src/Record/Fam/Marr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Marr extends \Gedcom\Record\Fam\Even +{ +} diff --git a/src/Record/Fam/Mars.php b/src/Record/Fam/Mars.php new file mode 100644 index 00000000..0f90c9c5 --- /dev/null +++ b/src/Record/Fam/Mars.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Fam; + +class Mars extends \Gedcom\Record\Fam\Even +{ +} diff --git a/library/PhpGedcom/Record/Fam/Slgs.php b/src/Record/Fam/Slgs.php similarity index 59% rename from library/PhpGedcom/Record/Fam/Slgs.php rename to src/Record/Fam/Slgs.php index e508b27b..7d230947 100644 --- a/library/PhpGedcom/Record/Fam/Slgs.php +++ b/src/Record/Fam/Slgs.php @@ -1,53 +1,38 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Fam; +namespace Gedcom\Record\Fam; -use \PhpGedcom\Record\Sourceable; -use \PhpGedcom\Record\Noteable; +use Gedcom\Record\Noteable; +use Gedcom\Record\Sourceable; -/** - * - */ -class Slgs extends \PhpGedcom\Record implements Sourceable, Noteable +class Slgs extends \Gedcom\Record implements Sourceable, Noteable { protected $_stat; protected $_date; protected $_plac; protected $_temp; - /** - * - */ - protected $_sour = array(); + protected $_sour = []; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ public function addSour($sour = []) { $this->_sour[] = $sour; } - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; diff --git a/src/Record/Fam/Slgs/Stat.php b/src/Record/Fam/Slgs/Stat.php new file mode 100644 index 00000000..c19ad201 --- /dev/null +++ b/src/Record/Fam/Slgs/Stat.php @@ -0,0 +1,29 @@ + * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** * Stores the data from the HEAD section of a GEDCOM 5.5 file. */ -class Head extends Record +class Head extends \Gedcom\Record { /** * @var Head\Sour */ - protected $sour = null; + protected $sour; /** * @var string */ - protected $dest = null; + protected $dest; /** * @var Head\Date */ - protected $date = null; + protected $date; /** * @var string */ - protected $subm = null; + protected $subm; /** * @var string */ - protected $subn = null; + protected $subn; /** * @var string */ - protected $file = null; + protected $file; /** * @var string */ - protected $copr = null; + protected $copr; /** * @var Head\Gedc */ - protected $gedc = null; + protected $gedc; /** * @var Head\Char */ - protected $char = null; + protected $char; /** * @var string */ - protected $lang = null; + protected $lang; /** * @var Head\Plac */ - protected $plac = null; + protected $plac; /** * @var string */ - protected $note = null; + protected $note; /** - * @param \PhpGedcom\Record\Head\Sour $sour + * @param \Gedcom\Record\Head\Sour $sour + * * @return Head */ public function setSour($sour = []) { $this->sour = $sour; + return $this; } /** - * @return \PhpGedcom\Record\Head\Sour + * @return \Gedcom\Record\Head\Sour */ public function getSour() { @@ -100,17 +100,19 @@ public function getSour() } /** - * @param \PhpGedcom\Record\Head\Date $date + * @param \Gedcom\Record\Head\Date $date + * * @return Head */ public function setDate($date = []) { $this->date = $date; + return $this; } /** - * @return \PhpGedcom\Record\Head\Date + * @return \Gedcom\Record\Head\Date */ public function getDate() { @@ -118,17 +120,19 @@ public function getDate() } /** - * @param \PhpGedcom\Record\Head\Gedc $gedc + * @param \Gedcom\Record\Head\Gedc $gedc + * * @return Head */ public function setGedc($gedc = []) { $this->gedc = $gedc; + return $this; } /** - * @return \PhpGedcom\Record\Head\Gedc + * @return \Gedcom\Record\Head\Gedc */ public function getGedc() { @@ -136,17 +140,19 @@ public function getGedc() } /** - * @param \PhpGedcom\Record\Head\Char $char + * @param \Gedcom\Record\Head\Char $char + * * @return Head */ public function setChar($char = []) { $this->char = $char; + return $this; } /** - * @return \PhpGedcom\Record\Head\Char + * @return \Gedcom\Record\Head\Char */ public function getChar() { @@ -154,17 +160,19 @@ public function getChar() } /** - * @param \PhpGedcom\Record\Head\Plac $plac + * @param \Gedcom\Record\Head\Plac $plac + * * @return Head */ public function setPlac($plac = []) { $this->plac = $plac; + return $this; } /** - * @return \PhpGedcom\Record\Head\Plac + * @return \Gedcom\Record\Head\Plac */ public function getPlac() { @@ -173,11 +181,13 @@ public function getPlac() /** * @param string $subm + * * @return Head */ public function setSubm($subm = '') { $this->subm = $subm; + return $this; } @@ -191,11 +201,13 @@ public function getSubm() /** * @param string $subn + * * @return Head */ public function setSubn($subn = '') { $this->subn = $subn; + return $this; } @@ -209,11 +221,13 @@ public function getSubn() /** * @param string $lang + * * @return Head */ public function setLang($lang = '') { $this->lang = $lang; + return $this; } @@ -227,11 +241,13 @@ public function getLang() /** * @param string $file + * * @return Head */ public function setFile($file = '') { $this->file = $file; + return $this; } @@ -245,11 +261,13 @@ public function getFile() /** * @param string $dest + * * @return Head */ public function setDest($dest = '') { $this->dest = $dest; + return $this; } @@ -263,11 +281,13 @@ public function getDest() /** * @param string $copr + * * @return Head */ public function setCopr($copr = '') { $this->copr = $copr; + return $this; } @@ -281,11 +301,13 @@ public function getCopr() /** * @param string $note + * * @return Head */ public function setNote($note = '') { $this->note = $note; + return $this; } diff --git a/src/Record/Head/Char.php b/src/Record/Head/Char.php new file mode 100644 index 00000000..b0aedf92 --- /dev/null +++ b/src/Record/Head/Char.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Head; + +class Char extends \Gedcom\Record +{ + protected $_char; + protected $_vers; +} diff --git a/src/Record/Head/Date.php b/src/Record/Head/Date.php new file mode 100644 index 00000000..0f9e8608 --- /dev/null +++ b/src/Record/Head/Date.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Head; + +class Date extends \Gedcom\Record +{ + protected $_date; + protected $_time; +} diff --git a/src/Record/Head/Gedc.php b/src/Record/Head/Gedc.php new file mode 100644 index 00000000..c62c4e04 --- /dev/null +++ b/src/Record/Head/Gedc.php @@ -0,0 +1,54 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Head; + +class Gedc extends \Gedcom\Record +{ + protected $_vers; + + protected $_form; + + /** + * @return Gedc/version + */ + public function getVersion() + { + return $this->_vers; + } + + /** + * @param Gedc/version + */ + public function setVersion($vers = []) + { + $this->_vers = $vers; + } + + /** + * @return Gedc/form + */ + public function getForm() + { + return $this->_form; + } + + /** + * @param Gedc/version + */ + public function setForm($form = []) + { + $this->_form = $form; + } +} diff --git a/src/Record/Head/Plac.php b/src/Record/Head/Plac.php new file mode 100644 index 00000000..70ea4bfd --- /dev/null +++ b/src/Record/Head/Plac.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Head; + +class Plac extends \Gedcom\Record +{ + protected $_form; +} diff --git a/library/PhpGedcom/Record/Head/Sour.php b/src/Record/Head/Sour.php similarity index 52% rename from library/PhpGedcom/Record/Head/Sour.php rename to src/Record/Head/Sour.php index c3dfc6f6..b1a9281c 100644 --- a/library/PhpGedcom/Record/Head/Sour.php +++ b/src/Record/Head/Sour.php @@ -1,51 +1,32 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Head; +namespace Gedcom\Record\Head; -/** - * - */ -class Sour extends \PhpGedcom\Record +class Sour extends \Gedcom\Record { - /** - * - */ - protected $_sour = null; + protected $_sour; - /** - * - */ - protected $_vers = null; + protected $_vers; - /** - * - */ - protected $_name = null; + protected $_name; - /** - * - */ - protected $_corp = null; + protected $_corp; - /** - * - */ - protected $_data = null; + protected $_data; /** - * * @param Sour\Corp $corp */ public function setCorp($corp = []) @@ -54,7 +35,6 @@ public function setCorp($corp = []) } /** - * * @return Sour\Corp */ public function getCorp() @@ -63,8 +43,7 @@ public function getCorp() } /** - * - * @param \PhpGedcom\Record\Head\Sour\Data $data + * @param \Gedcom\Record\Head\Sour\Data $data */ public function setData($data = []) { @@ -72,11 +51,42 @@ public function setData($data = []) } /** - * - * @return \PhpGedcom\Record\Head\Sour\Data + * @return \Gedcom\Record\Head\Sour\Data */ public function getData() { return $this->_data; } + + /** + * @return Sour\Name + */ + public function getName() + { + return $this->_name; + } + + /** + * @param Sour\Name + */ + public function setName($name = []) + { + $this->_name = $name; + } + + /** + * @return Sour\Version + */ + public function getVersion() + { + return $this->_vers; + } + + /** + * @param Sour\Version + */ + public function setVersion($version = []) + { + $this->_vers = $version; + } } diff --git a/library/PhpGedcom/Record/Head/Sour/Corp.php b/src/Record/Head/Sour/Corp.php similarity index 60% rename from library/PhpGedcom/Record/Head/Sour/Corp.php rename to src/Record/Head/Sour/Corp.php index 13a8b8cd..4eb29203 100644 --- a/library/PhpGedcom/Record/Head/Sour/Corp.php +++ b/src/Record/Head/Sour/Corp.php @@ -1,33 +1,26 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Head\Sour; +namespace Gedcom\Record\Head\Sour; -/** - * - */ -class Corp extends \PhpGedcom\Record +class Corp extends \Gedcom\Record { - protected $_corp = null; - protected $_addr = null; + protected $_corp; + protected $_addr; - protected $_phon = array(); + protected $_phon = []; - /** - * - * - */ public function addPhon($phon = []) { $this->_phon[] = $phon; diff --git a/library/PhpGedcom/Parser/Fam/Divf.php b/src/Record/Head/Sour/Data.php similarity index 65% rename from library/PhpGedcom/Parser/Fam/Divf.php rename to src/Record/Head/Sour/Data.php index e7c810f8..cf09846d 100644 --- a/library/PhpGedcom/Parser/Fam/Divf.php +++ b/src/Record/Head/Sour/Data.php @@ -1,23 +1,22 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Fam; +namespace Gedcom\Record\Head\Sour; -/** - * - * - */ -class Divf extends \PhpGedcom\Parser\Fam\Even +class Data extends \Gedcom\Record { + protected $_data; + protected $_date; + protected $_copr; } diff --git a/library/PhpGedcom/Record/Indi.php b/src/Record/Indi.php similarity index 72% rename from library/PhpGedcom/Record/Indi.php rename to src/Record/Indi.php index 16efa4dd..610b54e5 100644 --- a/library/PhpGedcom/Record/Indi.php +++ b/src/Record/Indi.php @@ -1,30 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; -use PhpGedcom\Record\NoteRef; -use PhpGedcom\Record\ObjeRef; -use PhpGedcom\Record\Refn; -use PhpGedcom\Record\SourRef; +namespace Gedcom\Record; /** - * Class Indi - * @package PhpGedcom\Record + * Class Indi. */ -class Indi extends Record implements Noteable, Objectable, Sourceable +class Indi extends \Gedcom\Record implements Noteable, Objectable, Sourceable { /** * @var string @@ -34,135 +27,179 @@ class Indi extends Record implements Noteable, Objectable, Sourceable /** * @var string */ - protected $uid; + protected $gid; /** * @var string */ - protected $chan; + protected $uid; /** - * @var Indi\Attr[] + * @var string + */ + protected $resn; + /** + * @var Indi\Name[] + */ + protected $name = []; + /** + * @var string */ - protected $attr = array(); + protected $sex; /** * @var Indi\Even[] */ - protected $even = array(); - + protected $even = []; /** - * @var Indi\Note[] + * @var Indi\Attr[] */ - protected $note = array(); + protected $attr = []; + /** + * @var Indi\Bapl + */ + protected $bapl = []; /** - * @var Obje[] + * @var Indi\Conl */ - protected $obje = array(); + protected $conl = []; /** - * @var Sour[] + * @var Indi\Endl */ - protected $sour = array(); + protected $endl = []; /** - * @var Indi\Name[] + * @var Indi\Slgc */ - protected $name = array(); + protected $slgc = []; + /** + * @var Indi\Famc[] + */ + protected $famc = []; + /** + * @var Indi\Fams[] + */ + protected $fams = []; /** * @var string[] */ - protected $alia = array(); - + protected $subm = []; /** - * @var string + * @var string[] */ - protected $sex; - + protected $alia = []; /** - * @var string + * @var string[] */ - protected $rin; - + protected $anci = []; /** - * @var string + * @var string[] */ - protected $resn; - + protected $desi = []; /** * @var string */ protected $rfn; - /** * @var string */ protected $afn; - /** - * @var Indi\Fams[] + * @var Refn[] */ - protected $fams = array(); - + protected $refn = []; /** - * @var Indi\Famc[] + * @var string */ - protected $famc = array(); + protected $rin; /** - * @var Indi\Asso[] + * @var string */ - protected $asso = array(); + protected $chan; /** - * @var string[] + * @var Indi\Note[] */ - protected $subm = array(); + protected $note = []; /** - * @var string[] + * @var Obje[] */ - protected $anci = array(); + protected $obje = []; /** - * @var string[] + * @var Sour[] */ - protected $desi = array(); + protected $sour = []; /** - * @var Refn[] + * @var Indi\Asso[] */ - protected $refn = array(); + protected $asso = []; - /** - * @var Indi\Bapl - */ - protected $bapl; + protected $deathday = []; - /** - * @var Indi\Conl - */ - protected $conl; + protected $birt; - /** - * @var Indi\Endl - */ - protected $endl; + protected $buri; - /** - * @var Indi\Slgc - */ - protected $slgc; + protected $deat; + + protected $chr; + + public function setBirt($birt) + { + $this->birt = $birt; + } + + public function getBirt() + { + return $this->birt; + } + + public function setBuri($buri) + { + $this->buri = $buri; + } + + public function getBuri() + { + return $this->buri; + } + + public function setDeat($deat) + { + $this->deat = $deat; + } + + public function getDeat() + { + return $this->deat; + } + + public function setChr($chr) + { + $this->chr = $chr; + } + + public function getChr() + { + return $this->chr; + } /** * @param string $id + * * @return Indi */ public function setId($id = '') { $this->id = $id; + return $this; } @@ -174,13 +211,35 @@ public function getId() return $this->id; } + /** + * @param string $id + * + * @return Indi + */ + public function setGid($gid = '') + { + $this->gid = $gid; + + return $this; + } + + /** + * @return string + */ + public function getGid() + { + return $this->gid; + } + /** * @param string $uid + * * @return Indi */ public function setUid($uid = '') { $this->uid = $uid; + return $this; } @@ -194,11 +253,13 @@ public function getUid() /** * @param Indi\Name $name + * * @return Indi */ public function addName($name = []) { $this->name[] = $name; + return $this; } @@ -212,6 +273,7 @@ public function getName() /** * @param Indi\Attr $attr + * * @return Indi */ public function addAttr($attr = []) @@ -223,28 +285,31 @@ public function addAttr($attr = []) } $this->attr[$attrName][] = $attr; + return $this; } - /** - * @return array - */ - public function getAllAttr() - { - return $this->attr; - } - - /** - * @return Indi\Attr[] - */ - public function getAttr($key = '') - { - if(isset($this->attr[strtoupper($key)])) - return $this->attr[strtoupper($key)]; - } - - /** + /** + * @return Indi\Attr[] + */ + public function getAllAttr() + { + return $this->attr; + } + + /** + * @return Indi\Attr[] + */ + public function getAttr($key = '') + { + if (isset($this->attr[strtoupper($key)])) { + return $this->attr[strtoupper($key)]; + } + } + + /** * @param Indi\Even $even + * * @return Indi */ public function addEven($even = []) @@ -256,33 +321,37 @@ public function addEven($even = []) } $this->even[$evenName][] = $even; + return $this; } - /** - * @return array - */ - public function getAllEven() - { - return $this->even; - } - - /** - * @return array - */ - public function getEven($key = '') - { - if(isset($this->even[strtoupper($key)])) - return $this->even[strtoupper($key)]; - } - - /** + /** + * @return array + */ + public function getAllEven() + { + return $this->even; + } + + /** + * @return array + */ + public function getEven($key = '') + { + if (isset($this->even[strtoupper($key)])) { + return $this->even[strtoupper($key)]; + } + } + + /** * @param Indi\Asso $asso + * * @return Indi */ public function addAsso($asso = []) { $this->asso[] = $asso; + return $this; } @@ -296,11 +365,13 @@ public function getAsso() /** * @param Refn $ref + * * @return Indi */ public function addRefn($ref = []) { $this->refn[] = $ref; + return $this; } @@ -313,12 +384,14 @@ public function getRefn() } /** - * @param NoteRef $note + * @param \Gedcom\Record\NoteRef $note + * * @return Indi */ public function addNote($note = []) { $this->note[] = $note; + return $this; } @@ -332,11 +405,13 @@ public function getNote() /** * @param ObjeRef $obje + * * @return Indi */ public function addObje($obje = []) { $this->obje[] = $obje; + return $this; } @@ -350,11 +425,13 @@ public function getObje() /** * @param SourRef $sour + * * @return Indi */ public function addSour($sour = []) { $this->sour[] = $sour; + return $this; } @@ -368,11 +445,13 @@ public function getSour() /** * @param string $indi + * * @return Indi */ public function addAlia($indi = '') { $this->alia[] = $indi; + return $this; } @@ -386,11 +465,13 @@ public function getAlia() /** * @param Indi\Famc $famc + * * @return Indi */ public function addFamc($famc = []) { $this->famc[] = $famc; + return $this; } @@ -404,11 +485,13 @@ public function getFamc() /** * @param Indi\Fams $fams + * * @return Indi */ public function addFams($fams = []) { $this->fams[] = $fams; + return $this; } @@ -422,11 +505,13 @@ public function getFams() /** * @param string $subm + * * @return Indi */ public function addAnci($subm = '') { $this->anci[] = $subm; + return $this; } @@ -440,11 +525,13 @@ public function getAnci() /** * @param string $subm + * * @return Indi */ public function addDesi($subm = '') { $this->desi[] = $subm; + return $this; } @@ -458,11 +545,13 @@ public function getDesi() /** * @param string $subm + * * @return Indi */ public function addSubm($subm = '') { $this->subm[] = $subm; + return $this; } @@ -476,11 +565,13 @@ public function getSubm() /** * @param string $resn + * * @return Indi */ public function setResn($resn = '') { $this->resn = $resn; + return $this; } @@ -494,11 +585,13 @@ public function getResn() /** * @param string $sex + * * @return Indi */ public function setSex($sex = '') { $this->sex = $sex; + return $this; } @@ -512,11 +605,13 @@ public function getSex() /** * @param string $rfn + * * @return Indi */ public function setRfn($rfn = '') { $this->rfn = $rfn; + return $this; } @@ -530,11 +625,13 @@ public function getRfn() /** * @param string $afn + * * @return Indi */ public function setAfn($afn = '') { $this->afn = $afn; + return $this; } @@ -548,11 +645,13 @@ public function getAfn() /** * @param string $chan + * * @return Indi */ - public function setChan($chan = '') + public function setChan($chan = null) { $this->chan = $chan; + return $this; } @@ -566,11 +665,13 @@ public function getChan() /** * @param string $rin + * * @return Indi */ public function setRin($rin = '') { $this->rin = $rin; + return $this; } @@ -584,11 +685,25 @@ public function getRin() /** * @param Indi\Bapl $bapl + * * @return Indi */ public function setBapl($bapl = []) { $this->bapl = $bapl; + + return $this; + } + + /** + * @param Indi\Bapl $bapl + * + * @return Indi + */ + public function addBapl($bapl = null) + { + $this->bapl[] = $bapl; + return $this; } @@ -602,11 +717,25 @@ public function getBapl() /** * @param Indi\Conl $conl + * * @return Indi */ public function setConl($conl = []) { $this->conl = $conl; + + return $this; + } + + /** + * @param Indi\Conl $conl + * + * @return Indi + */ + public function addConl($conl) + { + $this->conl[] = $conl; + return $this; } @@ -620,11 +749,25 @@ public function getConl() /** * @param Indi\Endl $endl + * * @return Indi */ public function setEndl($endl = []) { $this->endl = $endl; + + return $this; + } + + /** + * @param Indi\Endl $endl + * + * @return Indi + */ + public function addEndl($endl) + { + $this->endl[] = $endl; + return $this; } @@ -638,11 +781,25 @@ public function getEndl() /** * @param Indi\Slgc $slgc + * * @return Indi */ public function setSlgc($slgc = []) { $this->slgc = $slgc; + + return $this; + } + + /** + * @param Indi\Slgc $slgc + * + * @return Indi + */ + public function addSlgc($slgc) + { + $this->slgc[] = $slgc; + return $this; } diff --git a/src/Record/Indi/Adop.php b/src/Record/Indi/Adop.php new file mode 100644 index 00000000..d63a3647 --- /dev/null +++ b/src/Record/Indi/Adop.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Adop extends \Gedcom\Record\Indi\Even +{ + protected $_adop; + protected $_famc; +} diff --git a/library/PhpGedcom/Record/Indi/Asso.php b/src/Record/Indi/Asso.php similarity index 52% rename from library/PhpGedcom/Record/Indi/Asso.php rename to src/Record/Indi/Asso.php index 5a7ea9b6..fac6ef1d 100644 --- a/library/PhpGedcom/Record/Indi/Asso.php +++ b/src/Record/Indi/Asso.php @@ -1,51 +1,36 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -use \PhpGedcom\Record\Sourceable; -use \PhpGedcom\Record\Noteable; +use Gedcom\Record\Noteable; +use Gedcom\Record\Sourceable; -/** - * - */ -class Asso extends \PhpGedcom\Record implements Sourceable, Noteable +class Asso extends \Gedcom\Record implements Sourceable, Noteable { - protected $_indi = null; - protected $_rela = null; + protected $_indi; + protected $_rela; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ - protected $_sour = array(); + protected $_sour = []; - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; } - /** - * - */ public function addSour($sour = []) { $this->_sour[] = $sour; diff --git a/src/Record/Indi/Attr.php b/src/Record/Indi/Attr.php new file mode 100644 index 00000000..cd40ea13 --- /dev/null +++ b/src/Record/Indi/Attr.php @@ -0,0 +1,46 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +use Gedcom\Record\Noteable; +use Gedcom\Record\Objectable; +use Gedcom\Record\Sourceable; + +class Attr extends \Gedcom\Record\Indi\Even implements Sourceable, Noteable, Objectable +{ + protected $type; + protected $_attr; + + protected $sour = []; + + protected $note = []; + + protected $obje = []; + + public function addSour($sour = []) + { + $this->sour[] = $sour; + } + + public function addNote($note = []) + { + $this->note[] = $note; + } + + public function addObje($obje = []) + { + $this->obje[] = $obje; + } +} diff --git a/library/PhpGedcom/Record/Indi/Bapl.php b/src/Record/Indi/Bapl.php similarity index 75% rename from library/PhpGedcom/Record/Indi/Bapl.php rename to src/Record/Indi/Bapl.php index 32d17b71..e5d2dcc9 100644 --- a/library/PhpGedcom/Record/Indi/Bapl.php +++ b/src/Record/Indi/Bapl.php @@ -1,22 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -/** - * - */ class Bapl extends Lds { } diff --git a/src/Record/Indi/Bapm.php b/src/Record/Indi/Bapm.php new file mode 100644 index 00000000..29c814fd --- /dev/null +++ b/src/Record/Indi/Bapm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Bapm extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Barm.php b/src/Record/Indi/Barm.php new file mode 100644 index 00000000..07d71dbd --- /dev/null +++ b/src/Record/Indi/Barm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Barm extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Basm.php b/src/Record/Indi/Basm.php new file mode 100644 index 00000000..c30bb232 --- /dev/null +++ b/src/Record/Indi/Basm.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Basm extends \Gedcom\Record\Indi\Even +{ +} diff --git a/library/PhpGedcom/Record/Indi/Birt.php b/src/Record/Indi/Birt.php similarity index 78% rename from library/PhpGedcom/Record/Indi/Birt.php rename to src/Record/Indi/Birt.php index dbbd04d3..5ba17a50 100644 --- a/library/PhpGedcom/Record/Indi/Birt.php +++ b/src/Record/Indi/Birt.php @@ -1,24 +1,21 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; - -use PhpGedcom\Record\Indi\Even; +namespace Gedcom\Record\Indi; /** - * Class Birt - * @package PhpGedcom\Record\Indi + * Class Birt. */ class Birt extends Even { @@ -29,11 +26,13 @@ class Birt extends Even /** * @param string $famc + * * @return Birt */ public function setFamc($famc = '') { $this->famc = $famc; + return $this; } diff --git a/src/Record/Indi/Bles.php b/src/Record/Indi/Bles.php new file mode 100644 index 00000000..f7195d95 --- /dev/null +++ b/src/Record/Indi/Bles.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Bles extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Buri.php b/src/Record/Indi/Buri.php new file mode 100644 index 00000000..0dfb6cc6 --- /dev/null +++ b/src/Record/Indi/Buri.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Buri extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Cast.php b/src/Record/Indi/Cast.php new file mode 100644 index 00000000..21795c12 --- /dev/null +++ b/src/Record/Indi/Cast.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Cast extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Cens.php b/src/Record/Indi/Cens.php new file mode 100644 index 00000000..431f3bd2 --- /dev/null +++ b/src/Record/Indi/Cens.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Cens extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Chr.php b/src/Record/Indi/Chr.php new file mode 100644 index 00000000..45b80d19 --- /dev/null +++ b/src/Record/Indi/Chr.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Chr extends \Gedcom\Record\Indi\Even +{ + protected $_famc; +} diff --git a/src/Record/Indi/Chra.php b/src/Record/Indi/Chra.php new file mode 100644 index 00000000..7a5b5d73 --- /dev/null +++ b/src/Record/Indi/Chra.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Chra extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Conf.php b/src/Record/Indi/Conf.php new file mode 100644 index 00000000..3e635ffd --- /dev/null +++ b/src/Record/Indi/Conf.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Conf extends \Gedcom\Record\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Conl.php b/src/Record/Indi/Conl.php similarity index 74% rename from library/PhpGedcom/Parser/Indi/Conl.php rename to src/Record/Indi/Conl.php index 511262ef..5e96638b 100644 --- a/library/PhpGedcom/Parser/Indi/Conl.php +++ b/src/Record/Indi/Conl.php @@ -1,23 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Record\Indi; -/** - * - * - */ class Conl extends Lds { } diff --git a/src/Record/Indi/Crem.php b/src/Record/Indi/Crem.php new file mode 100644 index 00000000..6c60b4b1 --- /dev/null +++ b/src/Record/Indi/Crem.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Crem extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Deat.php b/src/Record/Indi/Deat.php new file mode 100644 index 00000000..b29db0a5 --- /dev/null +++ b/src/Record/Indi/Deat.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Deat extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Dscr.php b/src/Record/Indi/Dscr.php new file mode 100644 index 00000000..65ccf6ab --- /dev/null +++ b/src/Record/Indi/Dscr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Dscr extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Educ.php b/src/Record/Indi/Educ.php new file mode 100644 index 00000000..5486e03a --- /dev/null +++ b/src/Record/Indi/Educ.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Educ extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Emig.php b/src/Record/Indi/Emig.php new file mode 100644 index 00000000..ee529143 --- /dev/null +++ b/src/Record/Indi/Emig.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Emig extends \Gedcom\Record\Indi\Even +{ +} diff --git a/library/PhpGedcom/Parser/Indi/Endl.php b/src/Record/Indi/Endl.php similarity index 74% rename from library/PhpGedcom/Parser/Indi/Endl.php rename to src/Record/Indi/Endl.php index b28e68d2..552e2d7d 100644 --- a/library/PhpGedcom/Parser/Indi/Endl.php +++ b/src/Record/Indi/Endl.php @@ -1,23 +1,19 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser\Indi; +namespace Gedcom\Record\Indi; -/** - * - * - */ class Endl extends Lds { } diff --git a/library/PhpGedcom/Record/Indi/Even.php b/src/Record/Indi/Even.php similarity index 87% rename from library/PhpGedcom/Record/Indi/Even.php rename to src/Record/Indi/Even.php index 47335135..3c8c177e 100644 --- a/library/PhpGedcom/Record/Indi/Even.php +++ b/src/Record/Indi/Even.php @@ -1,32 +1,36 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -use \PhpGedcom\Record; +use Gedcom\Record; /** - * Class Even - * @package PhpGedcom\Record\Indi + * Class Even. */ -class Even extends Record implements Record\Objectable, Record\Sourceable, Record\Noteable +class Even extends \Gedcom\Record implements Record\Objectable, Record\Sourceable, Record\Noteable { /** * @var string */ protected $type; + /** + * @var string + */ + protected $_attr; + /** * @var string */ @@ -55,7 +59,7 @@ class Even extends Record implements Record\Objectable, Record\Sourceable, Recor /** * @var array */ - protected $phon = array(); + protected $phon = []; /** * @var string @@ -65,22 +69,22 @@ class Even extends Record implements Record\Objectable, Record\Sourceable, Recor /** * @var array */ - public $ref = array(); + public $ref = []; /** * @var array */ - protected $obje = array(); + protected $obje = []; /** * @var array */ - protected $sour = array(); + protected $sour = []; /** * @var array */ - protected $note = array(); + protected $note = []; /** * @var Record\Chan @@ -97,11 +101,13 @@ public function getPhon() /** * @param Record\Phon $phon + * * @return Even */ public function addPhon($phon = []) { $this->phon[] = $phon; + return $this; } @@ -115,11 +121,13 @@ public function getObje() /** * @param Record\ObjeRef $obje + * * @return Even */ public function addObje($obje = []) { $this->obje[] = $obje; + return $this; } @@ -133,11 +141,13 @@ public function getSour() /** * @param Record\SourRef $sour + * * @return Even */ public function addSour($sour = []) { $this->sour[] = $sour; + return $this; } @@ -151,26 +161,30 @@ public function getNote() /** * @param Record\NoteRef $note + * * @return Even */ public function addNote($note = []) { $this->note[] = $note; + return $this; } /** - * @param \PhpGedcom\Record\Addr $addr + * @param \Gedcom\Record\Addr $addr + * * @return Even */ public function setAddr($addr = []) { $this->addr = $addr; + return $this; } /** - * @return \PhpGedcom\Record\Addr + * @return \Gedcom\Record\Addr */ public function getAddr() { @@ -179,11 +193,13 @@ public function getAddr() /** * @param string $age + * * @return Even */ public function setAge($age = '') { $this->age = $age; + return $this; } @@ -197,11 +213,13 @@ public function getAge() /** * @param string $agnc + * * @return Even */ public function setAgnc($agnc = '') { $this->agnc = $agnc; + return $this; } @@ -215,11 +233,13 @@ public function getAgnc() /** * @param string $caus + * * @return Even */ public function setCaus($caus = '') { $this->caus = $caus; + return $this; } @@ -233,11 +253,13 @@ public function getCaus() /** * @param string $date + * * @return Even */ public function setDate($date = '') { $this->date = $date; + return $this; } @@ -250,17 +272,19 @@ public function getDate() } /** - * @param \PhpGedcom\Record\Indi\Even\Plac $plac + * @param \Gedcom\Record\Indi\Even\Plac $plac + * * @return Even */ public function setPlac($plac = []) { $this->plac = $plac; + return $this; } /** - * @return \PhpGedcom\Record\Indi\Even\Plac + * @return \Gedcom\Record\Indi\Even\Plac */ public function getPlac() { @@ -269,11 +293,13 @@ public function getPlac() /** * @param string $type + * * @return Even */ public function setType($type = '') { $this->type = $type; + return $this; } @@ -287,11 +313,13 @@ public function getType() /** * @param array $ref + * * @return Even */ public function setRef($ref = '') { $this->ref = $ref; + return $this; } @@ -313,11 +341,13 @@ public function getChan() /** * @param Record\Chan $chan + * * @return $this */ public function setChan($chan = []) { $this->chan = $chan; + return $this; } } diff --git a/library/PhpGedcom/Record/Indi/Even/Plac.php b/src/Record/Indi/Even/Plac.php similarity index 83% rename from library/PhpGedcom/Record/Indi/Even/Plac.php rename to src/Record/Indi/Even/Plac.php index aedabaac..92421686 100644 --- a/library/PhpGedcom/Record/Indi/Even/Plac.php +++ b/src/Record/Indi/Even/Plac.php @@ -1,26 +1,25 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi\Even; +namespace Gedcom\Record\Indi\Even; -use \PhpGedcom\Record; +use Gedcom\Record; /** - * Class Plac - * @package PhpGedcom\Record\Indi\Even + * Class Plac. */ -class Plac extends Record implements Record\Noteable, Record\Sourceable +class Plac extends \Gedcom\Record implements Record\Noteable, Record\Sourceable { /** * @var string @@ -35,20 +34,22 @@ class Plac extends Record implements Record\Noteable, Record\Sourceable /** * @var array */ - protected $note = array(); + protected $note = []; /** * @var array */ - protected $sour = array(); + protected $sour = []; /** * @param string $form + * * @return Plac */ public function setForm($form = '') { $this->form = $form; + return $this; } @@ -62,11 +63,13 @@ public function getForm() /** * @param string $plac + * * @return Plac */ public function setPlac($plac = '') { $this->plac = $plac; + return $this; } @@ -88,11 +91,13 @@ public function getNote() /** * @param Record\NoteRef $note + * * @return Plac */ public function addNote($note = []) { $this->note[] = $note; + return $this; } @@ -106,11 +111,13 @@ public function getSour() /** * @param Record\SourRef $sour + * * @return Plac */ public function addSour($sour = []) { $this->sour[] = $sour; + return $this; } } diff --git a/library/PhpGedcom/Record/Indi/Famc.php b/src/Record/Indi/Famc.php similarity index 55% rename from library/PhpGedcom/Record/Indi/Famc.php rename to src/Record/Indi/Famc.php index 14f221be..0429b984 100644 --- a/library/PhpGedcom/Record/Indi/Famc.php +++ b/src/Record/Indi/Famc.php @@ -1,37 +1,28 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -use \PhpGedcom\Record\Noteable; +use Gedcom\Record\Noteable; -/** - * - */ -class Famc extends \PhpGedcom\Record implements Noteable +class Famc extends \Gedcom\Record implements Noteable { - protected $_famc = null; - protected $_pedi = null; + protected $_famc; + protected $_pedi; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; diff --git a/library/PhpGedcom/Record/Indi/Fams.php b/src/Record/Indi/Fams.php similarity index 55% rename from library/PhpGedcom/Record/Indi/Fams.php rename to src/Record/Indi/Fams.php index c2846e07..a1106a20 100644 --- a/library/PhpGedcom/Record/Indi/Fams.php +++ b/src/Record/Indi/Fams.php @@ -1,39 +1,27 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -use \PhpGedcom\Record\Noteable; +use Gedcom\Record\Noteable; -/** - * - */ -class Fams extends \PhpGedcom\Record implements Noteable +class Fams extends \Gedcom\Record implements Noteable { - /** - * - */ - protected $_fams = null; + protected $_fams; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; diff --git a/src/Record/Indi/Fcom.php b/src/Record/Indi/Fcom.php new file mode 100644 index 00000000..0e1a5877 --- /dev/null +++ b/src/Record/Indi/Fcom.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Fcom extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Grad.php b/src/Record/Indi/Grad.php new file mode 100644 index 00000000..c60df467 --- /dev/null +++ b/src/Record/Indi/Grad.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Grad extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Idno.php b/src/Record/Indi/Idno.php new file mode 100644 index 00000000..357de7fa --- /dev/null +++ b/src/Record/Indi/Idno.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Idno extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Immi.php b/src/Record/Indi/Immi.php new file mode 100644 index 00000000..f2f845fb --- /dev/null +++ b/src/Record/Indi/Immi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Immi extends \Gedcom\Record\Indi\Even +{ +} diff --git a/library/PhpGedcom/Record/Indi/Lds.php b/src/Record/Indi/Lds.php similarity index 58% rename from library/PhpGedcom/Record/Indi/Lds.php rename to src/Record/Indi/Lds.php index eb87e6bc..d2b8fb10 100644 --- a/library/PhpGedcom/Record/Indi/Lds.php +++ b/src/Record/Indi/Lds.php @@ -1,53 +1,38 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Indi; -use \PhpGedcom\Record\Sourceable; -use \PhpGedcom\Record\Noteable; +use Gedcom\Record\Noteable; +use Gedcom\Record\Sourceable; -/** - * - */ -abstract class Lds extends \PhpGedcom\Record implements Sourceable, Noteable +abstract class Lds extends \Gedcom\Record implements Sourceable, Noteable { protected $_stat; protected $_date; protected $_plac; protected $_temp; - /** - * - */ - protected $_sour = array(); + protected $_sour = []; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ public function addSour($sour = []) { $this->_sour[] = $sour; } - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; diff --git a/src/Record/Indi/Name.php b/src/Record/Indi/Name.php new file mode 100644 index 00000000..9336f20d --- /dev/null +++ b/src/Record/Indi/Name.php @@ -0,0 +1,52 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +/** + * @method string getName() + * @method string getNpfx() + * @method string getGivn() + * @method string getNick() + * @method string getSpfx() + * @method string getSurn() + * @method string getNsfx() + */ +class Name extends \Gedcom\Record implements \Gedcom\Record\Sourceable +{ + protected $_name; + protected $_npfx; + protected $_givn; + protected $_nick; + protected $_spfx; + protected $_surn; + protected $_nsfx; + protected $_fone; // Gedcom/ + protected $_romn; + protected $_type; + + protected $_note = []; + + protected $_sour = []; + + public function addSour($sour = []) + { + $this->_sour[] = $sour; + } + + public function addNote($note = []) + { + $this->_note[] = $note; + } +} diff --git a/src/Record/Indi/Name/Fone.php b/src/Record/Indi/Name/Fone.php new file mode 100644 index 00000000..bd8bf9f3 --- /dev/null +++ b/src/Record/Indi/Name/Fone.php @@ -0,0 +1,75 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi\Name; + +/** + * Class Refn. + */ +class Fone extends \Gedcom\Record +{ + /** + * @var string phonetic_variation + */ + protected $fone; + + /** + * @var string phonetic_type + */ + protected $type; + /** + * string name_piece_prefix. + */ + protected $_npfx; + /** + * string name_piece_given. + */ + protected $_givn; + /** + * string name_piece_nickname. + */ + protected $_nick; + /** + * strign name_piece_surname_prefix. + */ + protected $_spfx; + /** + * string name_piece_surname. + */ + protected $_surn; + /** + * string name_piece_suffix. + */ + protected $_nsfx; + + /** + * PhpRecord\NoteRef. + */ + protected $_note = []; + + /** + * PhpRecord\SourRef. + */ + protected $_sour = []; + + public function addSour($sour = []) + { + $this->_sour[] = $sour; + } + + public function addNote($note = []) + { + $this->_note[] = $note; + } +} diff --git a/src/Record/Indi/Name/Romn.php b/src/Record/Indi/Name/Romn.php new file mode 100644 index 00000000..f8f8f6af --- /dev/null +++ b/src/Record/Indi/Name/Romn.php @@ -0,0 +1,75 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi\Name; + +/** + * Class Refn. + */ +class Romn extends \Gedcom\Record +{ + /** + * @var string romanized_variation + */ + protected $romn; + + /** + * @var string romanized_type + */ + protected $type; + /** + * string name_piece_prefix. + */ + protected $_npfx; + /** + * string name_piece_given. + */ + protected $_givn; + /** + * string name_piece_nickname. + */ + protected $_nick; + /** + * strign name_piece_surname_prefix. + */ + protected $_spfx; + /** + * string name_piece_surname. + */ + protected $_surn; + /** + * string name_piece_suffix. + */ + protected $_nsfx; + + /** + * PhpRecord\NoteRef. + */ + protected $_note = []; + + /** + * PhpRecord\SourRef. + */ + protected $_sour = []; + + public function addSour($sour = []) + { + $this->_sour[] = $sour; + } + + public function addNote($note = []) + { + $this->_note[] = $note; + } +} diff --git a/src/Record/Indi/Nati.php b/src/Record/Indi/Nati.php new file mode 100644 index 00000000..202a5564 --- /dev/null +++ b/src/Record/Indi/Nati.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Nati extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Natu.php b/src/Record/Indi/Natu.php new file mode 100644 index 00000000..5b86ef89 --- /dev/null +++ b/src/Record/Indi/Natu.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Natu extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Nchi.php b/src/Record/Indi/Nchi.php new file mode 100644 index 00000000..5b7d982d --- /dev/null +++ b/src/Record/Indi/Nchi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Nchi extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Nmr.php b/src/Record/Indi/Nmr.php new file mode 100644 index 00000000..80bd9d68 --- /dev/null +++ b/src/Record/Indi/Nmr.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Nmr extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Note.php b/src/Record/Indi/Note.php new file mode 100644 index 00000000..8b292299 --- /dev/null +++ b/src/Record/Indi/Note.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Note extends \Gedcom\Record\NoteRefAbstract +{ +} diff --git a/src/Record/Indi/Occu.php b/src/Record/Indi/Occu.php new file mode 100644 index 00000000..13534b31 --- /dev/null +++ b/src/Record/Indi/Occu.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Occu extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Ordn.php b/src/Record/Indi/Ordn.php new file mode 100644 index 00000000..e3dd9295 --- /dev/null +++ b/src/Record/Indi/Ordn.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Ordn extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Prob.php b/src/Record/Indi/Prob.php new file mode 100644 index 00000000..af21e203 --- /dev/null +++ b/src/Record/Indi/Prob.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Prob extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Prop.php b/src/Record/Indi/Prop.php new file mode 100644 index 00000000..b93ab4ca --- /dev/null +++ b/src/Record/Indi/Prop.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Prop extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Reli.php b/src/Record/Indi/Reli.php new file mode 100644 index 00000000..173fdd14 --- /dev/null +++ b/src/Record/Indi/Reli.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Reli extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Resi.php b/src/Record/Indi/Resi.php new file mode 100644 index 00000000..bbd43a94 --- /dev/null +++ b/src/Record/Indi/Resi.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Resi extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Reti.php b/src/Record/Indi/Reti.php new file mode 100644 index 00000000..d8ac9e18 --- /dev/null +++ b/src/Record/Indi/Reti.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Reti extends \Gedcom\Record\Indi\Even +{ +} diff --git a/src/Record/Indi/Slgc.php b/src/Record/Indi/Slgc.php new file mode 100644 index 00000000..28b1815a --- /dev/null +++ b/src/Record/Indi/Slgc.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Slgc extends Lds +{ + protected $_famc; +} diff --git a/src/Record/Indi/Ssn.php b/src/Record/Indi/Ssn.php new file mode 100644 index 00000000..9b9d0563 --- /dev/null +++ b/src/Record/Indi/Ssn.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Ssn extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Titl.php b/src/Record/Indi/Titl.php new file mode 100644 index 00000000..009d6f93 --- /dev/null +++ b/src/Record/Indi/Titl.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Titl extends \Gedcom\Record\Indi\Attr +{ +} diff --git a/src/Record/Indi/Will.php b/src/Record/Indi/Will.php new file mode 100644 index 00000000..4d89e2d2 --- /dev/null +++ b/src/Record/Indi/Will.php @@ -0,0 +1,19 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Indi; + +class Will extends \Gedcom\Record\Indi\Even +{ +} diff --git a/library/PhpGedcom/Record/Note.php b/src/Record/Note.php similarity index 52% rename from library/PhpGedcom/Record/Note.php rename to src/Record/Note.php index 2476f483..6fd4b913 100644 --- a/library/PhpGedcom/Record/Note.php +++ b/src/Record/Note.php @@ -1,49 +1,36 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - * - */ -class Note extends \PhpGedcom\Record implements Sourceable +class Note extends \Gedcom\Record implements Sourceable { - protected $_id = null; - protected $_chan = null; + protected $_id; + protected $_note; - protected $_note = null; - protected $_even = null; - protected $_refn = array(); - protected $_rin = null; + protected $_even; + protected $_refn = []; + protected $_rin; - /** - * - */ - protected $_sour = array(); + protected $_sour = []; + protected $_chan; - /** - * - */ public function addRefn($refn = []) { $this->_refn[] = $refn; } - /** - * - */ public function addSour($sour = []) { $this->_sour[] = $sour; diff --git a/library/PhpGedcom/Record/NoteRef.php b/src/Record/NoteRef.php similarity index 57% rename from library/PhpGedcom/Record/NoteRef.php rename to src/Record/NoteRef.php index 1d89ce2a..aafcec43 100644 --- a/library/PhpGedcom/Record/NoteRef.php +++ b/src/Record/NoteRef.php @@ -1,60 +1,37 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use \PhpGedcom\Record\Sourceable; +namespace Gedcom\Record; -/** - * - */ -class NoteRef extends \PhpGedcom\Record implements Sourceable +class NoteRef extends \Gedcom\Record implements Sourceable { - /** - * - */ - protected $_isRef = false; + protected $_isRef = false; - /** - * - */ - protected $_note = ''; + protected $_note = ''; - /** - * - */ - protected $_sour = array(); + protected $_sour = []; - /** - * - */ public function setIsReference($isReference = true) { $this->_isRef = $isReference; } - /** - * - */ public function getIsReference() { return $this->_isRef; } - /** - * - */ public function addSour($sour = []) { $this->_sour[] = $sour; diff --git a/library/PhpGedcom/Record/Noteable.php b/src/Record/Noteable.php similarity index 74% rename from library/PhpGedcom/Record/Noteable.php rename to src/Record/Noteable.php index 656f810f..03f06954 100644 --- a/library/PhpGedcom/Record/Noteable.php +++ b/src/Record/Noteable.php @@ -1,26 +1,20 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - */ interface Noteable { - /** - * - */ public function addNote($note = []); } diff --git a/library/PhpGedcom/Record/Obje.php b/src/Record/Obje.php similarity index 50% rename from library/PhpGedcom/Record/Obje.php rename to src/Record/Obje.php index e9f93be5..ff347cc6 100644 --- a/library/PhpGedcom/Record/Obje.php +++ b/src/Record/Obje.php @@ -1,53 +1,50 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - */ -class Obje extends \PhpGedcom\Record implements Noteable +class Obje extends \Gedcom\Record implements Noteable { - protected $_id = null; + protected $_id; + + protected $_file = []; + protected $_rin; + protected $_chan; - protected $_form = null; - protected $_titl = null; - protected $_blob = null; - protected $_rin = null; - protected $_chan = null; - protected $_file = null; + protected $_refn = []; - protected $_refn = array(); + protected $_note = []; - /** - * - */ - protected $_note = array(); + protected $_sour = []; - /** - * - */ public function addRefn($refn = []) { $this->_refn[] = $refn; } - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; } + + public function addFile($file) + { + $this->_file[] = $file; + } + + public function addSour($sour) + { + $this->_sour[] = $sour; + } } diff --git a/src/Record/ObjeRef.php b/src/Record/ObjeRef.php new file mode 100644 index 00000000..85065c56 --- /dev/null +++ b/src/Record/ObjeRef.php @@ -0,0 +1,36 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +class ObjeRef extends \Gedcom\Record +{ + protected $_isRef = false; + + protected $_obje; + + protected $_titl; + + protected $_file; + + public function setIsReference($isReference = true) + { + $this->_isRef = $isReference; + } + + public function getIsReference() + { + return $this->_isRef; + } +} diff --git a/src/Record/ObjeRef/File.php b/src/Record/ObjeRef/File.php new file mode 100644 index 00000000..f2f16da9 --- /dev/null +++ b/src/Record/ObjeRef/File.php @@ -0,0 +1,32 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\ObjeRef; + +/** + * Class Refn. + */ +class File extends \Gedcom\Record +{ + /** + * @var string multimedia_file_refn + */ + protected $_file; + + /** + * @var PhpRecord\ObjeRef\File\Form + */ + protected $_form; + protected $_titl; +} diff --git a/src/Record/ObjeRef/File/Form.php b/src/Record/ObjeRef/File/Form.php new file mode 100644 index 00000000..3444ffca --- /dev/null +++ b/src/Record/ObjeRef/File/Form.php @@ -0,0 +1,38 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\ObjeRef\File; + +/** + * Class Refn. + */ +class Form extends \Gedcom\Record +{ + /** + * @var string multimedia_format + */ + protected $form; + + /** + * @var string source_media_type + * for only obje + */ + protected $type; + + /** + * @var string source_media_type + * for only objeref + */ + protected $medi; +} diff --git a/library/PhpGedcom/Record/Objectable.php b/src/Record/Objectable.php similarity index 74% rename from library/PhpGedcom/Record/Objectable.php rename to src/Record/Objectable.php index e930991c..3b070d5f 100644 --- a/library/PhpGedcom/Record/Objectable.php +++ b/src/Record/Objectable.php @@ -1,26 +1,20 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - */ interface Objectable { - /** - * - */ public function addObje($obje = []); } diff --git a/library/PhpGedcom/Record/Phon.php b/src/Record/Phon.php similarity index 74% rename from library/PhpGedcom/Record/Phon.php rename to src/Record/Phon.php index f28540a7..c784d559 100644 --- a/library/PhpGedcom/Record/Phon.php +++ b/src/Record/Phon.php @@ -1,39 +1,38 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Phon - * @package PhpGedcom\Record + * Class Phon. */ -class Phon extends Record +class Phon extends \Gedcom\Record { /** * @var string */ - protected $phon = null; + protected $phon; /** * @param $phon + * * @return Phon */ public function setPhon($phon = []) { $this->phon = $phon; + return $this; } diff --git a/src/Record/Plac.php b/src/Record/Plac.php new file mode 100644 index 00000000..4090202c --- /dev/null +++ b/src/Record/Plac.php @@ -0,0 +1,55 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +class Plac extends \Gedcom\Record implements Noteable +{ + /** + * string plac. + */ + protected $_plac; + /** + * string place_hierarchy. + */ + protected $_form; + /** + * array PhpRecord\Plac\Fone. + */ + protected $_fone; + /** + * array PhpRecord\Plac\Romn. + */ + protected $_romn; + /** + * PhpRecord\Plac\Map. + */ + protected $_map; + /** + * array PhpRecord\NoteRef. + */ + protected $_note; + + /** + * @param PhpRecord\NoteRef $note + * + * @return Plac + */ + public function addNote($note = null) + { + $this->_note[] = $note; + + return $this; + } +} diff --git a/library/PhpGedcom/Record/Head/Gedc.php b/src/Record/Plac/Fone.php similarity index 61% rename from library/PhpGedcom/Record/Head/Gedc.php rename to src/Record/Plac/Fone.php index 14a6dd0b..e155c32d 100644 --- a/library/PhpGedcom/Record/Head/Gedc.php +++ b/src/Record/Plac/Fone.php @@ -1,31 +1,31 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Head; +namespace Gedcom\Record\Plac; /** - * + * Class Refn. */ -class Gedc extends \PhpGedcom\Record +class Fone extends \Gedcom\Record { /** - * + * @var string phonetic_variation */ - protected $_vers = null; - + protected $_fone; + /** - * + * @var string phonetic_type */ - protected $_form = null; + protected $_type; } diff --git a/src/Record/Plac/Map.php b/src/Record/Plac/Map.php new file mode 100644 index 00000000..7f0c28e4 --- /dev/null +++ b/src/Record/Plac/Map.php @@ -0,0 +1,55 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Plac; + +/** + * Class Refn. + */ +class Map extends \Gedcom\Record +{ + /** + * @var string place_latitude + */ + protected $lati; + + /** + * @var string place_longitude + */ + protected $long; + + /** + * @param string $lati + * + * @return Map + */ + public function setLati($lati = '') + { + $this->lati = $lati; + + return $this; + } + + /** + * @param string $long + * + * @return Map + */ + public function setLong($long = '') + { + $this->long = $long; + + return $this; + } +} diff --git a/library/PhpGedcom/Record/Indi/Slgc.php b/src/Record/Plac/Romn.php similarity index 58% rename from library/PhpGedcom/Record/Indi/Slgc.php rename to src/Record/Plac/Romn.php index 088bcb96..72a33795 100644 --- a/library/PhpGedcom/Record/Indi/Slgc.php +++ b/src/Record/Plac/Romn.php @@ -1,26 +1,31 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Indi; +namespace Gedcom\Record\Plac; /** - * + * Class Refn. */ -class Slgc extends Lds +class Romn extends \Gedcom\Record { /** - * + * @var string romanized_variation + */ + protected $romn; + + /** + * @var string romanized_type */ - protected $_famc = null; + protected $type; } diff --git a/library/PhpGedcom/Record/Refn.php b/src/Record/Refn.php similarity index 83% rename from library/PhpGedcom/Record/Refn.php rename to src/Record/Refn.php index 6d0ec81e..a3457c88 100644 --- a/library/PhpGedcom/Record/Refn.php +++ b/src/Record/Refn.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Refn - * @package PhpGedcom\Record + * Class Refn. */ -class Refn extends Record +class Refn extends \Gedcom\Record { /** * @var string @@ -34,11 +31,13 @@ class Refn extends Record /** * @param string $refn + * * @return Refn */ public function setRefn($refn = '') { $this->refn = $refn; + return $this; } @@ -52,11 +51,13 @@ public function getRefn() /** * @param string $type + * * @return Refn */ public function setType($type = '') { $this->type = $type; + return $this; } diff --git a/library/PhpGedcom/Record/Repo.php b/src/Record/Repo.php similarity index 56% rename from library/PhpGedcom/Record/Repo.php rename to src/Record/Repo.php index 8cd5fa08..e0101871 100644 --- a/library/PhpGedcom/Record/Repo.php +++ b/src/Record/Repo.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Repo - * @package PhpGedcom\Record + * Class Repo. */ -class Repo extends Record implements Noteable +class Repo extends \Gedcom\Record implements Noteable { /** * @var string @@ -37,6 +34,22 @@ class Repo extends Record implements Noteable */ protected $addr; + /** + * @var array + */ + protected $phon = []; + /** + * @var array + */ + protected $email = []; + /** + * @var array + */ + protected $fax = []; + /** + * @var array + */ + protected $www = []; /** * @var string */ @@ -50,25 +63,22 @@ class Repo extends Record implements Noteable /** * @var array */ - protected $phon = array(); - - /** - * @var array - */ - protected $refn = array(); + protected $refn = []; /** * @var array */ - protected $note = array(); + protected $note = []; /** - * @param Phon $phon + * @param null + * * @return Repo */ - public function addPhon($phon = new Phon) + public function addPhon($phon = null) { $this->phon[] = $phon; + return $this; } @@ -81,12 +91,77 @@ public function getPhon() } /** - * @param Refn $refn + * @param null + * + * @return Repo + */ + public function addEmail($email = null) + { + $this->email[] = $email; + + return $this; + } + + /** + * @return array + */ + public function getEmail() + { + return $this->email; + } + + /** + * @param null + * + * @return Repo + */ + public function addFax($fax = null) + { + $this->fax[] = $fax; + + return $this; + } + + /** + * @return array + */ + public function getFax() + { + return $this->fax; + } + + /** + * @param null + * + * @return Repo + */ + public function addWww($www = null) + { + $this->www[] = $www; + + return $this; + } + + /** + * @return array + */ + public function getWww() + { + return $this->www; + } + + /** + * @param null|\Gedcom\Record\Refn $refn + * * @return Repo */ - public function addRefn($refn = new Refn) + public function addRefn($refn = null) { + if (empty($refn)) { + $refn = new \Gedcom\Record\Refn(); + } $this->refn[] = $refn; + return $this; } @@ -99,12 +174,17 @@ public function getRefn() } /** - * @param NoteRef $note + * @param null|\Gedcom\Record\NoteRef $note + * * @return Repo */ - public function addNote($note = new NoteRef) + public function addNote($note = null) { + if (empty($node)) { + $note = new \Gedcom\Record\NoteRef(); + } $this->note[] = $note; + return $this; } @@ -118,11 +198,13 @@ public function getNote() /** * @param string $repo + * * @return Repo */ public function setRepo($repo = '') { $this->repo = $repo; + return $this; } @@ -136,11 +218,13 @@ public function getRepo() /** * @param string $name + * * @return Repo */ public function setName($name = '') { $this->name = $name; + return $this; } @@ -153,17 +237,22 @@ public function getName() } /** - * @param \PhpGedcom\Record\Addr $addr + * @param null|\Gedcom\Record\Addr $addr + * * @return Repo */ - public function setAddr($addr = new Addr) + public function setAddr($addr = null) { + if (empty($addr)) { + $addr = new \Gedcom\Record\Addr(); + } $this->addr = $addr; + return $this; } /** - * @return \PhpGedcom\Record\Addr + * @return \Gedcom\Record\Addr */ public function getAddr() { @@ -172,11 +261,13 @@ public function getAddr() /** * @param string $rin + * * @return Repo */ public function setRin($rin = '') { $this->rin = $rin; + return $this; } @@ -189,17 +280,19 @@ public function getRin() } /** - * @param \PhpGedcom\Record\Chan $chan + * @param \Gedcom\Record\Chan $chan + * * @return Repo */ public function setChan($chan = []) { $this->chan = $chan; + return $this; } /** - * @return \PhpGedcom\Record\Chan + * @return \Gedcom\Record\Chan */ public function getChan() { diff --git a/library/PhpGedcom/Record/RepoRef.php b/src/Record/RepoRef.php similarity index 57% rename from library/PhpGedcom/Record/RepoRef.php rename to src/Record/RepoRef.php index dcc1a412..be0b3b8b 100644 --- a/library/PhpGedcom/Record/RepoRef.php +++ b/src/Record/RepoRef.php @@ -1,36 +1,27 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - */ -class RepoRef extends \PhpGedcom\Record implements Noteable +class RepoRef extends \Gedcom\Record implements Noteable { - protected $_repo = null; + protected $_repo; - protected $_caln = array(); + protected $_caln = []; - /** - * - */ - protected $_note = array(); + protected $_note = []; - /** - * - */ public function addNote($note = []) { $this->_note[] = $note; diff --git a/library/PhpGedcom/Record/Sour.php b/src/Record/Sour.php similarity index 89% rename from library/PhpGedcom/Record/Sour.php rename to src/Record/Sour.php index 6b179ad5..50274125 100644 --- a/library/PhpGedcom/Record/Sour.php +++ b/src/Record/Sour.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Sour - * @package PhpGedcom\Record + * Class Sour. */ -class Sour extends Record implements Noteable, Objectable +class Sour extends \Gedcom\Record implements Noteable, Objectable { /** * @var string @@ -28,34 +25,34 @@ class Sour extends Record implements Noteable, Objectable protected $sour; /** - * @var Chan + * @var Data */ - protected $chan; + protected $data; /** * @var string */ - protected $titl; + protected $auth; /** * @var string */ - protected $auth; + protected $titl; /** * @var string */ - protected $data; + protected $abbr; /** * @var string */ - protected $text; + protected $publ; /** * @var string */ - protected $publ; + protected $text; /** * @var Repo @@ -63,9 +60,9 @@ class Sour extends Record implements Noteable, Objectable protected $repo; /** - * @var string + * @var array */ - protected $abbr; + protected $refn = []; /** * @var string @@ -73,27 +70,29 @@ class Sour extends Record implements Noteable, Objectable protected $rin; /** - * @var array + * @var Chan */ - protected $refn = array(); + protected $chan; /** * @var array */ - protected $note = array(); + protected $note = []; /** * @var array */ - protected $obje = array(); + protected $obje = []; /** * @param string $sour + * * @return Sour */ public function setSour($sour = '') { $this->sour = $sour; + return $this; } @@ -107,11 +106,13 @@ public function getSour() /** * @param string $titl + * * @return Sour */ public function setTitl($titl = '') { $this->titl = $titl; + return $this; } @@ -125,11 +126,13 @@ public function getTitl() /** * @param string $abbr + * * @return Sour */ public function setAbbr($abbr = '') { $this->abbr = $abbr; + return $this; } @@ -143,11 +146,13 @@ public function getAbbr() /** * @param string $auth + * * @return Sour */ public function setAuth($auth = '') { $this->auth = $auth; + return $this; } @@ -161,11 +166,13 @@ public function getAuth() /** * @param string $publ + * * @return Sour */ public function setPubl($publ = '') { $this->publ = $publ; + return $this; } @@ -178,17 +185,19 @@ public function getPubl() } /** - * @param \PhpGedcom\Record\Repo $repo + * @param \Gedcom\Record\Repo $repo + * * @return Sour */ - public function setRepo($repo = []) + public function setRepo($repo) { $this->repo = $repo; + return $this; } /** - * @return \PhpGedcom\Record\Repo + * @return \Gedcom\Record\Repo */ public function getRepo() { @@ -197,11 +206,13 @@ public function getRepo() /** * @param string $text + * * @return Sour */ public function setText($text = '') { $this->text = $text; + return $this; } @@ -215,11 +226,13 @@ public function getText() /** * @param string $data + * * @return Sour */ public function setData($data = '') { $this->data = $data; + return $this; } @@ -233,11 +246,13 @@ public function getData() /** * @param string $rin + * * @return Sour */ public function setRin($rin = '') { $this->rin = $rin; + return $this; } @@ -250,17 +265,19 @@ public function getRin() } /** - * @param \PhpGedcom\Record\Chan $chan + * @param \Gedcom\Record\Chan $chan + * * @return Sour */ public function setChan($chan = []) { $this->chan = $chan; + return $this; } /** - * @return \PhpGedcom\Record\Chan + * @return \Gedcom\Record\Chan */ public function getChan() { @@ -269,11 +286,13 @@ public function getChan() /** * @param Refn $refn + * * @return Sour */ public function addRefn($refn = []) { $this->refn[] = $refn; + return $this; } @@ -287,11 +306,13 @@ public function getRefn() /** * @param NoteRef $note + * * @return Sour */ public function addNote($note = []) { $this->note[] = $note; + return $this; } @@ -305,11 +326,13 @@ public function getNote() /** * @param ObjeRef $obje + * * @return Sour */ public function addObje($obje = []) { $this->obje[] = $obje; + return $this; } diff --git a/src/Record/Sour/Data.php b/src/Record/Sour/Data.php new file mode 100644 index 00000000..cc47087f --- /dev/null +++ b/src/Record/Sour/Data.php @@ -0,0 +1,33 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Sour; + +use Gedcom\Record\Noteable; + +class Data extends \Gedcom\Record implements Noteable +{ + protected $_even = []; + protected $_agnc; + protected $_date; + + protected $_text; + + protected $_note = []; + + public function addNote($note = []) + { + $this->_note[] = $note; + } +} diff --git a/src/Record/Sour/Data/Even.php b/src/Record/Sour/Data/Even.php new file mode 100644 index 00000000..4ba9107e --- /dev/null +++ b/src/Record/Sour/Data/Even.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Sour\Data; + +class Even extends \Gedcom\Record +{ + protected $_date; + protected $_plac; +} diff --git a/src/Record/Sour/Repo.php b/src/Record/Sour/Repo.php new file mode 100644 index 00000000..1b986e21 --- /dev/null +++ b/src/Record/Sour/Repo.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\Sour; + +use Gedcom\Record\Noteable; + +class Repo extends \Gedcom\Record implements Noteable +{ + protected $_repo; + /** + * array PhpRecord\Sour\Repo\Caln. + */ + protected $_caln = []; + + /** + * array PhpRecord\NoteRef. + */ + protected $_note = []; + + public function addNote($note = []) + { + $this->_note[] = $note; + } + + public function addCaln($caln = []) + { + $this->_caln[] = $caln; + } +} diff --git a/library/PhpGedcom/Record/Head/Plac.php b/src/Record/Sour/Repo/Caln.php similarity index 59% rename from library/PhpGedcom/Record/Head/Plac.php rename to src/Record/Sour/Repo/Caln.php index 8f79eae2..d6cb32aa 100644 --- a/library/PhpGedcom/Record/Head/Plac.php +++ b/src/Record/Sour/Repo/Caln.php @@ -1,26 +1,27 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record\Head; +namespace Gedcom\Record\Sour\Repo; -/** - * - */ -class Plac extends \PhpGedcom\Record +class Caln extends \Gedcom\Record { /** - * + * string source_call_number. + */ + protected $_caln; + /** + * string source_media_type. */ - protected $_form = null; + protected $_medi; } diff --git a/src/Record/SourRef.php b/src/Record/SourRef.php new file mode 100644 index 00000000..b0ec004c --- /dev/null +++ b/src/Record/SourRef.php @@ -0,0 +1,37 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record; + +class SourRef extends \Gedcom\Record +{ + protected $_isRef = false; + + protected $_sour; + protected $_page; + protected $_even; + protected $_data; + protected $_quay; + protected $_text; + + protected $_obje = []; + protected $_note = []; + + public function setSour($sour = '') + { + $this->_sour = $sour; + + return $this; + } +} diff --git a/library/PhpGedcom/Parser/Component.php b/src/Record/SourRef/Data.php similarity index 59% rename from library/PhpGedcom/Parser/Component.php rename to src/Record/SourRef/Data.php index a1e37aff..465e5bfb 100644 --- a/library/PhpGedcom/Parser/Component.php +++ b/src/Record/SourRef/Data.php @@ -1,30 +1,27 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Parser; +namespace Gedcom\Record\SourRef; -/** - * - * - */ -abstract class Component +class Data extends \Gedcom\Record { /** - * + * string entry_recording_date. + */ + protected $_date; + /** + * string text_from_source. */ - public static function parse(\PhpGedcom\Parser $parser) - { - - } + protected $_text; } diff --git a/src/Record/SourRef/Even.php b/src/Record/SourRef/Even.php new file mode 100644 index 00000000..4a155961 --- /dev/null +++ b/src/Record/SourRef/Even.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Record\SourRef; + +class Even extends \Gedcom\Record +{ + protected $_even; + protected $_role; +} diff --git a/library/PhpGedcom/Record/Sourceable.php b/src/Record/Sourceable.php similarity index 74% rename from library/PhpGedcom/Record/Sourceable.php rename to src/Record/Sourceable.php index 0ef1351d..d9b9612a 100644 --- a/library/PhpGedcom/Record/Sourceable.php +++ b/src/Record/Sourceable.php @@ -1,26 +1,20 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -/** - * - */ interface Sourceable { - /** - * - */ public function addSour($sour = []); } diff --git a/library/PhpGedcom/Record/Subm.php b/src/Record/Subm.php similarity index 65% rename from library/PhpGedcom/Record/Subm.php rename to src/Record/Subm.php index e71c447e..30124c7e 100644 --- a/library/PhpGedcom/Record/Subm.php +++ b/src/Record/Subm.php @@ -1,26 +1,25 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; +namespace Gedcom\Record; -use PhpGedcom\Record; +use Gedcom\Record; /** - * Class Subm - * @package PhpGedcom\Record + * Class Subm. */ -class Subm extends Record implements Objectable +class Subm extends \Gedcom\Record implements Objectable { /** * @var string @@ -55,25 +54,47 @@ class Subm extends Record implements Objectable /** * @var array */ - protected $lang = array(); + protected $lang = []; + + /** + * @var array + */ + protected $phon = []; + + /** + * @var array + */ + protected $email = []; + + /** + * @var array + */ + protected $fax = []; /** * @var array */ - protected $phon = array(); + protected $www = []; /** * @var array */ - protected $obje = array(); + protected $obje = []; + + /** + * @var array + */ + protected $note = []; /** * @param string $subm + * * @return Subm */ public function setSubm($subm = '') { $this->subm = $subm; + return $this; } @@ -87,11 +108,13 @@ public function getSubm() /** * @param string $name + * * @return Subm */ public function setName($name = '') { $this->name = $name; + return $this; } @@ -105,11 +128,13 @@ public function getName() /** * @param array $phon + * * @return Subm */ public function setPhon($phon = []) { $this->phon = $phon; + return $this; } @@ -121,13 +146,87 @@ public function getPhon() return $this->phon; } + /** + * @param Record\Phon $phon + * + * @return Subm + */ + public function addPhon($phon = []) + { + $this->phon[] = $phon; + + return $this; + } + + /** + * @return array + */ + public function getEmail() + { + return $this->email; + } + + /** + * @param Record\Phon $phon + * + * @return Subm + */ + public function addEmail($email) + { + $this->email[] = $email; + + return $this; + } + + /** + * @return array + */ + public function getFax() + { + return $this->fax; + } + + /** + * @param Record\Phon $phon + * + * @return Subm + */ + public function addFax($fax) + { + $this->fax[] = $fax; + + return $this; + } + + /** + * @return array + */ + public function getWww() + { + return $this->www; + } + + /** + * @param Record\Phon $phon + * + * @return Subm + */ + public function addWww($www) + { + $this->www[] = $www; + + return $this; + } + /** * @param string $rfn + * * @return Subm */ public function setRfn($rfn = '') { $this->rfn = $rfn; + return $this; } @@ -141,11 +240,13 @@ public function getRfn() /** * @param string $rin + * * @return Subm */ public function setRin($rin = '') { $this->rin = $rin; + return $this; } @@ -158,17 +259,19 @@ public function getRin() } /** - * @param \PhpGedcom\Record\Chan $chan + * @param \Gedcom\Record\Chan $chan + * * @return Subm */ public function setChan($chan = []) { $this->chan = $chan; + return $this; } /** - * @return \PhpGedcom\Record\Chan + * @return \Gedcom\Record\Chan */ public function getChan() { @@ -185,21 +288,13 @@ public function getLang() /** * @param string $lang + * * @return Subm */ public function addLang($lang = '') { $this->lang[] = $lang; - return $this; - } - /** - * @param Record\Phon $phon - * @return Subm - */ - public function addPhon($phon = []) - { - $this->phon[] = $phon; return $this; } @@ -213,11 +308,13 @@ public function getAddr() /** * @param Addr $addr + * * @return Subm */ public function setAddr($addr = []) { $this->addr = $addr; + return $this; } @@ -231,11 +328,33 @@ public function getObje() /** * @param Record\ObjeRef $obje + * * @return Subm */ public function addObje($obje = []) { $this->obje[] = $obje; + + return $this; + } + + /** + * @return array + */ + public function getNote() + { + return $this->note; + } + + /** + * @param Record\Note $note + * + * @return Subm + */ + public function addNote($note = []) + { + $this->note[] = $note; + return $this; } } diff --git a/library/PhpGedcom/Record/Subn.php b/src/Record/Subn.php similarity index 81% rename from library/PhpGedcom/Record/Subn.php rename to src/Record/Subn.php index d2584cdd..132a2a71 100644 --- a/library/PhpGedcom/Record/Subn.php +++ b/src/Record/Subn.php @@ -1,26 +1,23 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Record; - -use PhpGedcom\Record; +namespace Gedcom\Record; /** - * Class Subn - * @package PhpGedcom\Record + * Class Subn. */ -class Subn extends Record +class Subn extends \Gedcom\Record { /** * @var string @@ -62,13 +59,49 @@ class Subn extends Record */ protected $rin; + /** + * @var array + */ + protected $_note = []; + + /** + * @var \Gedcom\Record\Chan + */ + protected $_chan; + + public function setChan($chan) + { + $this->_chan = $chan; + + return $this; + } + + public function getChan() + { + return $this->_chan; + } + + public function addNote($note) + { + $this->_note[] = $note; + + return $this; + } + + public function getNote() + { + return $this->_note; + } + /** * @param string $subn + * * @return Subn */ public function setSubn($subn = '') { $this->subn = $subn; + return $this; } @@ -82,11 +115,13 @@ public function getSubn() /** * @param string $subm + * * @return Subn */ public function setSubm($subm = '') { $this->subm = $subm; + return $this; } @@ -100,11 +135,13 @@ public function getSubm() /** * @param string $famf + * * @return Subn */ public function setFamf($famf = '') { $this->famf = $famf; + return $this; } @@ -118,11 +155,13 @@ public function getFamf() /** * @param string $temp + * * @return Subn */ public function setTemp($temp = '') { $this->temp = $temp; + return $this; } @@ -136,11 +175,13 @@ public function getTemp() /** * @param string $ance + * * @return Subn */ public function setAnce($ance = '') { $this->ance = $ance; + return $this; } @@ -154,11 +195,13 @@ public function getAnce() /** * @param string $desc + * * @return Subn */ public function setDesc($desc = '') { $this->desc = $desc; + return $this; } @@ -172,11 +215,13 @@ public function getDesc() /** * @param string $ordi + * * @return Subn */ public function setOrdi($ordi = '') { $this->ordi = $ordi; + return $this; } @@ -190,11 +235,13 @@ public function getOrdi() /** * @param string $rin + * * @return Subn */ public function setRin($rin = '') { $this->rin = $rin; + return $this; } diff --git a/src/Writer.php b/src/Writer.php new file mode 100644 index 00000000..f416b995 --- /dev/null +++ b/src/Writer.php @@ -0,0 +1,128 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom; + +use Gedcom\Writer\Fam; +use Gedcom\Writer\Head; +use Gedcom\Writer\Indi; +use Gedcom\Writer\Note; +use Gedcom\Writer\Obje; +use Gedcom\Writer\Repo; +use Gedcom\Writer\Sour; +use Gedcom\Writer\Subm; +use Gedcom\Writer\Subn; + +class Writer +{ + const GEDCOM55 = 'gedcom5.5'; + + protected $_output; + + /** + * @param $gedcom The GEDCOM object + * @param string $format The format to convert the GEDCOM object to + * + * @return string The contents of the document in the converted format + */ + public static function convert(Gedcom $gedcom, $format = self::GEDCOM55) + { + $head = $gedcom->getHead(); + $subn = $gedcom->getSubn(); + $subms = $gedcom->getSubm(); // array() + $sours = $gedcom->getSour(); // array() + $indis = $gedcom->getIndi(); // array() + $fams = $gedcom->getFam(); // array() + $notes = $gedcom->getNote(); // array() + $repos = $gedcom->getRepo(); // array() + $objes = $gedcom->getObje(); // array() + + $output = '0 FORMAT '.$format."\n"; + + // head + if ($head) { + $output = Head::convert($head, $format); + } + + // subn + if ($subn) { + $output .= Subn::convert($subn); + } + + // subms + if (!empty($subms) && count($subms) > 0) { + foreach ($subms as $item) { + if ($item) { + $output .= Subm::convert($item); + } + } + } + + // sours + if (!empty($sours) && count($sours) > 0) { + foreach ($sours as $item) { + if ($item) { + $output .= Sour::convert($item, 0); + } + } + } + + // indis + if (!empty($indis) && count($indis) > 0) { + foreach ($indis as $item) { + if ($item) { + $output .= Indi::convert($item); + } + } + } + + // fams + if (!empty($fams) && count($fams) > 0) { + foreach ($fams as $item) { + if ($item) { + $output .= Fam::convert($item); + } + } + } + // notes + if (!empty($notes) && count($notes) > 0) { + foreach ($notes as $item) { + if ($item) { + $output .= Note::convert($item); + } + } + } + + // repos + if (!empty($repos) && count($repos) > 0) { + foreach ($repos as $item) { + if ($item) { + $output .= Repo::convert($item); + } + } + } + // Objes + if (!empty($objes) && count($objes) > 0) { + foreach ($objes as $item) { + if ($item) { + $output .= Obje::convert($item); + } + } + } + // EOF + $output .= "0 TRLR\n"; + + return $output; + } +} diff --git a/src/Writer/Addr.php b/src/Writer/Addr.php new file mode 100644 index 00000000..6085dd61 --- /dev/null +++ b/src/Writer/Addr.php @@ -0,0 +1,44 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Addr +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1) + { + $addrs = explode("\n", $addr->getAddr()); + + $output = "{$level} ADDR ".$addrs[0]."\n"; + + array_shift($addrs); + + foreach ($addrs as $cont) { + $output .= ($level + 1).' CONT '.$cont."\n"; + } + + return $output.(($level + 1).' ADR1 '.$addr->adr1."\n". + ($level + 1).' ADR2 '.$addr->getAdr2()."\n". + ($level + 1).' CITY '.$addr->getCity()."\n". + ($level + 1).' STAE '.$addr->getStae()."\n". + ($level + 1).' POST '.$addr->getPost()."\n". + ($level + 1).' CTRY '.$addr->getCtry()."\n"); + } +} diff --git a/src/Writer/Caln.php b/src/Writer/Caln.php new file mode 100644 index 00000000..272a3a54 --- /dev/null +++ b/src/Writer/Caln.php @@ -0,0 +1,46 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Caln +{ + /** + * @param \Gedcom\Record\Caln $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Caln &$caln, $level) + { + $output = ''; + $_caln = $caln->getCaln(); + if (empty($_caln)) { + return $output; + } else { + $output .= $level.' CALN '.$_caln."\n"; + } + + // level up + $level++; + + // medi + $medi = $caln->getMedi(); + if (!empty($medi)) { + $output .= $level.' MEDI '.$medi."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Chan.php b/src/Writer/Chan.php new file mode 100644 index 00000000..5470d704 --- /dev/null +++ b/src/Writer/Chan.php @@ -0,0 +1,51 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Chan +{ + /** + * @param \Gedcom\Record\Chan $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Chan &$chan, $level) + { + $output = $level." CHAN \n"; + // level up + $level++; + // DATE + $_date = $chan->getDate(); + if (!empty($_date)) { + $output .= $level.' DATE '.$_date."\n"; + } + // TIME + $_time = $chan->getDate(); + if (!empty($_time)) { + $output .= $level.' DATE '.$_time."\n"; + } + // $_note = array() + $_note = $chan->getNote(); + if (!empty($_note) && count($_note) > 0) { + foreach ($_note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Fam.php b/src/Writer/Fam.php new file mode 100644 index 00000000..01aaecbe --- /dev/null +++ b/src/Writer/Fam.php @@ -0,0 +1,153 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Fam +{ + /** + * @param \Gedcom\Record\Fam $sour + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Fam &$fam, $level = 0) + { + $output = ''; + $id = $fam->getId(); + if (empty($id)) { + return $output; + } else { + $output .= $level.' @'.$id.'@ FAM '."\n"; + } + // level up + $level++; + + // HUSB + $husb = $fam->getHusb(); + if (!empty($husb)) { + $output .= $level.' HUSB @'.$husb."@\n"; + } + + // WIFE + $wife = $fam->getWife(); + if (!empty($wife)) { + $output .= $level.' WIFE @'.$wife."@\n"; + } + + // CHIL + $chil = $fam->getChil(); + if (!empty($chil) && count($chil) > 0) { + foreach ($chil as $item) { + if ($item) { + $_convert = $level.' CHIL @'.$item."@\n"; + $output .= $_convert; + } + } + } + // NCHI + $nchi = $fam->getNchi(); + if (!empty($nchi)) { + $output .= $level.' NCHI '.$nchi."\n"; + } + + // SUBM array + $subm = $fam->getSubm(); + + if (!empty($subm) && count($subm) > 0) { + foreach ($subm as $item) { + if ($item) { + $output .= $level.' SUBM '.$item."\n"; + } + } + } + + // RIN + $rin = $fam->getRin(); + if (!empty($rin)) { + $output .= $level.' RIN '.$rin."\n"; + } + // CHAN + $chan = $fam->getChan(); + if (!empty($chan)) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + // SLGS + $slgs = $fam->getSlgs(); + if (!empty($slgs) && count($slgs) > 0) { + if ($slgs) { + $_convert = \Gedcom\Writer\Fam\Slgs::convert($item, $level); + $output .= $_convert; + } + } + + // REFN array + $refn = $fam->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + } + + // NOTE array + $note = $fam->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + if ($item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + } + + // SOUR + $sour = $fam->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + if ($item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + } + + // OBJE + $obje = $fam->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + if ($item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + } + + // EVEN + $even = $fam->getAllEven(); + if (!empty($even) && count($even) > 0) { + foreach ($even as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Fam\Even::convert($item, $level); + $output .= $_convert; + } + } + } + + return $output; + } +} diff --git a/src/Writer/Fam/Even.php b/src/Writer/Fam/Even.php new file mode 100644 index 00000000..4165aad2 --- /dev/null +++ b/src/Writer/Fam/Even.php @@ -0,0 +1,133 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Fam; + +class Even +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Fam\Even &$even, $level) + { + $output = ''; + + // $type; + $type = $even->getType(); + if (!empty($type)) { + $output .= $level.' '.$type."\n"; + } else { + return $output; + } + $level++; + + // $type; + $type = $even->getType(); + if (!empty($type)) { + $output .= $level.' TYPE '.$type."\n"; + } + + // $date; + $date = $even->getDate(); + if (!empty($date)) { + $output .= $level.' DATE '.$date."\n"; + } + + // Plac + $plac = $even->getPlac(); + if (!empty($plac)) { + $_convert = \Gedcom\Writer\Indi\Even\Plac::convert($plac, $level); + $output .= $_convert; + } + + // $caus; + $caus = $even->getCaus(); + if (!empty($caus)) { + $output .= $level.' CAUS '.$caus."\n"; + } + + // $age; + $age = $even->getAge(); + if (!empty($age)) { + $output .= $level.' AGE '.$age."\n"; + } + + // $addr + $addr = $even->getAddr(); + if (!empty($addr)) { + $_convert = \Gedcom\Writer\Addr::convert($addr, $level); + $output .= $_convert; + } + + // $phon = array() + $phon = $even->getPhon(); + if (!empty($phon) && count($phon) > 0) { + foreach ($phon as $item) { + $_convert = \Gedcom\Writer\Phon::convert($item, $level); + $output .= $_convert; + } + } + // $agnc + $agnc = $even->getAgnc(); + if (!empty($agnc)) { + $output .= $level.' AGNC '.$agnc."\n"; + } + + // HUSB + $husb = $even->getHusb(); + if (!empty($husb)) { + $_convert = \Gedcom\Writer\Fam\Even\Husb::convert($husb, $level); + $output .= $_convert; + } + + // WIFE + $wife = $even->getWife(); + if (!empty($wife)) { + $_convert = \Gedcom\Writer\Fam\Even\Wife::convert($wife, $level); + $output .= $_convert; + } + + // $ref = array(); + // This is not in parser + + // $obje = array(); + $obje = $even->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + // $sour = array(); + $sour = $even->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + // $note = array(); + $note = $even->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Fam/Even/Husb.php b/src/Writer/Fam/Even/Husb.php new file mode 100644 index 00000000..4baf5686 --- /dev/null +++ b/src/Writer/Fam/Even/Husb.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Fam\Even; + +class Husb +{ + /** + * @param \Gedcom\Record\Fam\Even\Husb $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Fam\Even\Husb &$husb, $level = 0) + { + $output = ''; + + $output .= $level." WIFE \n"; + // level up + $level++; + + // AGE + $age = $husb->getAge(); + if (!empty($age)) { + $output .= $level.' AGE '.$age."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Fam/Even/Wife.php b/src/Writer/Fam/Even/Wife.php new file mode 100644 index 00000000..c1a29b7a --- /dev/null +++ b/src/Writer/Fam/Even/Wife.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Fam\Even; + +class Wife +{ + /** + * @param \Gedcom\Record\Fam\Even\Wife $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Fam\Even\Wife &$wife, $level = 0) + { + $output = ''; + + $output .= $level." HUSB \n"; + // level up + $level++; + + // AGE + $age = $wife->getAge(); + if (!empty($age)) { + $output .= $level.' AGE '.$age."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Fam/Slgs.php b/src/Writer/Fam/Slgs.php new file mode 100644 index 00000000..84563148 --- /dev/null +++ b/src/Writer/Fam/Slgs.php @@ -0,0 +1,75 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Fam; + +class Slgs +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Fam\Slgs &$slgs, $level) + { + $output = ''; + $output .= $level." SLGS \n"; + + // Level up + $level++; + + // $STAT; + $stat = $slgs->getStat(); + if (!empty($stat)) { + $output .= $level.' STAT '.$stat."\n"; + } + + // $date; + $date = $slgs->getDate(); + if (!empty($date)) { + $output .= $level.' DATE '.$date."\n"; + } + + // PLAC + $plac = $slgs->getPlac(); + if (!empty($plac)) { + $output .= $level.' PLAC '.$plac."\n"; + } + + // $TEMP; + $temp = $slgs->getTemp(); + if (!empty($temp)) { + $output .= $level.' TEMP '.$temp."\n"; + } + + // $sour = array(); + $sour = $slgs->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + // $note = array(); + $note = $slgs->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Head.php b/src/Writer/Head.php new file mode 100644 index 00000000..88ada96e --- /dev/null +++ b/src/Writer/Head.php @@ -0,0 +1,126 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Head +{ + /** + * @param string $format + * + * @return string + */ + public static function convert(\Gedcom\Record\Head &$head, $format = self::GEDCOM55) + { + $level = 0; + $output = $level." HEAD\n"; + + // level up + $level++; + + //SOUR + $sour = $head->getSour(); + if ($sour) { + $_convert = \Gedcom\Writer\Head\Sour::convert($sour, $level); + $output .= $_convert; + } + + // DEST + $dest = $head->getDest(); + if ($dest) { + $output .= $level.' DEST '.$dest."\n"; + } + + //Subm + $subm = $head->getSubm(); + if ($subm) { + $output .= $level.' SUBM '.$subm."\n"; + } + + // SUBN + $subn = $head->getSubn(); + if ($subn) { + $output .= $level.' SUBN '.$subn."\n"; + } + + // FILE + $file = $head->getFile(); + if ($file) { + $output .= $level.' FILE '.$file."\n"; + } + + // COPR + $copr = $head->getCopr(); + if ($copr) { + $output .= $level.' COPR '.$copr."\n"; + } + + // LANG + $lang = $head->getLang(); + if ($lang) { + $output .= $level.' LANG '.$lang."\n"; + } + // DATE + $date = $head->getDate(); + if ($date) { + $_convert = \Gedcom\Writer\Head\Date::convert($date, $level); + $output .= $_convert; + } + + // GEDC + $gedc = $head->getGedc(); + if ($gedc) { + $_convert = \Gedcom\Writer\Head\Gedc::convert($gedc, $level); + $output .= $_convert; + } + + // CHAR + $char = $head->getChar(); + if ($char) { + $_convert = \Gedcom\Writer\Head\Char::convert($char, $level); + $output .= $_convert; + } + // PLAC + $plac = $head->getPlac(); + if ($plac) { + $_convert = \Gedcom\Writer\Head\Plac::convert($plac, $level); + $output .= $_convert; + } + + // NOTE + $note = $head->getNote(); + if ($note) { + $output .= $level.' NOTE '.$note."\n"; + } + // + /* + +1 SUBM @@ {1:1} + +1 SUBN @@ {0:1} + +1 FILE {0:1} + +1 COPR {0:1} + +1 GEDC {1:1} + +2 VERS {1:1} + +2 FORM {1:1} + +1 CHAR {1:1} + +2 VERS {0:1} + +1 LANG {0:1} + +1 PLAC {0:1} + +2 FORM {1:1} + +1 NOTE {0:1} + +2 [CONT|CONC] {0:M} + */ + + return $output; + } +} diff --git a/src/Writer/Head/Char.php b/src/Writer/Head/Char.php new file mode 100644 index 00000000..a00177d5 --- /dev/null +++ b/src/Writer/Head/Char.php @@ -0,0 +1,46 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head; + +class Char +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Char &$char, $level) + { + $output = ''; + // char + $_char = $char->getChar(); + if ($_char) { + $output .= $level.' CHAR '.$_char."\n"; + } else { + return $output; + } + + // level up + $level++; + // VERS + $vers = $char->getVersion(); + if ($vers) { + $output .= $level.' VERS '.$vers."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Head/Date.php b/src/Writer/Head/Date.php new file mode 100644 index 00000000..2478b71e --- /dev/null +++ b/src/Writer/Head/Date.php @@ -0,0 +1,45 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head; + +class Date +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Date &$date, $level) + { + $output = ''; + $_date = $date->getDate(); + if ($_date) { + $output .= $level.' DATE '.$_date."\n"; + } else { + return $output; + } + + // level up + $level++; + // Time + $time = $date->getTime(); + if ($time) { + $output .= $level.' TIME '.$time."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Head/Gedc.php b/src/Writer/Head/Gedc.php new file mode 100644 index 00000000..4b52df07 --- /dev/null +++ b/src/Writer/Head/Gedc.php @@ -0,0 +1,45 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head; + +class Gedc +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Gedc &$gedc, $level) + { + $output = $level." GEDC \n"; + + // level up + $level++; + // VERS + $vers = $gedc->getVersion(); + if ($vers) { + $output .= $level.' VERS '.$vers."\n"; + } + + // FORM + $form = $gedc->getForm(); + if ($form) { + $output .= $level.' FORM '.$form."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Head/Plac.php b/src/Writer/Head/Plac.php new file mode 100644 index 00000000..3169329e --- /dev/null +++ b/src/Writer/Head/Plac.php @@ -0,0 +1,39 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head; + +class Plac +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Plac &$plac, $level) + { + $output = $level." PLAC \n"; + + // level up + $level++; + // FORM + $form = $plac->getForm(); + if ($form) { + $output .= $level.' FORM '.$form."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Head/Sour.php b/src/Writer/Head/Sour.php new file mode 100644 index 00000000..3447078c --- /dev/null +++ b/src/Writer/Head/Sour.php @@ -0,0 +1,66 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head; + +class Sour +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Sour &$sour, $level) + { + $output = ''; + $_sour = $sour->getSour(); + if ($_sour) { + $output .= $level.' SOUR '.$_sour."\n"; + } else { + return $output; + } + + // level up + $level++; + + // VERS + $vers = $sour->getVersion(); + if ($vers) { + $output .= $level.' VERS '.$vers."\n"; + } + + // NAME + $name = $sour->getName(); + if ($name) { + $output .= $level.' NAME '.$name."\n"; + } + + // CORP + $corp = $sour->getCorp(); + if ($corp) { + $_convert = \Gedcom\Writer\Head\Sour\Corp::convert($corp, $level); + $output .= $_convert; + } + + // DATA + $data = $sour->getData(); + if ($data) { + $_convert = \Gedcom\Writer\Head\Sour\Data::convert($data, $level); + $output .= $_convert; + } + + return $output; + } +} diff --git a/src/Writer/Head/Sour/Corp.php b/src/Writer/Head/Sour/Corp.php new file mode 100644 index 00000000..afc0f0dd --- /dev/null +++ b/src/Writer/Head/Sour/Corp.php @@ -0,0 +1,58 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head\Sour; + +class Corp +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Sour\Corp &$corp, $level) + { + $output = ''; + $_corp = $corp->getCorp(); + if ($_corp) { + $output .= $level.' CORP '.$_corp."\n"; + } else { + return $output; + } + + // level up + $level++; + + // ADDR + $addr = $corp->getAddr(); + if ($addr) { + $_convert = \Gedcom\Writer\Addr::convert($addr, $level); + $output .= $_convert; + } + + // phon + $phon = $corp->getPhon(); + if ($phon && count($phon) > 0) { + foreach ($phon as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Phon::convert($item, $level); + $output .= $_convert; + } + } + } + + return $output; + } +} diff --git a/src/Writer/Head/Sour/Data.php b/src/Writer/Head/Sour/Data.php new file mode 100644 index 00000000..f51bed12 --- /dev/null +++ b/src/Writer/Head/Sour/Data.php @@ -0,0 +1,52 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Head\Sour; + +class Data +{ + /** + * @param string $format + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Head\Sour\Data &$data, $level) + { + $output = ''; + $_data = $data->getData(); + if ($_data) { + $output .= $level.' DATA '.$_data."\n"; + } else { + return $output; + } + + // level up + $level++; + + // DATE + $date = $corp->getDate(); + if ($date) { + $output .= $level.' DATE '.$date."\n"; + } + + // COPR + $corp = $corp->getCorp(); + if ($corp) { + $output .= $level.' COPR '.$corp."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Indi.php b/src/Writer/Indi.php new file mode 100644 index 00000000..3a2f848d --- /dev/null +++ b/src/Writer/Indi.php @@ -0,0 +1,270 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Indi +{ + /** + * @param string $format + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi &$indi) + { + $level = 0; + + // id + $id = $indi->getId(); + + // gid + $gid = $indi->getGid(); + $output = $level.' @'.$gid."@ INDI\n"; + + // increase level after start indi + $level++; + + // uid + $uid = $indi->getUid(); + if (!empty($uid)) { + $output .= $level.' _UID '.$uid."\n"; + } + + // $attr + // Gedcom/Record/Attr extend Gedcom/Record/Even and there is no change. + // So used convert Even + $attr = $indi->getAllAttr(); + if (!empty($attr) && count($attr) > 0) { + foreach ($attr as $item) { + $_convert = \Gedcom\Writer\Indi\Even::convert($item, $level); + $output .= $_convert; + } + } + + // $even + $even = $indi->getAllEven(); + if (!empty($even) && count($even) > 0) { + foreach ($even as $item) { + $_convert = \Gedcom\Writer\Indi\Even::convert($item, $level); + $output .= $_convert; + } + } + + // $note + + $note = $indi->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + // $obje + $obje = $indi->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + + // $sour + $sour = $indi->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + + // $name + $name = $indi->getName(); + if (!empty($name) && count($name) > 0) { + foreach ($name as $item) { + $_convert = \Gedcom\Writer\Indi\Name::convert($item, $level); + $output .= $_convert; + } + } + + // $alia + $alia = $indi->getAlia(); + if (!empty($alia) && count($alia) > 0) { + foreach ($alia as $item) { + if (!empty($item)) { + $_convert = $level.' ALIA '.$item."\n"; + $output .= $_convert; + } + } + } + + // $sex + $sex = $indi->getSex(); + if (!empty($sex)) { + $output .= $level.' SEX '.$sex."\n"; + } + + // $birthday + $birthday = $indi->getBirt(); + if (!empty($birthday)) { + $output .= $level.' BIRT '."\n"; + $output .= ($level + 1).' DATE '.$birthday."\n"; + } + + // $deathday + $deathday = $indi->getDeat(); + if (!empty($deathday)) { + $output .= $level.' DEAT '."\n"; + $output .= ($level + 1).' DATE '.$deathday."\n"; + } + + // $burialday + $burialday = $indi->getBuri(); + if (!empty($burialday)) { + $output .= $level.' BURI '."\n"; + $output .= ($level + 1).' DATE '.$burialday."\n"; + } + + // $rin + $rin = $indi->getRin(); + if (!empty($rin)) { + $output .= $level.' RIN '.$rin."\n"; + } + + // $resn + $resn = $indi->getResn(); + if (!empty($resn)) { + $output .= $level.' RESN '.$resn."\n"; + } + + // $rfn + $rfn = $indi->getRfn(); + if (!empty($rfn)) { + $output .= $level.' RFN '.$rfn."\n"; + } + + // $afn + $afn = $indi->getAfn(); + if (!empty($afn)) { + $output .= $level.' AFN '.$afn."\n"; + } + + // Fams[] + $fams = $indi->getFams(); + if (!empty($fams) && count($fams) > 0) { + foreach ($fams as $item) { + $_convert = \Gedcom\Writer\Indi\Fams::convert($item, $level); + $output .= $_convert; + } + } + + // Famc[] + $famc = $indi->getFamc(); + if (!empty($famc) && count($famc) > 0) { + foreach ($famc as $item) { + $_convert = \Gedcom\Writer\Indi\Famc::convert($item, $level); + $output .= $_convert; + } + } + + // Asso[] + $asso = $indi->getAsso(); + if (!empty($asso) && count($asso) > 0) { + foreach ($asso as $item) { + $_convert = \Gedcom\Writer\Indi\Asso::convert($item, $level); + $output .= $_convert; + } + } + + // $subm + $subm = $indi->getSubm(); + if (!empty($subm) && count($subm) > 0) { + foreach ($subm as $item) { + if (!empty($item)) { + $_convert = $level.' SUBM '.$item."\n"; + $output .= $_convert; + } + } + } + + // $anci + $anci = $indi->getAnci(); + if (!empty($anci) && count($anci) > 0) { + foreach ($anci as $item) { + $_convert = $level.' ANCI '.$item."\n"; + $output .= $_convert; + } + } + + // $desi + $desi = $indi->getDesi(); + if (!empty($desi) && count($desi) > 0) { + foreach ($desi as $item) { + $_convert = $level.' DESI '.$item."\n"; + $output .= $_convert; + } + } + + // Refn[] + $refn = $indi->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + + // chan + $chan = $indi->getChan(); + if (!empty($chan)) { + $output .= $level.' CHAN '."\n"; + $output .= ($level + 1).' DATE '.$chan[0]."\n"; + $output .= ($level + 1).' TIME '.$chan[1]."\n"; + } + + // Bapl + // Currently Bapl is empty + // $bapl = $indi->getBapl(); + // if(!empty($bapl)){ + // $_convert = \Gedcom\Writer\Indi\Bapl::convert($bapl, $level); + // $output.=$_convert; + // } + + // Conl + // Currently Conl is empty + // $conl = $indi->getConl(); + // if(!empty($conl)){ + // $_convert = \Gedcom\Writer\Indi\Conl::convert($conl, $level); + // $output.=$_convert; + // } + + // Endl + // Currently Endl is empty + // $endl = $indi->getEndl(); + // if(!empty($endl)){ + // $_convert = \Gedcom\Writer\Indi\Endl::convert($endl, $level); + // $output.=$_convert; + // } + + // Slgc + // Currently Endl is empty + // $slgc = $indi->getSlgc(); + // if(!empty($slgc)){ + // $_convert = \Gedcom\Writer\Indi\Slgc::convert($slgc, $level); + // $output.=$_convert; + // } + + return $output; + } +} diff --git a/src/Writer/Indi/Asso.php b/src/Writer/Indi/Asso.php new file mode 100644 index 00000000..373a8a0b --- /dev/null +++ b/src/Writer/Indi/Asso.php @@ -0,0 +1,62 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Asso +{ + /** + * @param \Gedcom\Record\Indi\Asso $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Asso &$asso, $level = 0) + { + $output = ''; + // _indi + $_indi = $asso->getIndi(); + if (empty($_indi)) { + return $output; + } + $output .= $level.' ASSO '.$_indi."\n"; + // level up + $level++; + + // RELA + $rela = $asso->getRela(); + if (!empty($rela)) { + $output .= $level.' RELA '.$rela."\n"; + } + // sour + $sour = $asso->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + + // note + $note = $asso->getSour(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Indi/Attr.php b/src/Writer/Indi/Attr.php new file mode 100644 index 00000000..b16cd27a --- /dev/null +++ b/src/Writer/Indi/Attr.php @@ -0,0 +1,28 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Attr +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Attr &$attr, $level = 0) + { + return ''; + } +} diff --git a/src/Writer/Indi/Even.php b/src/Writer/Indi/Even.php new file mode 100644 index 00000000..a3bf06a5 --- /dev/null +++ b/src/Writer/Indi/Even.php @@ -0,0 +1,125 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Even +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Even &$even, $level = 0) + { + $output = ''; + + // $_attr; + $attr = $even->getAttr(); + if (!empty($attr)) { + $output .= $level.' EVEN '.$attr."\n"; + } else { + $output = $level." EVEN\n"; + } + $level++; + + // $type; + $type = $even->getType(); + if (!empty($type)) { + $output .= $level.' TYPE '.$type."\n"; + } + + // $date; + $date = $even->getDate(); + if (!empty($date)) { + $output .= $level.' DATE '.$date."\n"; + } + + // Plac + $plac = $even->getPlac(); + if (!empty($plac)) { + $_convert = \Gedcom\Writer\Indi\Even\Plac::convert($plac, $level); + $output .= $_convert; + } + + // $caus; + $caus = $even->getCaus(); + if (!empty($caus)) { + $output .= $level.' CAUS '.$caus."\n"; + } + + // $age; + $age = $even->getAge(); + if (!empty($age)) { + $output .= $level.' AGE '.$age."\n"; + } + + // $addr + $addr = $even->getAddr(); + if (!empty($addr)) { + $_convert = \Gedcom\Writer\Addr::convert($addr, $level); + $output .= $_convert; + } + + // $phon = array() + $phon = $even->getPhon(); + if (!empty($phon) && count($phon) > 0) { + foreach ($phon as $item) { + $_convert = \Gedcom\Writer\Phon::convert($item, $level); + $output .= $_convert; + } + } + // $agnc + $agnc = $even->getAgnc(); + if (!empty($agnc)) { + $output .= $level.' AGNC '.$agnc."\n"; + } + + // $ref = array(); + // This is not in parser + + // $obje = array(); + $obje = $even->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + // $sour = array(); + $sour = $even->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + // $note = array(); + $note = $even->getSour(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + // Record\Chan + $chan = $even->getChan(); + if (!empty($chan)) { + $_convert = \Gedcom\Writer\Chan::convert($item, $level); + $output .= $_convert; + } + + return $output; + } +} diff --git a/src/Writer/Indi/Even/Plac.php b/src/Writer/Indi/Even/Plac.php new file mode 100644 index 00000000..5e88829d --- /dev/null +++ b/src/Writer/Indi/Even/Plac.php @@ -0,0 +1,64 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi\Even; + +class Plac +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Even\Plac &$plac, $level = 0) + { + $output = ''; + + // $plac + $_plac = $plac->getPlac(); + if (!empty($_plac)) { + $output .= $level.' PLAC '.$_plac."\n"; + } else { + $output .= $level." PLAC\n"; + } + + // level up + $level++; + + // $form + $form = $plac->getForm(); + if (!empty($form)) { + $output .= $level.' FORM '.$form."\n"; + } + + // $note -array + $note = $plac->getNote(); + if ($note && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + // $sour -array + $sour = $plac->getSour(); + if ($sour && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Indi/Famc.php b/src/Writer/Indi/Famc.php new file mode 100644 index 00000000..3015e98a --- /dev/null +++ b/src/Writer/Indi/Famc.php @@ -0,0 +1,54 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Famc +{ + /** + * @param \Gedcom\Record\Indi\Famc $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Famc &$famc, $level = 0) + { + $output = ''; + // NAME + $_famc = $famc->getFams(); + if (empty($_fams)) { + return $output; + } + $output .= $level.' FAMC @'.$_famc."@\n"; + // level up + $level++; + + // PEDI + $pedi = $famc->getPedi(); + if (!empty($pedi)) { + $output .= $level.' PEDI '.$pedi."\n"; + } + + // note + $note = $famc->getSour(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Indi/Fams.php b/src/Writer/Indi/Fams.php new file mode 100644 index 00000000..06d990d8 --- /dev/null +++ b/src/Writer/Indi/Fams.php @@ -0,0 +1,48 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Fams +{ + /** + * @param \Gedcom\Record\Indi\Fams $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Fams &$fams, $level = 0) + { + $output = ''; + // NAME + $_fams = $fams->getFams(); + if (empty($_fams)) { + return $output; + } + $output .= $level.' FAMS @'.$_fams."@\n"; + // level up + $level++; + + // note + $note = $fams->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Indi/Name.php b/src/Writer/Indi/Name.php new file mode 100644 index 00000000..f8ad0448 --- /dev/null +++ b/src/Writer/Indi/Name.php @@ -0,0 +1,87 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Indi; + +class Name +{ + /** + * @param \Gedcom\Record\Indi\Name $attr + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Indi\Name &$name, $level = 0) + { + $output = ''; + // NAME + $_name = $name->getName(); + if (empty($_name)) { + return $output; + } + $output .= $level.' NAME '.$_name."\n"; + // level up + $level++; + + // NPFX + $npfx = $name->getNpfx(); + if (!empty($npfx)) { + $output .= $level.' NPFX '.$npfx."\n"; + } + + // GIVN + $givn = $name->getGivn(); + if (!empty($givn)) { + $output .= $level.' GIVN '.$givn."\n"; + } + // NICK + $nick = $name->getNick(); + if (!empty($nick)) { + $output .= $level.' NICK '.$nick."\n"; + } + // SPFX + $spfx = $name->getSpfx(); + if (!empty($spfx)) { + $output .= $level.' SPFX '.$spfx."\n"; + } + // SURN + $surn = $name->getSurn(); + if (!empty($surn)) { + $output .= $level.' SURN '.$surn."\n"; + } + // NSFX + $nsfx = $name->getNsfx(); + if (!empty($nsfx)) { + $output .= $level.' NSFX '.$nsfx."\n"; + } + // SOUR + $sour = $name->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + // note + $note = $name->getSour(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Note.php b/src/Writer/Note.php new file mode 100644 index 00000000..9f0e6960 --- /dev/null +++ b/src/Writer/Note.php @@ -0,0 +1,80 @@ + + * @copyright Copyright (c) 2010-2013, Kristopher Wilson + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Note +{ + /** + * @param \Gedcom\Record\Note $sour + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Note &$note) + { + $level = 0; + $output = ''; + $id = $note->getId(); + if (!empty($id)) { + $output .= $level.' '.$id.' '." NOTE \n"; + } else { + return $output; + } + + // Level Up + $level++; + // RIN + $rin = $note->getRin(); + if ($rin) { + $output .= $level.' RIN '.$rin."\n"; + } + + // cont + $cont = $note->getNote(); + if ($cont) { + $output .= $level.' CONT '.$cont."\n"; + } + + // REFN + $refn = $note->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + } + // CHAN + $chan = $note->getChan(); + if ($chan) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + + // SOUR array + $sour = $note->getSour(); + if (!empty($sour) && count($sour) > 0) { + foreach ($sour as $item) { + if ($item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + } + + return $output; + } +} diff --git a/src/Writer/NoteRef.php b/src/Writer/NoteRef.php new file mode 100644 index 00000000..ced20593 --- /dev/null +++ b/src/Writer/NoteRef.php @@ -0,0 +1,46 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class NoteRef +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\NoteRef &$note, $level) + { + $output = ''; + + // $_note + $_note = $note->getNote(); + if (!empty($_note)) { + $output .= $level.' NOTE '.$_note."\n"; + } + + $level++; + // $sour + $sour = $note->getSour(); + if ($sour && count($sour) > 0) { + foreach ($sour as $item) { + $_convert = \Gedcom\Writer\SourRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Obje.php b/src/Writer/Obje.php new file mode 100644 index 00000000..52c18c8d --- /dev/null +++ b/src/Writer/Obje.php @@ -0,0 +1,104 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Obje +{ + /** + * @param \Gedcom\Record\Obje $sour + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Obje &$obje) + { + $level = 0; + $output = ''; + $id = $obje->getId(); + if ($id) { + $output .= $level.' '.$id." OBJE\n"; + } else { + return $output; + } + + // level up + $level++; + + // FORM + $form = $obje->getName(); + if ($form) { + $output .= $level.' FORM '.$form."\n"; + } + + // TITL + $titl = $obje->getTitl(); + if ($titl) { + $output .= $level.' TITL '.$titl."\n"; + } + + // OBJE + // This is same as FORM + + // RIN + $rin = $obje->getRin(); + if ($rin) { + $output .= $level.' RIN '.$rin."\n"; + } + + // REFN + $refn = $obje->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + } + + // BLOB + $blob = $obje->getBlob(); + if ($blob) { + $output .= $level.' BLOB '.$blob."\n"; + } + + // NOTE + $note = $obje->getNote(); + if ($note && count($note) > 0) { + foreach ($note as $item) { + if ($item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + } + + // CHAN + $chan = $obje->getChan(); + if ($chan) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + + // FILE + $file = $obje->getFile(); + if ($file) { + $output .= $level.' FILE '.$file."\n"; + } + + // + return $output; + } +} diff --git a/src/Writer/ObjeRef.php b/src/Writer/ObjeRef.php new file mode 100644 index 00000000..425cb783 --- /dev/null +++ b/src/Writer/ObjeRef.php @@ -0,0 +1,67 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class ObjeRef +{ + /** + * @param \Gedcom\Record\ObjeRef $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\ObjeRef &$obje, $level) + { + $output = ''; + + // $_note + $_obje = $obje->getObje(); + if (!empty($_note)) { + $output .= $level.' OBJE '.$_obje."\n"; + } else { + $output .= $level." OBJE \n"; + } + + $level++; + // _form + $_form = $obje->getForm(); + if (!empty($_form)) { + $output .= $level.' FORM '.$_form."\n"; + } + + // _titl + $_titl = $obje->getTitl(); + if (!empty($_titl)) { + $output .= $level.' TITL '.$_titl."\n"; + } + + // _file + $_file = $obje->getFile(); + if (!empty($_file)) { + $output .= $level.' FILE '.$_file."\n"; + } + + // $_note = array() + $_note = $obje->getNote(); + if (!empty($_note) && count($_note) > 0) { + foreach ($_note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/library/PhpGedcom/Writer/Phon.php b/src/Writer/Phon.php similarity index 59% rename from library/PhpGedcom/Writer/Phon.php rename to src/Writer/Phon.php index 75505963..e700859f 100644 --- a/library/PhpGedcom/Writer/Phon.php +++ b/src/Writer/Phon.php @@ -1,34 +1,30 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcom\Writer; +namespace Gedcom\Writer; -/** - * - */ class Phon { /** * @param string $phon * @param string $format - * @param int $level + * @param int $level + * * @return string */ - public static function convert($phon, $format = self::GEDCOM55, $level = 1) + public static function convert($phon, $level = 1) { - $output = "{$level} PHON " . $phon . "\n"; - - return $output; + return "{$level} PHON ".$phon."\n"; } } diff --git a/src/Writer/Refn.php b/src/Writer/Refn.php new file mode 100644 index 00000000..b1ed17c2 --- /dev/null +++ b/src/Writer/Refn.php @@ -0,0 +1,44 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Refn +{ + /** + * @param \Gedcom\Record\Refn $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Refn &$refn, $level) + { + $output = ''; + $_refn = $refn->getRefn(); + if (empty($_refn)) { + return $output; + } else { + $output .= $level.' REFN '.$_refn."\n"; + } + // level up + $level++; + // DATE + $type = $refn->getType(); + if (!empty($type)) { + $output .= $level.' TYPE '.$type."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Repo.php b/src/Writer/Repo.php new file mode 100644 index 00000000..478dc96b --- /dev/null +++ b/src/Writer/Repo.php @@ -0,0 +1,96 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Repo +{ + /** + * @param \Gedcom\Record\Repo $sour + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Repo &$repo) + { + $level = 0; + $output = ''; + $_repo = $repo->getRepo(); + if ($_repo) { + $output .= $level.' '.$_repo." REPO\n"; + } else { + return $output; + } + + // level up + $level++; + + //NAME + $name = $repo->getName(); + if ($name) { + $output .= $level.' NAME '.$name."\n"; + } + + // ADDR + $addr = $repo->getAddr(); + if ($addr) { + $_convert = \Gedcom\Writer\Addr::convert($addr, $level); + $output .= $_convert; + } + + // PHON + $phon = $repo->getPhon(); + if ($phon) { + $_convert = \Gedcom\Writer\Phon::convert($phon, $level); + $output .= $_convert; + } + + // NOTE array + $note = $repo->getNote(); + if ($note && count($note) > 0) { + foreach ($note as $item) { + if ($item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + } + + // REFN + $refn = $repo->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + } + + // CHAN + $chan = $repo->getChan(); + if ($chan) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + + // RIN + $rin = $repo->getRin(); + if ($rin) { + $output .= $level.' RIN '.$rin."\n"; + } + + return $output; + } +} diff --git a/src/Writer/RepoRef.php b/src/Writer/RepoRef.php new file mode 100644 index 00000000..b9df6565 --- /dev/null +++ b/src/Writer/RepoRef.php @@ -0,0 +1,56 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class RepoRef +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\RepoRef &$reporef, $level) + { + $output = ''; + $_repo = $reporef->getRepo(); + if (empty($_sour)) { + return $output; + } else { + $output .= $level.' REPO '.$_repo."\n"; + } + // level up + $level++; + + // Note array + $note = $reporef->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + // _caln array + $_caln = $reporef->getCaln(); + if (!empty($_caln) && count($_caln) > 0) { + foreach ($_caln as $item) { + $_convert = \Gedcom\Writer\Caln::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Sour.php b/src/Writer/Sour.php new file mode 100644 index 00000000..b7ce624f --- /dev/null +++ b/src/Writer/Sour.php @@ -0,0 +1,122 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Sour +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Sour &$sour, $level) + { + $output = ''; + $_sour = $sour->getSour(); + if (empty($_sour)) { + return $output; + } else { + $output .= $level.' '.$_sour.' SOUR '."\n"; + } + // level up + $level++; + + // TITL + $titl = $sour->getType(); + if (!empty($type)) { + $output .= $level.' TITL '.$titl."\n"; + } + + // RIN + $rin = $sour->getRin(); + if (!empty($rin)) { + $output .= $level.' RIN '.$rin."\n"; + } + + // AUTH + $auth = $sour->getAuth(); + if (!empty($auth)) { + $output .= $level.' AUTH '.$auth."\n"; + } + + // TEXT + $text = $sour->getText(); + if (!empty($text)) { + $output .= $level.' TEXT '.$text."\n"; + } + + // PUBL + $publ = $sour->getPubl(); + if (!empty($publ)) { + $output .= $level.' PUBL '.$publ."\n"; + } + + // ABBR + $abbr = $sour->getAbbr(); + if (!empty($abbr)) { + $output .= $level.' ABBR '.$abbr."\n"; + } + + // REPO + $repo = $sour->getRepo(); + if (!empty($repo)) { + $_convert = \Gedcom\Writer\RepoRef::convert($repo, $level); + $output .= $_convert; + } + + // NOTE array + $note = $sour->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + // DATA + $data = $sour->getData(); + if (!empty($data)) { + $_convert = \Gedcom\Writer\Sour\Data::convert($data, $level); + $output .= $_convert; + } + + // OBJE array + $obje = $sour->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + + // REFN array + $refn = $sour->getRefn(); + if (!empty($refn) && count($refn) > 0) { + foreach ($refn as $item) { + $_convert = \Gedcom\Writer\Refn::convert($item, $level); + $output .= $_convert; + } + } + + // chan + $chan = $sour->getChan(); + if (!empty($chan)) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + + return $output; + } +} diff --git a/src/Writer/Sour/Data.php b/src/Writer/Sour/Data.php new file mode 100644 index 00000000..6209ed82 --- /dev/null +++ b/src/Writer/Sour/Data.php @@ -0,0 +1,67 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Sour; + +class Data +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Sour\Data &$data, $level = 0) + { + $output = $level." DATA\n"; + $level++; + + // $_date; + $date = $data->getDate(); + if (!empty($date)) { + $output .= $level.' DATE '.$date."\n"; + } + + // $_agnc AGNC + $_agnc = $data->getAgnc(); + if (!empty($_agnc)) { + $output .= $level.' AGNC '.$_agnc."\n"; + } + + // $_text + $_text = $data->getText(); + if (!empty($_text)) { + $output .= $level.' TEXT '.$_text."\n"; + } + + // $_note + $note = $data->getNote(); + if ($note && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + // $_even + $_even = $data->getEven(); + if ($_even && count($_even) > 0) { + foreach ($_even as $item) { + $_convert = \Gedcom\Writer\Sour\Data\Even::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Sour/Data/Even.php b/src/Writer/Sour/Data/Even.php new file mode 100644 index 00000000..1efa1de0 --- /dev/null +++ b/src/Writer/Sour/Data/Even.php @@ -0,0 +1,43 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\Sour\Data; + +class Even +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Sour\Data\Even &$even, $level) + { + $output = $level." EVEN\n"; + $level++; + + // $date; + $date = $even->getDate(); + if (!empty($date)) { + $output .= $level.' DATE '.$date."\n"; + } + + // Plac + $plac = $even->getPlac(); + if (!empty($plac)) { + $output .= $level.' PLAC '.$plac."\n"; + } + + return $output; + } +} diff --git a/src/Writer/SourRef.php b/src/Writer/SourRef.php new file mode 100644 index 00000000..055bc82d --- /dev/null +++ b/src/Writer/SourRef.php @@ -0,0 +1,71 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class SourRef +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\SourRef &$sour, $level) + { + $output = ''; + $_sour = $sour->getSour(); + if (!empty($_sour)) { + $output .= $level.' SOUR '.$_sour."\n"; + } + $level++; + // protected $_text = null; + $_text = $sour->getText(); + if (!empty($_text)) { + $output .= $level.' TEXT '.$_text."\n"; + } + // protected $_note = array(); + $note = $sour->getNote(); + if ($note && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + // protected $_data = null; + $_data = $sour->getData(); + if ($_data) { + $_convert = \Gedcom\Writer\Sour\Data::convert($_data, $level); + $output .= $_convert; + } + // protected $_page setPage + $_page = $sour->getPage(); + if (!empty($_page)) { + $output .= $level.' PAGE '.$_page."\n"; + } + // protected $_even = null; + $_even = $sour->getData(); + if ($_even) { + $_convert = \Gedcom\Writer\SourRef\Even::convert($_even, $level); + $output .= $_convert; + } + // protected $_quay + $_quay = $sour->getQuay(); + if (!empty($_quay)) { + $output .= $level.' QUAY '.$_quay."\n"; + } + // protected $_obje = array(); + // This is not defined in parser. + return $output; + } +} diff --git a/src/Writer/SourRef/Even.php b/src/Writer/SourRef/Even.php new file mode 100644 index 00000000..c409a895 --- /dev/null +++ b/src/Writer/SourRef/Even.php @@ -0,0 +1,46 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer\SourRef; + +class Even +{ + /** + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\SourRef\Even &$even, $level = 0) + { + $output = ''; + + // $_date; + $_even = $even->getEven(); + if (!empty($_even)) { + $output .= $level.' EVEN '.$_even."\n"; + } else { + $output = $level." EVEN\n"; + } + // level up + $level++; + + // $_role ROLE + $_role = $data->getRole(); + if (!empty($_role)) { + $output .= $level.' ROLE '.$_role."\n"; + } + + return $output; + } +} diff --git a/src/Writer/Subm.php b/src/Writer/Subm.php new file mode 100644 index 00000000..d580f147 --- /dev/null +++ b/src/Writer/Subm.php @@ -0,0 +1,111 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Subm +{ + /** + * @param \Gedcom\Record\Subm $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Subm &$subm) + { + $level = 0; + $output = ''; + $_subm = $subm->getSubn(); + if (empty($_subm)) { + return $output; + } else { + $output .= $level.' '.$_subm.' SUBM '."\n"; + } + // level up + $level++; + + // NAME + $name = $subm->getName(); + if (!empty($name)) { + $output .= $level.' NAME '.$name."\n"; + } + // $chan + $chan = $subm->getChan(); + if ($chan) { + $_convert = \Gedcom\Writer\Chan::convert($chan, $level); + $output .= $_convert; + } + + // $addr + $addr = $subm->getAddr(); + if ($addr) { + $_convert = \Gedcom\Writer\Addr::convert($addr, $level); + $output .= $_convert; + } + + // $rin + $rin = $subm->getRin(); + if (!empty($rin)) { + $output .= $level.' RIN '.$rin."\n"; + } + + // $rfn + $rfn = $subm->getRfn(); + if (!empty($rfn)) { + $output .= $level.' RFN '.$rfn."\n"; + } + + // $lang = array() + $langs = $subm->getLang(); + if (!empty($langs) && count($langs) > 0) { + foreach ($langs as $item) { + if ($item) { + $_convert = $level.' LANG '.$item."\n"; + $output .= $_convert; + } + } + } + + // $phon = array() + $phon = $subm->getLang(); + if (!empty($phon) && count($phon) > 0) { + foreach ($phon as $item) { + if ($item) { + $_convert = \Gedcom\Writer\Phon::convert($item, $level); + $output .= $_convert; + } + } + } + + // $obje = array() + $obje = $subm->getObje(); + if (!empty($obje) && count($obje) > 0) { + foreach ($obje as $item) { + $_convert = \Gedcom\Writer\ObjeRef::convert($item, $level); + $output .= $_convert; + } + } + + // note + $note = $subm->getNote(); + if (!empty($note) && count($note) > 0) { + foreach ($note as $item) { + $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); + $output .= $_convert; + } + } + + return $output; + } +} diff --git a/src/Writer/Subn.php b/src/Writer/Subn.php new file mode 100644 index 00000000..1fa42495 --- /dev/null +++ b/src/Writer/Subn.php @@ -0,0 +1,81 @@ + + * @copyright Copyright (c) 2010-2013, Xiang Ming + * @license MIT + * + * @link http://github.com/mrkrstphr/php-gedcom + */ + +namespace Gedcom\Writer; + +class Subn +{ + /** + * @param \Gedcom\Record\Subn $note + * @param int $level + * + * @return string + */ + public static function convert(\Gedcom\Record\Subn &$subn) + { + $level = 0; + $output = ''; + $_subn = $subn->getSubn(); + if (empty($_subn)) { + return $output; + } else { + $output .= $level.' '.$_subn." SUBN \n"; + } + // level up + $level++; + + // SUBM + $subm = $subn->getSubm(); + if (!empty($subm)) { + $output .= $level.' SUBM '.$subm."\n"; + } + + // FAMF + $famf = $subn->getFamf(); + if (!empty($famf)) { + $output .= $level.' FAMF '.$famf."\n"; + } + + // TEMP + $temp = $subn->getTemp(); + if (!empty($temp)) { + $output .= $level.' TEMP '.$temp."\n"; + } + + // ANCE + $ance = $subn->getAnce(); + if (!empty($ance)) { + $output .= $level.' ANCE '.$ance."\n"; + } + + // DESC + $desc = $subn->getDesc(); + if (!empty($desc)) { + $output .= $level.' DESC '.$desc."\n"; + } + // ORDI + $ordi = $subn->getOrdi(); + if (!empty($ordi)) { + $output .= $level.' ORDI '.$ordi."\n"; + } + + // RIN + $rin = $subn->getRin(); + if (!empty($rin)) { + $output .= $level.' RIN '.$rin."\n"; + } + + return $output; + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 52f1b878..ebebc8e2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,10 @@ parse($sample); diff --git a/tests/issue/Issue00017Test.php b/tests/issue/Issue00017Test.php index 369f126b..afea316f 100644 --- a/tests/issue/Issue00017Test.php +++ b/tests/issue/Issue00017Test.php @@ -1,12 +1,11 @@ parse($sample); diff --git a/tests/issue/Issue00018Test.php b/tests/issue/Issue00018Test.php index 5e5c6159..3e9c0b60 100644 --- a/tests/issue/Issue00018Test.php +++ b/tests/issue/Issue00018Test.php @@ -1,12 +1,11 @@ parse($sample); diff --git a/tests/library/Gedcom/ParserTest.php b/tests/library/Gedcom/ParserTest.php index b5e08e42..5b9329ff 100644 --- a/tests/library/Gedcom/ParserTest.php +++ b/tests/library/Gedcom/ParserTest.php @@ -1,57 +1,47 @@ * @copyright Copyright (c) 2010-2013, Kristopher Wilson - * @package php-gedcom - * @license GPL-3.0 + * @license MIT + * * @link http://github.com/mrkrstphr/php-gedcom */ -namespace PhpGedcomTest; +namespace GedcomTest; -use PhpGedcom\Parser; +use Gedcom\Parser; /** - * Class ParserTest - * @package PhpGedcomTest + * Class ParserTest. */ class ParserTest extends \PHPUnit_Framework_TestCase { /** - * @var \PhpGedcom\Parser - */ - protected $parser = null; - - /** - * @var \PhpGedcom\Gedcom + * @var \Gedcom\Parser */ - protected $gedcom = null; - + protected $parser = null; + /** - * + * @var \Gedcom */ + protected $gedcom = null; + public function setUp() { $this->parser = new Parser(); - $this->gedcom = $this->parser->parse(TEST_DIR . '/stresstestfiles/TGC551LF.ged'); + $this->gedcom = $this->parser->parse(TEST_DIR.'/stresstestfiles/TGC551LF.ged'); } - /** - * - */ public function testNoErrors() { $this->assertEquals(1, count($this->parser->getErrors())); } - /** - * - */ public function testRecordCounts() { $this->assertEquals(count($this->gedcom->getIndi()), 15); @@ -62,9 +52,6 @@ public function testRecordCounts() $this->assertEquals(count($this->gedcom->getRepo()), 1); } - /** - * - */ public function testHead() { $head = $this->gedcom->getHead(); @@ -114,9 +101,6 @@ public function testHead() $this->assertEquals($head->getSubn(), 'SUBMISSION'); } - /** - * - */ public function testSubn() { $subn = $this->gedcom->getSubn(); @@ -131,9 +115,6 @@ public function testSubn() $this->assertEquals($subn->getRin(), '1'); } - /** - * - */ public function testSubm() { $subm = $this->gedcom->getSubm(); @@ -142,10 +123,10 @@ public function testSubm() $this->assertEquals($subm['SUBMITTER']->getName(), 'John A. Nairn'); $this->assertEquals( $subm['SUBMITTER']->getAddr()->getAddr(), - "Submitter address line 1\n" . - "Submitter address line 2\n" . - "Submitter address line 3\n" . - "Submitter address line 4" + "Submitter address line 1\n". + "Submitter address line 2\n". + "Submitter address line 3\n". + 'Submitter address line 4' ); $this->assertEquals($subm['SUBMITTER']->getAddr()->getAdr1(), 'Submitter address line 1'); @@ -175,13 +156,12 @@ public function testSubm() $note = current($obje->getNote()); $this->assertEquals($note->getNote(), 'N1'); - $this->assertEquals($subm['SM2']->getSubm(), 'SM2'); $this->assertEquals($subm['SM2']->getName(), 'Secondary Submitter'); $this->assertEquals( $subm['SM2']->getAddr()->getAddr(), - "Secondary Submitter Address 1\n" . - "Secondary Submitter Address 2" + "Secondary Submitter Address 1\n". + 'Secondary Submitter Address 2' ); $lang = $subm['SM2']->getLang(); @@ -190,54 +170,34 @@ public function testSubm() $this->assertEquals($subm['SM2']->getChan()->getTime(), '10:38:33'); $this->assertEquals($subm['SM2']->getRin(), '2'); - $this->assertEquals($subm['SM3']->getSubm(), 'SM3'); $this->assertEquals($subm['SM3']->getName(), 'H. Eichmann'); $this->assertEquals( $subm['SM3']->getAddr()->getAddr(), - "email: h.eichmann@@mbox.iqo.uni-hannover.de\n" . - "or: heiner_eichmann@@h.maus.de (no more than 16k!!!!)" + "email: h.eichmann@@mbox.iqo.uni-hannover.de\n". + 'or: heiner_eichmann@@h.maus.de (no more than 16k!!!!)' ); $this->assertEquals($subm['SM3']->getChan()->getDate(), '13 Jun 2000'); $this->assertEquals($subm['SM3']->getChan()->getTime(), '17:07:32'); $this->assertEquals($subm['SM3']->getRin(), '3'); } - /** - * - */ public function testIndi() { - } - /** - * - */ public function testFam() { - } - /** - * - */ public function testObje() { - } - /** - * - */ public function testRepo() { - } - /** - * - */ public function testSour() { $sour = $this->gedcom->getSour(); @@ -253,9 +213,6 @@ public function testSour() $this->assertEquals($secondSource->getRin(), '2'); } - /** - * - */ public function testNote() { $firstNote = current($this->gedcom->getNote());